Ooh, I like the percentage recycling value changing as difficulty changes! It'll punish players for choosing a high difficulty, but still allow non-diehards to faff about with colony design.
It's a fairly simple setup but would then lead to other questions such as if requirements weren't met, only then do buildings begin to deteriorate or do they just go disabled as I currently have it?
If I understand, it'd kinda look like something like this:
- A structure's status starting at about a 100.
- Every turn resources are gathered; that's the 1 common metal for the warehouse (which I imagine is the light bulb)
- If those resources are not available, the status decreases a bit; for the warehouse, let's say 1 point. For the tokamak, let's say 25 points.
- If this value hits/surpasses zero, then the structure enters its 'defective' state
The 'defective state' should differ per structure, as you already said; a warehouse might be deactivated meaning the stuff inside couldn't be accessed anymore (i.e.: the door is stuck), while
the tokamak explodes violently. Storage tanks might leak a bit, while the underground rec' facility starts making people unhappy because the pee in the pool isn't filtered out properly. Maybe the energy costs could also increase as the structure loses points?
Keeping the number of points lost per turn as a constant per building should be sufficient, especially if you factor in the amount of resources available; if a building deteriorates by 10, requires 2 common metals, and only 1 common metal is available, it'd deteriorate by 5. This should introduce enough variation.
should have a minimal cost (5 common metal, 1 common mineral, 1 rare metal).
Have you done some initial balancing for the materials, or do you have some kind of reference point?
I'm also thinking that recycling costs shouldn't be arbitrary but say 90% (possibly variable based on difficulty?) of the original cost of the structure (which means in practice since we're working with Int's and not Float's you're getting back 4 common metals for every tube you demolish).
When applying percentage discounts (due to research or whatever) using ints has the risk of getting stuck; a 25% discount will never get 2 to 1, even if it's applied ten times. I don't think memory is an issue here; the game won't (shouldn't?) have millions of values in memory at the same time anyway. Alternatively, an int goes from -32k to 32k, while that isn't always required; if a value from 0 to 100 is required, then the range of the int can be moved to the range required, which allows for accuracy while not increasing the memory footprint. I've seen it being done with single-byte variables that needed to go from 0 to 100, where every step was, according to the comments in the script, "a bit less than half or something".