Monday, April 4, 2011

Ownership and Companies

It was quite a successful weekend as far as Stellar Fortune goes.  I implemented ship buying, which required me to rethink a bunch of code.  More on that later this week.  The task currently on my mind is, who owns a Factory?

Factories are already present in Stellar Fortune.  Just one at the moment though.  They check an associated warehouse periodically and if the raw materials are present, it will use them to produce a good.  When I added the one currently in game, I cheated a bit and made the owner of it be the station.

This works, but is not really what I want. I'd much prefer some other entity own the factory (player, npc etc).  The result will be the first Company implementation.  To start, only NPC's will be able to own a company.  Eventually a player will be able to as well.

The first implementation will be rather simple.  A Company has funds and can own a factory (or multiple).  The AI routines will be responsible for Raw Material (Iron) Buy Orders and Finished Good (Machinery) Sell Orders.  That's pretty much it at this point.  I have grander plans for them, but you have to walk before you can run.

The result should be a more dynamic game world due to price fluctuations as companies compete over goods.  Making sure it is not too volatile will be another challenge.