Author Topic: Bushes (and possibly trees) spread?  (Read 449 times)

Offline Squaggly Maggleton

  • Zombie Food
  • *
  • Posts: 39
    • View Profile
Bushes (and possibly trees) spread?
« on: September 28, 2017, 11:04:58 AM »
Apart from the zombies, the world of cata doesn't seem to age much. Maybe make it so that after an amount of seasons, grass tiles next to a bush have a percentage chance of spawning a bush? If implemented, this could make the passage of time seem much more tangible, with the wilderness encroaching on previously "tame" land, as well as make roads way more valuable endgame once you have a multi ton vehicle with rams (I can currently handle 80mph offroad for hours with only yellow damage to 2-4 out of 7 front rams).

If this furniture aging (? I think bushes and trees are furniture, might be wrong) system was implemented, it could also facilitate tree spreading. After an amount of years, bushes that are next to tree tiles could get a percentage chance to turn into young trees, which would then grow up and continue the cycle.

We currently have grass and dirt tiles. We could instead make grass a furniture (low durability and can be hit by wheels, if you run over grass a couple of times IRL it dies) that spreads as described above to dirt tiles to further facilitate the feel of wilderness retaking the land.

I have done my best to try to figure out a way to prevent any of this from happening too quickly. The way I see it working can be outlined like this:

check is made monthly, so percentages that seem too low here might actually be too high
dirt to grass: takes 2? weeks for a 25% chance in the spring-summer, only next to grass tiles
grass to bush: takes 5? months for a 6.25& chance in the spring-summer, only next to bush tiles (maybe a 1.5% or so chance on non-adjacent tiles?)
bush to young tree: takes 1.5? years for a 6.25% chance in the spring-summer, only next to tree tiles(separate types of tree have different times/chances/seasons?)
young tree to mature tree: takes 2-4? years for a 12.5% chance in the spring-summer (low chance because close mature trees steal nutrients and light from saplings, hindering their growth) (might already happen, I haven't watched a single tile for years to check)

If you want to take it further, you could possibly track when a 2x2 of trees is formed (by checking if a single tree tile has 2 trees around it, then checking if those trees also have two trees around them, then by checking if those tiles overlap with the previous checked tiles, ensuring it is a 2x2 and not a 1x4 or something), and give it a  tiny percentage chance per year to turn into a giant tree, with stats WAY too high to ever be knocked over with a vehicle, even a super heavy one with rams. The tree could go up a Z level and provide an insane amount of wood if chopped down, or a starting point for an elf-style treehouse. (This one is purely the logical extreme to show what the implementation could lead to, creative direction notwithstanding)

Offline Umbra Vorago

  • Zombie Food
  • *
  • Posts: 79
    • View Profile
Re: Bushes (and possibly trees) spread?
« Reply #1 on: September 28, 2017, 11:21:15 AM »
Whilst I jump for joy at the thought of trees, bushes and other plant life spreading over time, there's a small problem.
I might be wrong, but I think the game trying to calculate all that would be way, way, WAY too much, it wouldn't be able to handle it.

If I'm right and the game couldn't handle all those calculations, I'd at least want 'some' way to make trees and such spread/grow.
Something that was mentioned a small while ago, was the idea of having a special kind of fertiliser you can find in laboratories, or you can craft with a high cooking skill.
This fertiliser would induce rapid growth of plant life. Use it on the ground, grass would grow. Use it on a bush, more bushes would spawn. Use it on a young tree, it would turn in to an adult tree. Use it on an adult tree, it would spawn young trees around it.

There was also the idea that you could plant trees/bushes/grass using the farming system, with grass growing quickly but trees take a LONG time.

Offline Squaggly Maggleton

  • Zombie Food
  • *
  • Posts: 39
    • View Profile
Re: Bushes (and possibly trees) spread?
« Reply #2 on: September 28, 2017, 11:58:37 AM »
Maybe make it so that this growth system only takes place in the reality bubble and tiles entering the bubble that have been explored before? For unexplored areas the game could have tiers of worldgen based on world age, where it will gen a field as it currently does on day 1, but day 600 it'll gen something more akin to a forest (numbers are made up, they just need to match the time it'll take for the reality bubble tiles to get there and scale with month length). This shouldn't be nearly as intensive as a fungal forest spread because it's only checking once per month within the bubble and scaling everything else to seem like it was hit with the same algorithm (I think).

Offline Coolthulhu

  • Contributor
  • Survivor
  • ****
  • Posts: 3806
    • View Profile
