Saturday, October 28, 2017

Traveller Tracker - I forgot to have fuel

While the class had fuel requirements, I forgot to put in how much fuel the ship actually had. SO that's been added, and I got a bit more work done on the tracking view as seen below. Also linked in the log, so my test on the ship model auto-filling a few things worked.

Slow progress, but better than no progress.

On source control: turns out the .gitignore file when you create a git repo fills in a lot of things you don't need to save off, such as the solution and project files. It was saving off some SQLite things so I've also added the .vs directory to be ignored. Those are studio-generated files and maintained by the IDE so no need to save them off. I think....


Thursday, October 26, 2017

Traveller Tracker - source code

I should probably mention that the software is hosted on Github, so you could clone the repo & run this yourself as all the tools are free. I'm using MS Visual Studio (latest version).

The current version for UWP is here: https://github.com/COliver988/Traveller/tree/master/TravellerTracker

Unfortunately I am also saving off settings and things that probably should not be saved off, but as this is just for me and I do not foresee any other developers working on this, that's okay.  If at some point others decide to jump in, I'll set up my .gitignore file to reflect just the code, not the various settings and binary files I really don't need to track but was too lazy to get around to setting up to ignore.

I just added the MIT license which is pretty permissive.

Sunday, October 22, 2017

Traveller Tracker - working on the actual view

I've made a few small updates to some of the classes to include non-DB mapped items. Basically similar to javascript's promises - load the data when you need it.  It allows me to include the ship class object, world object and interesting things like that in the class to make the UI a lot easier to deal with.

Also added the initial pivot table for the view, not that it actually does anything yet, but hey, I've got placeholders!

Monday, October 16, 2017

Nothing to post

Unfortunately I've been busy and unable to spend any time on any Traveller projects lately.  I do want to do a world write up for Seslshor as that's where the end of the last game was.  I do have some basic stuff for it, I just need to write it up and make a PDF for it.

The software side needs a lot of work still but the basics are there. I still have to figure out the cargo side of things, and that is also version dependent. T5 is straightforward but boring, and I've got the old classic & Mongoose versions.  I may expand out my world definition to include travel codes but those can be calculated on the fly as well.  I may add Traveller version to the ship to move with that as well.  I.e., Classic, Mongoose, T5. I could do GURPS and T20 as I do have those rule sets, but I'm not very conversant in them.

And today is World Cat Day!

Monday, October 09, 2017

Traveller Tracker - desiging the actual ship info screen

This is the view that is the actual ship tracker: from here you can buy / sell cargos, look for passengers, refuel and plot your next location.

As I currently see it, the top part is the basic ship info: name, class info, current date and location.  The current location is a clickable link to give you a world info view.  Buttons are Searching for Cargo which will add 7 days to your current date and give you a list of the available cargos and passengers (and I may need to see if we want to make this version specific). Refuel takes no time but will cost you based on your tonnage and type of fuel, and subtract from your current credits.

Below this is a pivot table - UWP's version of a tab.  So far I see 5 tabs:
  1. Log - display the ships log
  2. Cargo manifest - shows what you have on board, and allows you to sell the items.  It should also have a print manifest option.
  3. Jump Map - use TravellerMap to visually show your jump map based on your current location and jump drive
  4. Jump list - a list of worlds within your jump range with some info.  Clicking a world will show world details as above.
  5. Ship Info is a catch all for things I've not thought of: when the ship was built, crew listing, things we may have to add. Maybe add a notes section.
I may add additional things like world notes - allow you to add notes for the world.

No development today - just design stuff and thinking about it.




Sunday, October 08, 2017

Traveller Tracker - cosmetic updates, some under the hood updates

I've added the credits available to the editor, did a bit of bolding for the labels, and aligned things a bit more.

I've also expanded out the ship listing to give the ship class info, and may end up adding the current world and date.

I need to design the actual ship tracking view, which will give a different set of options such as setting the jump (find the list of worlds within jump range - I can either redo the math I had earlier or use the TravellerMap API. May be both - 1 to show an jump map, the other to list the systems); cargo handling (buy, sell) and whatnot.



Traveller Tracker - caching the data

Finally got the caching to work.  So, when you select a sector, if you've not used it before, we create a new sector record in the Sector table, then load all the worlds for that sector into the World table (linked by the sector ID).  This is done asynchronously as we've a fast in-memory list of the worlds we use for the display.

If you've already picked that sector before, and we have worlds in it, we load the world data from the local DB.

And I finally got the code for getting the selected items in the combo boxes to work without having to iterate through them all.

               if (App.tmUniverse.Sectors != null)
                {
                    comboSectors.ItemsSource = App.tmUniverse.Sectors.OrderBy(x => x.FirstName);
                    comboSectors.SelectedItem = App.tmUniverse.Sectors.Where(x => x.FirstName == sector.Name).First();
                }
                if (App.tmWorlds != null)
                {
                    comboWorlds.ItemsSource = App.tmWorlds.OrderBy(x => x.Name);
                    comboWorlds.SelectedItem = App.tmWorlds.Where(x => x.WorldID == ship.WorldID).First();
                }


Saturday, October 07, 2017

Traveller Tracker - reset all the migrations

I finally ended up in a hole with the migrations - as we can't delete columns currently in the code first DB migrations, I had a few things out there that should be in the classes (i.e. ship tonnage is based on the class, so no need to have it in the ship details). And it was getting mixed up about foreign keys getting added after the fact.

A lot of poking around and I finally found the solution.  And it turns out to be simpler than I hoped.

The entire code first migration stuff basically tracks your changes to the DB and creates a SQL script to do the column adds, table creates and all that.  But the SQLite version of Entity Framework still has a lot of issues as previously mentioned.

So the easiest thing to do, after more than an hour of poking around, is to simply delete the database, all the migrations, and then just add a new migration to get the DB to where the schema currently is.

So in the main app where normally we process the migrations, we can do:  db.Database.EnsureDeleted() and stop processing. This deletes the database.

Then, do the add-migration in the console, and voila, you now have 1 big migration at the current state of your schema.

So, when (and there is a when!) this goes to the App store, I'll do this process to have a single migration rather than a series of migrations.  Once it does get published then it is migrations all the way...

So I also took this time to add the Sector and World tables: what will happen is that I'll have this sector & milieu stored in the local DB when you access this. So once I've downloaded the TravellerMap info I also store it in the DB, and when changing sectors or worlds we see if it is there first. This will allow for off-line for some things at least. So the ship class now has a SectorID and a WorldID, although really, just  WorldID would really be enough as the World itself has a sector ID...hmm.

I also need to add to my list of options the ability to clear the Sector and World data in case you want to reload that from TravellerMap.

Thursday, October 05, 2017

Traveller Tracker - Select a World

I've had a bit of a time getting back to this - now that school has started my son Bryson has taken over my computer most of the time.

I did manage a bit of time this evening, and the user can now select a world for their ship to be at, based on the sector and era.  I've got the basic plumbing in place now for the actual tracker. The edit screen allows you to directly change a bunch of things. The tracker will be based on your location and jump for where you can go.

Still need to add in the ship cash and a few more things, but slow progress is better than no progress!


Saturday, September 16, 2017

Traveller Tracker - logging a bit better!

I've updated the ship log to allow for text wrapping and line feeds.  I've also got it so that the era (i.e., 1105) and the sector show up appropriately in the combo boxes. It is still doing something odd behind the scenes I need to figure out - it makes a call 3 times that, while not actually doing anything should still not be called.

But some progress!  I hope to get to the system API this weekend as well, so then we can pick a system. And once we have that, we can leverage the other TravellerMap APIs to get our jump maps.

Then I still have to do the whole cargo thing.


Friday, September 15, 2017

Deckplans

I am a sucker for deck plans.  I must have hundreds stashed away on my Traveller drives.  I even bought a large format printer (goes to 13x19) to print them out.  I have printed a few of them, and we've used them a bit in gaming.  I've also bought the GURPS CD #2 and it had cardboard heroes, so I bought some card stock, a cutting board and printed a sheet up. Not liking the folding aspect, I also bought some game stands that the pieces can fit into. These are 25mm scale images, although I suppose I could reduce the size and make them 15 mm scale for the plans I print out.  I do like a physical layout when we have battles just so we know where people are at.

But my favorite deck plans, of which I've managed to actually use at least 2 times in my sadly finished game, are poster-sized deck plans. I've been addicted to Kickstarter for far too long, but Ryan Wolfe is one of my automatically join campaigns.  Not only does he do the poster (2 sided with a variant if it is single sided) but also a mini as well as a well designed PDF that goers over the ship.  While the stats are somewhat generic, I can make up the Traveller stats as needed.

His latest is sort of an oddball ship which is the start of an alien series of designs.


Saturday, September 09, 2017

Traveller Tracker - Ship Classes with High Guard types

As it says on the tin - I've added a couple of text files that list the ship types from High Guard. Long term perhaps stick them into the DB for editing but for draft 1, the classic list works for me.

I also keep forgetting that I cannot delete columns in the DB, so there is a bit of duplicate data sadly.  I am hoping that eventually the SqlLite EF adds more DB handling.


Thursday, September 07, 2017

Traveller Tracker - Location

As a test I've set the API to pull the 1105 data, and that works.  Currently the API is called at the start of the program so I'll default to 1105 / OTU.  But I will add the era listing for the ship and allow you to reload the sectors for that era.  Not sure how that works later on when picking a system and all that, but I'll cross that bridge when I get there.


Monday, September 04, 2017

Traveller Tracker - Logs and Location

Got a little time over the Labor Day weekend to work on this. I've got basic ship log in place, and I've added the TravellerMap API to get a list of the sectors. It is a big list - I may have to add the Milieu to the ship data to restrict the list to a specific version (note the multiple copies below!)

So I'll add the Milieu to the ship data, restrict that API.  Then I need to track the sector & system within the sector.  I was planning on just text fields and hope that is enough - the TravellerMap APIs will work with that data so I should be good there.

Then I need to create the cargo generator as well as having it user friendly so users can enter their own cargos.

And the UI really needs help....

But I am making slow progress, but having the web API in there is nice.  Although I am running out of the year as I was hoping to get this out before the end of the year.  However - real life keeps getting in the way of actually playing sometimes.




Saturday, August 12, 2017

Traveller Tracker - adding ship logs

I've added the cargo table definition and the log definition.  Had to also add them to the TravellerContext to get added to the database. That took a bit of digging since it has been a few months since I looked at this sadly.

Anyway, I added an initial dialog box to get a new log entry in. It needs work, and I do believe I am going to abstract that a bit more to have a single class to handle the dialogs to centralize things a bit and minimize repeating code.  I know, a class for a class, so I need to think a bit more on it.

Getting my head wrapped back around C# after more than a year of Filemaker is interesting...

TravellerContext:
using Microsoft.EntityFrameworkCore;
using Traveller.Models;

namespace TravellerTracker.Models
{
    public class TravellerContext : DbContext
    {
        public DbSet Ships { get; set; }
        public DbSet ShipClasses { get; set; }
        public DbSet Cargoes { get; set; }
        public DbSet Logs { get; set; }

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            try
            {
                optionsBuilder.UseSqlite("Data Source=TravellerTracker.db");
            }
            catch (System.Exception ex)
            {
                var a = ex;
                throw;
            }
        }
    }
}





Thursday, August 10, 2017

Traveller Tracker - Ship Classes

So I managed to get a bit more done, and not only can we save off a ship class, we can now add it to a ship.  The UI still needs a LOT of work, but the ideas are there. So the basic ship stuff is there. Still to go is add the ship date and a model to handle the Imperial calendar, the ship log, location and all that.

I am thinking of adding the High Guard ship classes at least as a display or something when creating a ship class, so that you can put in the values from classic Traveller if you want.  I may expand out the ship class to actually include that info. Currently the name was for that, but I think we may need the Imperial Naval Coding System prefix codes.  So that the A1 class I have can be the Billy Bob class of jump 1 traders (low cost and hitting the low pop worlds mostly).


Sunday, August 06, 2017

Traveller Tracker

Well, with my Traveller game finished, I'll try and spend a bit of time on the Traveller Tracker software.  I've got the basic ship entry in place, and now I'm working on the ship class part.  Coming from a DB background, it is all about the various parts and how they fit together.

Hopefully today I'll finish the class entry part. The class determines the ship's basic tonnage, jump, maneuver and power profile, cargo and fuel tonnage.  So in theory, once I figure things out, you could get a list of all ships based on a class.  In reality, the way I used this in the past was only really for 1 ship, but who knows - perhaps some players or GMs have a complete fleet.

So it is a bit slow getting back into this after a few months off: needing to add a new data migration (apparently I added the cargo tonnage later so it is not in the DB yet).

So now we have the basic ship class editor (after the DB migration et al). I need to add that list to th ship editor so that we can choose a class for our ships.

After that, I need to start the ship location side of things. I'll probably use the TravellerMap API for large chunks.  Hopefully I will meet my goal of getting this into the Windows App store by the end of the year for the 4 or 5 people that will use it..

As a side note, the source code is on GitHub, so anyone wanting to try the WIP can in theory download it all and using the free Visual Studio, run it locally.  It is not exactly trivial but nor is it overly complicated (well, speaking as someone who has been coding for far too long...)


Monday, July 24, 2017

Happy Birthday Traveller

A day past the 40th anniversary we played the last round in my current game. The good doctor Boris is doing a larger loop around the Trojan Reach before returning (possibly) to Glisten, and our young Scout, accompanied by Li as his engineer, is returning to Cyan to get his ship fixed as well as report on what happened.

I pretty much soft pedaled the adventure - originally I was thinking the Katydid would not be able to even launch, thus fixing the issue with 2 players and having 2 ships. However, as things worked out with real life, the plan changed a bit.

The Katydid was downed by an EMP, creating an impact crater on Selshor. The planet having a very thin atmosphere meant that the ship was almost safe from the local TL 6 governments. Between the high altitude requiring extensive equipment to live, and an almost impervious crystaliron hull, the ship, while scuffed and marked with repeated attempts to enter, was still safe and sound.

The first trip was a scouting trip to see how bad things were.  Using a probe to create ECM, the ship's pinnace landed nearby and Travis, Francine and Ferdinando got into the ship. They had a few minutes before the local government forces arrived from their base camp a couple of kilometers away.  They managed to get the ships logs and do a quick engineering survey and found that the ship was damaged but that they could probably repair it.

Another day in orbit, and Travis, Ferdinando and Boris return to the ship. They get enough fuel to get the Katydid to orbit, and start on the repairs. The local goons show up, waving submachine guns, but they are unable to get in or do any damage to the ship. Additionally, the local forces only have a couple of hours of air before having to return to the base camp.

It takes another full day to repair the Katydid enough to get her into orbit, along with the daily display of impotent machismo from the local government. Finally everything is as ready as they can make it. Travis starts up the engines, and they sputter. Assuming a fusion plant can  sputter....In the meantime, Le Suroit mentions that another crawler has just reached the plateau, hauling what appears to be a howitzer of some sort. As the terrain is unforgiving, and the crawlers are slow, they do have some time. Which they needed - it was the third attempt that finally got the Katydid launched, and moments later they matched high orbits with Le Suroit.

A few days of additional repairs, and the two ships parted ways, and we pretty much finished the mini campaign.

Monday, July 17, 2017

Last Traveller Sunday

The upcoming Traveller Sunday may be the last - one of my players is dropping out.  Hopefully due to other things in real life versus just not enjoying the game.  Sometimes it is hard to tell.

The Selshor system is a red zone system. The primary reason, outside of being outside the Imperium, is the rabidly xenophobic residents. Yes, another xenophobic planet, but at least this one is not a dictatorship - it is a balkanized world (well, one of the governments could be a dictatorship).

It is a small planet with deep crevasses where the population lives in one of 3 major or a few of the smaller valleys where the air is merely thin versus very thin. Most of the planet is high plateaus, which is where the Katydid, Travis' Scout ship, crashed down.  The reasons are not yet known as to why the ship crashed, and the Scout that managed to escape, one of the scientists aboard Le Suroit, has only hazy recollections other than an almost dire fear of the planet itself.

During the week in jump, between research on Girly Girl the Lord Fish and trying to study up on astrogation, the Travellers learn what they can about Selshor.  Beyond the physical information on the system (11 planets and a planetoid belt, 3 gas giants) not much is known about the actual population. The last ISS survey as 11 years ago and apparently they did not get too close to the population at the time. It is estimated that there are about 800-900,000 people, all human, split into 3 major population centers in 3 different canyons that support human life.  The planet is a desert planet with no surface water, although there must be underground water for the nearly 1 million residents.


Wednesday, July 12, 2017

Traveller Sunday

We sped through a couple of planets: Candia was a desert planet ruled by yet another dictator. Le Suroit stopped by the gas giant, made a few wilderness runs with Travis learning to fly the pinnace, the regular maintenance by the engineers, a very successful research roll, then on to the next system. T'yana is a rich garden world.  Travis and Li restocked with fresh produce as well as frozen and packaged supplies while the pinnace made a few trips reloading fuel and cargo.  There was yet another very successful research roll, so Dr. Boris is making headway on the Lord Fish issue.

This is where they left off: our next session we'll see how well Travis does on his astrogation, how well the doctor and scientist manage to continue their research on Girly Girl (the name of the Lord Fish, who is in a huge tank in the main lab).

Selshor is where the Katydid crashed more than 6 months ago, getting on to a year now.  Selshor is outside the Imperium, so while the physical status are well known, the politics and society are not as well known.  Dr. Francine Occa, who was a crew member of the Katydid and managed to escape, only knows that the population is even more xenophobic than Cyan's ruling class, and that the ship crashed on a high plateau with extremely thin air. Her rescue was quite fortunate - Selshor does not get many passing ships.  She recommends extreme caution in their approach.