[quote=“ClockworkZombie, post:14, topic:4966”]1) AFAIK There’s not really a system in place for ensuring one per city or per area; it’s more like “the city is this big, place random things within”. If you could implement something like that as part of this project, that would probably also help with more logical city generation down the line.[/quote] I would have to read through most if not all of the map generation code, it might require a rewrite.
[quote=“ClockworkZombie, post:14, topic:4966”]2) As has been mentioned, the game engine only really accounts for/simulates things that happen within a “reality bubble” of a few dozen tiles around the character. For example, if you do something like light a bush on fire a few blocks away from your base and then walk away, the the thing will still be burning every time you come back, even days or weeks later. The turn counter only ticks when you’re close to the object. This is also why random things don’t generally spawn in areas you’ve run through but aren’t usually in. Again, this system could be improved drastically. This causes problems with the “plant stays on for X days” proposal.[/quote] What needs to be done is record the last time it was ‘active’ and use that to calculate if something that was suppose to happened, already happened, and apply that if and when the character comes into range.
This works even for a power plant, since if they come across a house, and we check the power we see the plant went off at time X, which was 2 years previous, so all the refrigerators went off 2 years ago as well. So all the food is spoiled.
I see there may be a bit more work involved then I though. I would like to get that sorted out first. I notice there is a mapgen json, would it be possible to move all the current entries to there? If so I could spend some time doing that first, then we could review the map generation code to see if we can support static buildings.
3 dimensional generation of this type is rather simple, that is if I was writing it myself, it would be. But there might be some blocks (assumptions) in the code that may prevent it being easily implemented. Basically when we generate a building with multiple floors, we generate the ground floor, then generate the basement a Z level down, and any higher stories a +Z levels up.
There isn’t really a major issue with simulating other Z levels while on another Z level. That is in this kind of game you don’t really need to. All you need is some kind of event system, so mobs will occasionally wonder up/down the stairs. Mark the ground level as damaged, and when they revisit it, cause some damage where monsters broke through the barricades. Perhaps add a few corpses in the traps in a path to the stairs. But this could be annoying if they somehow completely walled in the lower stairs. I would say after X levels, there should be no events at all, say if you are on the 30th floor of a (cleared) office building, it is unlikely a monster wondered all the way up there.
I had an idea for a substation as mentioned in the OP, it could be placed near the center of the city to power it all with just one station (since the station near the middle will likely be the nearest plant to all the buildings in the city.)