Re: Bushes (and possibly trees) spread?
« Reply #3 on: September 28, 2017, 01:16:15 PM »
The performance is not a problem.
The problem would be designing it so that it doesn't result in one of:
  • Jungle everywhere in short time
  • Barely anything changing unless you play for 8+ seasons

Offline Squaggly Maggleton

  • Zombie Food
  • *
  • Posts: 39
    • View Profile
Re: Bushes (and possibly trees) spread?
« Reply #4 on: September 28, 2017, 02:11:26 PM »
I don't have an answer to balancing, that would need to be ironed out through play if the idea gets picked up on. Honestly, it would probably be realistic if it doesn't change much in 8 seasons, but if the worry is it spreading too quickly the game could put a cap on how much furniture could spread per tile per month to keep it in line with newly explored tiles. They could be used as a baseline to balance against.
I don't even think it taking 8+ seasons would be bad. I envision this as a way to give endgame players some restrictions and make basebuilding better if you have an area with good road coverage, not drastically change the map. I also think it would "funnel" zombies, keeping them in cities or on roads because there's less empty field tiles to spawn on, so it would definitely be bad if it takes effect too early.

Offline §k

  • Survivor
  • ***
  • Posts: 493
    • View Profile
Re: Bushes (and possibly trees) spread?
« Reply #5 on: September 28, 2017, 02:57:39 PM »
The development of plant should match the tile's biome. A forest cabin should be taken over by tree and bush. A farm on field should only develop sparse shrubs.

Offline Coolthulhu

  • Contributor
  • Survivor
  • ****
  • Posts: 3806
    • View Profile
Re: Bushes (and possibly trees) spread?
« Reply #6 on: September 28, 2017, 05:35:11 PM »
Honestly, it would probably be realistic if it doesn't change much in 8 seasons

Then it's not really worth working on, considering that average game doesn't last half that long.

Offline EpsilonShadow

  • Zombie Food
  • *
  • Posts: 25
    • View Profile
Re: Bushes (and possibly trees) spread?
« Reply #7 on: September 28, 2017, 06:06:08 PM »
How about some blob infestation that make fast growing killer woods?

Offline DemAvalon

  • NPC
  • **
  • Posts: 212
  • Through sheer magic I have registered on the forum
    • View Profile
Re: Bushes (and possibly trees) spread?
« Reply #8 on: September 28, 2017, 06:13:27 PM »
How about some blob infestation that make fast growing killer woods?
those are called triffid groves and are already in  the game.
"Oh Master, I don't do THOSE sorts of things♪..."

Offline Umbra Vorago

  • Zombie Food
  • *
  • Posts: 79
    • View Profile
Re: Bushes (and possibly trees) spread?
« Reply #9 on: September 28, 2017, 07:25:59 PM »
Sure, not as many people live long enough to see 8 seasons pass, but a lot of characters DO live to that point and beyond. I don't think it should be written off as "not worth it" considering there are still a considerable amount of players who can and do reach that stage.

Realism realism, that's something that gets brought up a lot and this would be a nice realistic addition, so I'd rather it not get shoved under the rug.
However if someone would like to expand the lore and say that the apocalypse/blob/infections/weather/whatever make it so natural plant life can't support new plant life very easily without being tended to, then I wouldn't mind it being swept under. So long as an in-game lore reason is given.

But like I said, there are still a lot of players who make it to that point and beyond, it'd be a nice addition for those who do live longer lives.

Offline Kevin Granade

  • Administrator
  • Survivor
  • *****
  • Posts: 5572
  • I code dead people.
    • View Profile
Re: Bushes (and possibly trees) spread?
« Reply #10 on: September 28, 2017, 08:51:50 PM »
One peak growing season is plenty to see some significant movement in particularly fast-growing plants.
What you're going to see are weeds, grasses, and vines going crazy, normally they're constantly suppressed to keep them from damaging structures, and they're also held back by regular traffic (vehicular or pedestrian).

Short-term grasses are going to grow taller and spread across bare soil, and some isolated hard surfaces are going to have grass break through them.  Meanwhile vines will start growing up the sides of houses and walls, and in some cases growing into the houses themselves.

The problem is none of that is particularly dramatic, none of those features are large enough to change the properties of the affected terrain, just the descriptions.

Bushes aren't going to multiply very quickly, but they are going to get significantly thicker in a relatively short amount of time.

