Saturday, September 06, 2025

Traveller System Update 22: Less Data Input

The idea thumping in my head was the realization that I don't really need each row on the Scout book to be a data row: they are really just ranges. We just need to know the inner range, the habitable zone, and everything else past the habitable zone is automatically Outer, and anything less than the low limit for the inner zone is not available as an orbit.

My tables are a bit misnamed, but I can live with that. I've added the star type table so we can have the B0, G5 stars and all that. It is a simple table with just the id and the name, but the idea is of course that the user may want a G3 star with a slightly different set of zones. While I'll just be using the book as-is (until I get around to reading the world builder book), my goal in a long career in software development is to let the users do what they want and need to. Always trying to write myself out of a job by writing flexible software (and really did write myself out one time!)

just a list of stars

The next step is to combine the stellar types (Ia, Ib, etc) with the star types (B0, B5, etc) with the ranges. In some circles this is called a join table, where we are really just joining many to many things. With some additional data for the zone definition. This will allow me to just say something like:

A B0 Ib size star has an inner zone range of 8-12, habitable zone 13. Anything less than the lower limit inner zone is not available, and anything past the habitable zone is automatically an outer zone. 

From a "design" perspective it looks like the below. This allows us to make any size and type of star we want to add to have its own zones. Complicated up front but lets us do what we want later. Like most things I'd rather "pay" upfront and have less to do later. Worked for me in so many ways!

The model for this is straight-forward. The UX, well, AI will be helping me a lot!
public class TStellarZones
{
    public int Id { get; set; }
    // the Ia, Ib stuff
    public int TStellarTypeId { get; set; }

    // e.g. "B0", "A5", "M3", etc
    public int StarTypeId { get; set; } 
    public int InnerZoneLow { get; set; }
    public int InnerZoneHigh { get; set; }
    public int HabitableZone { get; set; }

    public TStellarTypes? TStellarType { get; set; } // Navigation property to TStellarTypes
}

The migrations all worked for removing columns and adding new tables. Just have to pull this together to get the system working again, then update the generation process. 

On an entirely unrelated note, going to try & play Sine Tempore tomorrow with a friend. Bought the game years ago, mostly for the minis but thinking it may be a good thing to try. I did watch one sort-of play through and it seems a bit complicated. But we'll see.
the game

Fiskertom Fabio Fuzzington. Because posts with cats get more hits :)



No comments: