Friday 15 August 2014

Crucible XXVI 15/08/2014

Oh yeah, I can totally keep doing roman numerals in my post titles (those of you not reading on my blog won't see this). So I am back from my THIRD holiday this year. It was great, thanks. I have indeed done some work on the game this week. After working for so long on the headache that is the voronoi generator, I decided to work on something a bit different- improvements. My goal was really just to re-write the code that is responsible for calculating the modifiers that are created by the improvements. This was in order to both make the code faster, and also to give me greater control over how the improvements work. Systems now have their own modifiers (with names such as systemPowerModifier or systemGrowthModifier), whilst the planets in the system also have a modifier (with equally imaginative names like planetPowerModifer, and planetGrowthModifer). I made a couple of little diagrams to help explain what the modifiers are and how the are calculated.

This diagram explains the difference between improvements with system wide effects and those with planet-wide effects.

This diagram explains how the modifiers are calculated for each planet.

The modifiers are nothing arcane, they are simply a value that is multiplied to the base resource production value. For example the Power modifier is multiplied with the base Power output of a planet (say 4 Power with a modifier of 2) to produce a final Power output of 8. There are modifiers for almost every kind of resource in the game- Power, Knowledge, Wealth, Maximum Population, Population Growth, Improvement Slots, Amber production etc.

I had a major issue with github which resulted in started a new repository for my code. The result of this is that the current code version number is now 1.4. For some strange reason I did return to the voronoi code, and with fresh eyes, I think I have made some improvements. It does occasionally break still, but the frequency of this appears to have decreased.

That's it for this week, see you next time! 

No comments:

Post a Comment