I'm skeptical that we would want to bother with tree growth at all, you're going to see some minor changes over the course of several years, but for really dramatic changes it's going to take more like 10 years.  The most I'd expect to see is some saplings appear over the course of each year.

We might just have something that adjusts the descriptions, and possibly the displayed character or tile of a feature that gets applied over time.  This would get us an overall sense of growth and decay without having to track the state of every tile.  It would also handle it in a way that lets us roll back the clock when we start a new character, so the 5th character in a world doesn't run across overgrowth everywhere.
Its like a fun family cookout, except your family is burning in flames while trying to eat you. -secretfire
I'm more excited than a survivor on meth and toast'ems. -Nighthawk
The the giant wasp is slammed through the zombie brute!

Offline Squaggly Maggleton

  • Zombie Food
  • *
  • Posts: 39
    • View Profile
Re: Bushes (and possibly trees) spread?
« Reply #11 on: September 29, 2017, 06:04:19 AM »
That seems like a good way to handle part of it, but I think it would get noticeably harder to drive through grass and bushes as they grow IRL. It's kinda reasonable to drive 80mph through well kept grass in a straight line, but if that grass turns into hay it'll be much more difficult. A bush in the middle of a field will get quite a bit bigger after a year or two, and if you crash into it at high speeds it would definitely leave a mark.

If you're thinking about tracking the age of the save and applying visual changes to individual types of tiles all at once, maybe tie in some sort of "difficulty driving" change when the visual change happens? Hay bogging you down and large bushes actually damaging your vehicle a decent amount could really emphasize the importance of roads, and make clearing well-traveled routes a better option compared to just going around a block time after time.

If implemented, this would make wilderness bases harder to access, so some sort of quick way to reduce a tile to dirt would be needed (we can already use the construction menu, but going tile to tile for any sort of distance is ridiculous). Maybe make a vehicle part that comes from salt trucks, the kind that keeps the road from freezing in the winter. It could be loaded with salt and, when activated, make grass tiles under it turn into dirt tiles to create dirt roads quickly.

Offline Zhilkin

  • NPC
  • **
  • Posts: 210
    • View Profile
Re: Bushes (and possibly trees) spread?
« Reply #12 on: September 29, 2017, 10:44:48 AM »
Please check this Lua-mod: https://www.dropbox.com/s/jd18xbdiwifrrtw/ZSLua_ForestGrowth.zip?dl=0

Once a minute a lua function is called which transforms terrain in a donught shape (with 2/24 tiles min/max radius) around a player.

Terrain evolves in high rates:

- dirt to grass (1/4 probability);
- grass to shrub (1/8 probability);
- shrub to tree (1/16 probability).

Also terrain degenerates in lower rates:

- grass to dirt (1/16 probability);
- bush to grass (1/32 probability);
- tree to bush (1/64 probability).

You can check animated gif (warning! ~8 megabytes) here: https://imgur.com/a/hDRej


Is that what you wanted?
« Last Edit: September 29, 2017, 12:00:34 PM by Zhilkin »

Offline Squaggly Maggleton

  • Zombie Food
  • *
  • Posts: 39
    • View Profile
Re: Bushes (and possibly trees) spread?
« Reply #13 on: September 30, 2017, 06:01:11 AM »
Ok that's hilarious, thank you. Imma definitely start a game with that mod active. I love that's it's easy to tweak the mod to something more reasonable for when I get tired of being an African fertility god.

Is there some way to make terrain in newly generated tiles be more populated with bushes/trees to scale with the growth around you? Something like:
first season day 1: normal terrain population
third season day 1: something like the end of your gif

For the numbers you have in play it's not really needed, but this might already be something I use permanently once I tweak the numbers to be less fun. I don't want to sound ungrateful, I really appreciate this and it's awesome already, thank you again!

Offline Zhilkin

  • NPC
  • **
  • Posts: 210
    • View Profile
Re: Bushes (and possibly trees) spread?
« Reply #14 on: September 30, 2017, 07:08:52 AM »
I beleive it is possible.

One can move `forest`, `forest_thick`, `forest_river` and `field` terrains to json and add link to lua script which will grow more or less vegetation depending on season.

Otherwise one can change mapgen functions in cpp with season-dependent changes.

https://github.com/CleverRaven/Cataclysm-DDA/blob/master/src/mapgen_functions.cpp#L460
https://github.com/CleverRaven/Cataclysm-DDA/blob/master/src/mapgen_functions.cpp#L511