Here's an update on the resource system:
As you may know, I've added resources in a XML file, so players can create their own resources, whether or not it's preservable (food can't be stored since they only last a year for example, so excess are converted into some money). Also regions are defined in XML file, so players can create different regions, what restrictions they have (for example, Radioactive Mining regions are restricted to only the planets that have Radioactives special), and what resources they consume or produce.
While this may seem a simple system, I realized that the math behind this is very complicated. Each planet can have different regions, and different races. Planet specials and race bonuses may affect the output/consumption. The more you produce something from a planet, the more that region need to consume. Resources are interchangeable between planets, so if one planet is a mining powerhouse, it can supply other planets with ores/minerals.
The problem is now this: How do the game know how much you're producing, and how much you're consuming? Let's say that there's three regions defined:
Mining - Produces Raw Minerals
Refining - Produces Alloys, Consumes Raw Minerals
Industry - Produces "Production", Consumes Alloys
To correctly calculate the output and consumption in the same turn, it must loop through every planet, checking its output and consumption. So first loop will discover that Mining produces Raw Minerals, but since there's no raw minerals beforehand, Refining wouldn't be producing anything, and same for Industry. Then on second loop, it will say "we now have Raw Minerals, which regions use it?" and go through the same process again. Now Refining produces Alloys. Third loop will finally determine that Industry can produce Production.
Now, what happens if the player changes slider so that the mining no longer produces Raw Minerals? It'd have to go through the loops again. Due to the regions/resources being able to be defined by the player, it could become a complicated economy system with 5 or so iterations before the goods are usable by projects. Some region may consume two or more resources (for example, bioorganic factory consumes Ores and Food), some region may produce two or more resources (Radioactive Mining will produce radioactives and ores). Not to consider racial/regional/planet bonuses that affects the whole thing as well. How many loops do the game need to perform? How do it know when to stop?
So the system that worked in MoO 2/3 can't work here because in MoO 2/3, the resources are pre-defined (MoO 2 has command points for ships, and BC, MoO 3 has only Mining and Industry, a simple system). So I'm proposing a different system that will make things easier under the hood, and makes things interesting for the player: Turn-Based Processing.
What is Turn-Based Processing? Let's use the above example of Mining, Refining, and Industry. First turn, you don't have any Raw Minerals, nor Alloys. So Refining and Industry won't be producing anything. However, Mining will produce 10 Raw Minerals this turn. You then hit end turn, and proceed to second turn. Now you have 10 Raw Minerals, and the game tells the regions that "we have 10 Raw Minerals, tell me what you're making". It will report that the Refining can produce 10 Alloys, and consumes 10 Raw Minerals, and Mining will produce 10 Raw Minerals. You hit end turn, the game consumes all the resources by regions, then produces the goods from regions. You're now on third turn. You now have 10 Raw Minerals (from mining last turn), and 10 Alloys. The Industry region now finally can produce "Production" because you now have Alloys.
One interesting side effect from this is that if your mining planet was attacked and destroyed, you won't feel the effects until a few turns later due to the chain of production.
If the resources are not preservable, they last only one turn, long enough to be consumed. They usually have another resource that they change into (for example, each unit of food left over will be converted to half a BC) on end of second turn.