Saturday, March 24, 2018

Tracker - non-UWP trade codes

Now you can add non-UWP trade codes (Hot, Puzzle, etc) to the worlds. Next I need to actually do the T5 trade stuff - there was just a lot of work to get the infrastructure in place (wanting to make this user-customizable as possible so you can run it with whatever rules you want).

Finally fixed the UWP-based trade code check.  Turns out the check for isManual was not working, but you can restrict the entire list at the end:

 List results = App.DB.TradeClassifications.
     Where(x => x.Sizes.Length == 0 || x.Sizes.Contains(Size)).
     Where(x => x.Atmospheres.Length == 0 || x.Atmospheres.Contains(Atmosphere)).
     Where(x => x.Hydro.Length == 0 || x.Hydro.Contains(Hydro)).
     Where(x => x.Pop.Length == 0 || x.Pop.Contains(Population)).
     Where(x => x.Gov.Length == 0 || x.Gov.Contains(Gov)).
     Where(x =>x.Law.Length == 0 || x.Law.Contains(Law)).

     Where(x => x.IsManuallyAssigned == false).ToList();

Saturday, March 17, 2018

Tracker - T5 Trading. No, not there yet

But I am entering all the trade classifications, even the user-decided ones. I've added a flag to the table indicating if this is a manual trade code. All the UWP-based ones are auto.  I've added another table to attach trade codes to the worlds in question.  There you will be able to manually add the trade codes you want to that world, and when I check for trade code generation I'll simply add that list in.

Still need to actually do all that: in making the columns non-nullable, I broke my seed when I added all the trade codes with some non-filled values. I was hoping if I did not include something it would be empty, but the DB barfed at that, so I have to set the fields to "".  Which means I really did not have to reset the DB...oh well, now the seed has all the T5 codes.

Maybe tomorrow I'll have time for the actual cargo part. Probably not - need to finish a paper and I actually have to work a bit (need to update the work DB when no one is there so we don't interrupt users).

I am also wanting to referee or play again - I went through all my ship posters and really want a face to face game so I can use them...and I've got the Great Rift coming in at some point so I may move the play there.  Plus the Cruiser Kickstarter - I am getting all these things I should really use them!

Thursday, March 15, 2018

Tracker - trade classifications

I have been depending on the TravellerMap API to have the trade code classifications in the Remarks field. While this does work, I'd rather have a more nuanced approach to have more details.

I already have the trade code table which gives you trade codes based on the UWP characteristics.  I've added a function to get that list of trade codes based on UWP. Had an issue with nulls but I'll update the DB to not allow nulls for the list of statistics, and that should correct it.

Since I am having to wipe my DB clean again (SQLite migrations do not support changing column attributes, the adding 'not nullable') I'll also expand out the seed that imports the trade codes to include all of them (I manually entered them for testing, found the null issue, and do not want to manually enter them all over again! Although a fix would be to initialize the new classification with blanks, I'd rather have the DB enforce that). This will still allow users to add their own trade codes if they want, and the T5 trade code generator will pick random goods based on trade codes, so that will allow for that to work. It won't affect Classic as that has a very restricted list.

The code to grab the list of trade classifications is pretty simple after the fact. What I've yet to figure out is how to add additional, non-UWP derived trade codes to a world (i.e., Capitol).  I'll probably add a new table for non-UWP trade classifications to allow for the manual entry, and combine those two lists in the new function.

 List results = App.DB.TradeClassifications.Where(x => x.Sizes.Length == 0 || x.Sizes.Contains(Size)).
                Where(x => x.Atmospheres.Length == 0 || x.Atmospheres.Contains(Atmosphere)).
                Where(x => x.Hydro.Length == 0 || x.Hydro.Contains(Hydro)).
                Where(x => x.Pop.Length == 0 || x.Pop.Contains(Population)).
                Where(x => x.Gov.Length == 0 || x.Gov.Contains(Gov)).
                Where(x =>x.Law.Length == 0 || x.Law.Contains(Law)).ToList();

Sunday, March 11, 2018

Tracker - T5 Trade, a start

I've started looking into the T5 trade rules. First step was to also have the list of possible trade goods, so there is yet another trade goods table. In hindsight, there should just be 1 but the Classic rules use s D66 method for rolling up the goods, and I did not want to have to figure out how to enforce that.

So I've grabbed a few cargoes from the BBB and stuck them in there. I may extend it out a bit more (i.e. include the full description of what it really is).  This will allow the users to add whatever cargoes they want to add that are trade class based. When I generate the T5 cargo, I'll randomly pick one of the trade codes, then randomly pick one of the trade goods for that trade code.

Down the road I would like a more personalized trade goods option - some of my world workups had some fairly detailed smaller cargoes. Sometimes it is that personal touch of having 50kg of specialized organic coffee versus a container of freeze dried caffeine.

It is going slower not due to being hard, but my severe lack of time :(

And while I thought about starting a PBP game, that severe lack of time keeps raising its head...

Saturday, March 03, 2018

Tracker - Printing...and maybe a PBP game on COTI?

Got the basic printing to work. I am not exactly happy with this - I create a rich text block and fill it up. To make things align I set the font to a fixed-width font.  I actually think I could do a hidden grid on the display page and use that - it would be automatic for the databinding and I could do some formatting...

I am also possibly going to start a PBP game over on COTI.  I've got some interest there from one of my fellow members, and I've got the inkling of a game idea based on some of his suggestions.  We'll see...if so, then hopefully this blog will be split between software and actual game stuff!

Thursday, March 01, 2018

Tracker - T5 rules

The T5 trade rules are just stubbed out. If your ship is Mongoose or T5, it just returns a message about not currently supported. There is a user over on COTI that wanted a T5 trade program.  I really did not like the T5 version as it seems so dry. It is not hard to do though, so I have a short road map:

1. Finish the cargo printing manifest (4-8 hours)
2. Do the T5 cargo (unknown duration as it has been a couple of years since I read over those rules)

Unfortunately school takes priority, and this is mid-term week. I need to write a paper about a project. Fortunately, I've actually just started a project for work, and that will become my mid-term paper (and won't work be surprised to get a project charter, stakeholder communication breakdown, and a process breakdown!)  As that needs to be completed by Sunday, and I really don't think it will be too difficult, I am hopefully that I'll complete the printing by this weekend (although I really want some sort of template system so that the user can format it a bit, but that will be version 2.0, and as I am on v0.0.0.1 at the moment...)

And I may move this tracker as a project once someone other than me is using it.  When that happens I may open up a Trello board for project management the Kanban style!

And how did March sneak up so fast?