In The End: Resources

Sometimes, its the little things that trip you up. As it was with the script for Resources. One script for each of the three resource producing objects, and a central script to store, update and provide information on all four resource types. Who’d of thought that a negative minus a negative does the same as a negative plus a positive?

So originally, I had the code check the provided Integer (Which was sent by various other scripts, anything that increased or decreased the resources to be exact) to see if it was positive or negative. If it was positive, it would be added to the total, and the opposite it was negative. Yep. It would be subtracted if it was negative. Soon as I tested that small piece, I noticed what I’d done and fixed it quick as I could. Turns out I only needed to add the provided number, whether it be positive or negative. Not my smartest moment, but at least it only caused an issue the once.

Food

Food is generated after a set amount of time once the player has selected the “Grow Crops” button, starting an animation that lasts until the crops have grown. The code then calculates how much Food the player should recieve, based on their upgrades, and sends that value to the ResourceStorage script. As the crop grows via script, the player may close the Food Terminal interface and do other things whilst the crop grows, and return later to find the crop either growing or ready for harvest. Players can also sell crops for Cash rather than gaining Food.

Narrative

The crops grown are known as “Omni-crops”, and as their sprite shows they are infact multiple fruits, vegetables and other crops all upon the same single plant. When players sell the Crops, they are paid by the people behind the City Beyond the Stars program, who use the food to cater for passengers upon the colonial vessels.

Power

Power is consantly generated, but is the slowest to generate out of all the resources. This is becuase the Solar Field is the furthest location from the City Dome (The game’s central location). There are two timers that generate Power, one for Solar Panels and one for a Nuclear Reactor. The Reactor takes twice as long as the Solar Panels, but produces at least twice as much (It generates far more per upgrade than the Solar Panels as well). The time it takes for the resources to be produced is unupgradable, as to somewhat control the pacing of the game. However, the maximium that can be collected at once can be upgraded, making trips frequent in the early game but allowing players to focus more on city building in the late game. Power can also be sold for Cash much like Food, but once again this is a choice that must be made whilst collecting the resource and it sacrifices the resources itself to do so. The main reason for this (As it was not part of the original GDD) was to give players an alternate means of generating Cash, as not restrict it to Food which would make it troublesome should the player require both resources. the reason for a Nuclear Reactor is tied to the original plans for an Atompunk aesthetic, an art movement based on a future made with nuclear power.

Narrative

Named “Solar Fields” due to the flower-like design of the solar panels, these swathes of land produe all the power needed a colony could need. All the excess is stored within on-site batteries, which Overseers may choose to send back to the City for expansion or provide to the City Beyond the Stars program and shipped away in power cells for use on starships, satellites and other spacebound machines. Overseers will see compensation for their donations, to be used for continued growth of their colony.

Water

Water has a cooldown once generated (Prompting players to leave and attend to other Domes rather than sit and produce Water), and requires a single unit of Power to do so (Once again, prompting players to travel between the domes frequently). The cooldown, much like the speed that Power is generated at, can never be changed, but the amount produced can be.

Narrative

Many planets harbour water in some form, whether it be Ice or Vapour. The Water Dome holds machines that can turn both into its liquid form. All it needs is for the Overseer to permit the use of Power to filter the water, and their colony will find no end to their water supply. Due to the availabilty of ice in space, and the capabiltiy to mine it mid-journey, the City Beyond the Stars program does not require donations of water, and all excess should be used for features and other such landmarks.

Leave a comment