Pre-Order the Game!

Desura Digital Distribution

Saturday, November 10, 2012

Resources and how they're handled

First, let me tell you that it've been a major pain in the neck setting up economy in my game.  The biggest reason for this is that I decided to have resources themselves be moddable.  So I have to design the data structure around that.  But I think I've stumbled onto an accidental but cool feature.

As you know, I'm implementing "Delayed Consumption" (not sure what it's called) where one turn you produce resources to be consumed the next turn.  So for example, if you produce research points on this turn, it won't actually be used until next turn.  It's possible to create a very complicated supply/manufacturing chain, but for my game, it'll be simple.

While implementing this concept, the problem is how do I store the resources?  Do I store them empire-wide?  But what if some people want to limit certain resources to be planet-only in that it never leaves a planet?  An example would be industry points in MoO 1 (they only go into producing ships and stargates), and is not passed to other planets.  So I added a property to each resource that you can specify to be planet only, system only, or empire wide.  Planet is what I just described.  System is a resource that's limited to a star system and not other systems (in my game it would be ship production since ship production will be system-wide).  Empire is able to be shared anywhere, and can be traded with other empires.

After implementing this, I realized a very interesting side effect.  The game calculates the amount of resources based on EACH planet's resources.  Each time the game updates the amount of resources you have, it clears every system's resources and empire's resource, then goes to each planet and adds up resources.  So if a planet have 10 BC (empire), and 5 industry (planet), the 10 BC is added to the empire's resource, but is not deducted from the planet.  Empire's resources is just a cache of the total of all planets' resources.

You may be thinking, "So what?  It don't matter to me because it's the same to the player in the end, it displays the total resources for the empire.  How is that different from other 4X games?".  And to that, I ask, "What happens if you lose a planet?"

Yes, that's right, if you happen to lose a planet, you lose all the resources on that planet.  Or if it was captured, the resources could be captured as well!  This will make ground invasions MUCH more desirable and not just capturing planets for buildings and technologies, but for their resources as well!

Let's say that you have a very rich planet that has 1,000 BC, which is half of your empire's total BC, and it was captured by an enemy.  This can be a deciding factor in the outcome of your war (half of your money gone into the enemy's hands).  So with this system, you'll not just determine which planets to defend based on their buildings and population count, but as well as their amount of resources!


  1. Nice, now it would be possible to make Stareater mod for Beyond Beyaan :D

  2. Do that mean you'll help me work on the game? I'll help you convert your game into a mod for this game in return! :D