Inventory System Improvements


This week I spent some time improving the inventory system with some utility functions for adding/removing items from your expeditions' and towns' cargo.  Originally I had scaffolded it out as simply a C# list, so I've added some methods like AddCargo and RemoveCargo to properly update the inventory quantities (and remove the item from the list if it's at 0 or less).

The 'water rations' and 'food rations' reported on the unit panel for your expeditions used to be getters and setters, but I've now updated them to be only a getter so the number is aggregated on the fly from the cargo in your inventory.  If it's marked as a food ration, then the quantity is added to the total, if it's marked water, then it's added to the water total.  Every turn the expedition unit will 'forage' in the current square for rations and the items foraged are added to the existing item entries in the cargo list, so the water and food rations will automatically show this updated total.

I also updated the Market view inside the settlement dialog to show the list of items in the expedition's cargo (along with the expedition name shown in the drop-down list).  This will allow us later on to select which expedition or vessel in the settlement you want to trade with or transfer cargo to.

Now that the inventory system is in place, I can start to work on actually transferring goods between your units and your settlements.  Trade with Europe is coming! :)

The next feature I'll be adding though is the ability to build improvements outside of the settlement.  The model I'm going to follow will be to create an expedition with a persona attached to it who is skilled in the profession you wish to build for and then send expedition out to that location to build it.  The expedition will be consumed in the process and its cargo and people added to the building itself.  The workers in the building will produce materials every turn and auto-send an expedition to the settlement to deliver their product.  This means your produce can be intercepted however. ;)

That feature will also depend on this concept of a 'persona' that I need to develop a little farther.  I think it will eventually be a procedurally generated person with a profession and some related skill stats that you can assign to expeditions to give them special abilities (IE: If you attach a prospector persona you can search for minerals in the current square).  I'll make a basic framework for that system in the next update but it will be fleshed out further later on).

Thanks for interest, please let me know if you have any questions or suggestions!

Get Frontier: New Worlds

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.