CleverRaven / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
10.25k stars 4.11k forks source link

Terrain and furniture upgrades #75708

Open NetSysFire opened 4 weeks ago

NetSysFire commented 4 weeks ago

Is your feature request related to a problem? Please describe.

Monsters can upgrade and grow into other things based on ingame elapsed time or the monsters own lifetime. Terrain and furniture are lacking that ability. This has 2-3 main usecases:

  1. Making plants mutate just like monsters do. E.g entire abandoned corn fields growing into something sinister.
  2. Plants growing and maturing, e.g young trees mature into grown trees given enough time.
  3. Making e.g roads (well, their asphalt terrain) deteriorate over time.

Solution you would like.

I think it would be feasible to have the same approach, in terms of syntax, as monsters upgrading.

"upgrades": { "half_life": 30, "into_group": "t_region_groundcover_forest_upgrade" },

Terrain/furniture groups are a bit weird as of writing, that might be a good motivation to get those properly fixed up, too.

The big fun will probably be optimization since we have much more potentially upgradable terrain/furniture than spawned monsters.

Describe alternatives you have considered.

No response

Additional context

No response

PatrikLundell commented 4 weeks ago

I'm not too keen on this for a number of reasons:

If you badly want to affect "stuff" I would suggest first paving the ground for it by splitting "terrain" into actual terrain and "stuff that's on the terrain". That would allow you to remove some current "terrain" and reveal the actual terrain that should be underneath (such as water under a dock, dirt under the land part, rock in a cave, and air "under" an elevated bridge part). It would also drastically reduce the number of "things" you'd have to process, since most of the map isn't populated by vegetation or artificial constructions (possibly a flag on each submap akin to the current uniform one, so each submap that doesn't have "construction" (or whatever you'd call the new layer) could be bypassed with a single check).

Karol1223 commented 3 weeks ago

For plants at least I think it'd be much more ideal if we could handle growth stages as well as the 'production' of that plant (so fruit, grain, whatever it is from that specific plant) via means that don't change IDs in the first place. We already have two terrain versions for all fruit trees, shrubs, etc. Adding young versions of trees on top of that would be really annoying.

RedMisao commented 3 weeks ago

One way to reduce the impact on performance could be to limit checking the internal timers every season change only, at least for trees and other slow growing stuff

PatrikLundell commented 3 weeks ago

You can't reduce checks to once per season:

I guess it might be possible to tag every submap with info on when it was last processed for this purpose, and thus only perform that check rather than a full processing, but, again, it severely restricts how you can use it.