Resource icon

TreeSuccession 37.12

Tekamthi

Emperor
Joined
Aug 12, 2016
Messages
1,635
Download current version at https://forums.civfanatics.com/resources/treegrowth-vp.30836/

Attachments on this top post are out-dated, just here for reference.

v37+, in brief:
- mod no longer spawns forest and jungle directly; instead spawns early-successional vegetation, which converts into forest or jungle after 10 turns. (pls keep an eye out here for unintended effects)
- notification converted to on-map text pop-up, rather than notification panel. Notification only appears if plot is in view of player; no longer for all discovered plots.
- added mod customization variables at top of TreeGrowth.lua (use text editor to adjust), for spawn probability, new growth turn length, etc.
- Wildfires & smoke may spawn in unimproved plots, removing forest
Spoiler :
1690668206545.png


Old OP text:
Spoiler :

Doesn't deserve to be called a full mod necessarily, but this is one of the first components I sought out for civ 5 on these boards.. was disappointed for a long time that the G&K version was not useable in BNW and VP... but no longer!

Original authors deserve all the credit. I just hacked things together so they'd work again. Have done just basic testing, but haven't run into any problems yet...

EDIT: from below, I made some changes and uploaded a v2... seems like the v1 is still getting downloaded, probably since its in OP, so I've added v2 here. I haven't actually tried it in-game since updating (long story), so I'll leave v1 in place too until I can confirm my theory-crafting worked...
 

Attachments

  • TreeGrowth (VP) (v 1).civ5mod
    2.6 KB · Views: 369
  • TreeGrowth (VP) (v 2).civ5mod
    2.6 KB · Views: 692
Last edited:
How does it work?
How fast do they grow? Is there a limitation, ie, a new forest tile will only grow if 2 forest tiles are adjacent?
Any conflicts with the reforestation mod?
Will they grow over improved tiles?
 
i haven't worked out the simple statistical odds of forest growth based on the code; for anyone that's played CCTP, this was salvaged from their version mainly (huge thanks to them and original mods of course), and should behave similarly. My work here thus far is limited mainly to cleaning up some lua references, adding a VP-compat generic notification message and coordinate, and packaging as an independent component.

In my early testing, i've revealed the entire map on huge, and it seems that 1-2 forest or jungle grows every other turn, or every third turn maybe, on epic speed (at the extreme i saw 2 forest and 2 jungle grow in one turn, and then nothing for 3-4 turns). Sorry I'm a little light on info so far, but I'll try to translate the .lua a little better next time I take a look here. Its not all that complicated I think as far as code goes for anyone that's feeling adventurous.

I haven't observed any growth on top of improvements, and I'm almost positive i saw this provided for in the lua's tile validity checks.. it does grow on top of unimproved resources. I think the lua mechanism checks for either clear plains/grassland, or tiles adjacent to river... also has to be adjacent to an existing forest/jungle. blocks mountains of course. I'm reciting from memory here, so forgive me if I end up confusing existing w/ desired ideas, but this is roughly how it goes. The only "problem" i've observed is it growing on top of workers that are currently improving a tile... I think this will have to be worked out, cuz even if I personally like it as a minor man vs nature mechanism (added value to chopping tiles first, right?), the AI doesn't know about it.
 
Cool. I assume there is a 0% chance of the forest/jungle spawning with a bonus resource like deer/banana?
 
Cool. I assume there is a 0% chance of the forest/jungle spawning with a bonus resource like deer/banana?
i haven't seen anything in the code that might spawn any resource, no.. I suppose it could be added if this is desired? I think reforestation does this, right?

As far as I know this should work fine w/ reforestation.. I believe the forest/jungle adjacent check is fairly simple, and probably won't distinguish between original and reforested tiles.. only a theory though right now
 
I don’t think it’s necessary or even desirable. I was thinking that endless swaths of forest, in the case of an unexplored continent, would swallow up land masses; bonus resources might break up the monotony if that occurred, but I think it would cause more problems than it would solve
 
I don’t think it’s necessary or even desirable. I was thinking that endless swaths of forest, in the case of an unexplored continent, would swallow up land masses; bonus resources might break up the monotony if that occurred, but I think it would cause more problems than it would solve

I actually like the idea you're outlining here... I imagine a very advanced implementation of this mod could check how far away a tile is from any existing border, and spawn in bonus resources on low % in remote locations, to maybe encourage settlement in these areas... admittedly this probably further than i would take it myself, just due to time, and my lua skills being somewhat limited as far as making efficient and broad checks for things like this

a low % chance, even very low, applied generally, seems very possible though, and not unrealistic... i believe global warming mod also does this in its own way, for anyone familiar
 
I haven't observed any growth on top of improvements, and I'm almost positive i saw this provided for in the lua's tile validity checks.. it does grow on top of unimproved resources. I think the lua mechanism checks for either clear plains/grassland, or tiles adjacent to river... also has to be adjacent to an existing forest/jungle. blocks mountains of course. I'm reciting from memory here, so forgive me if I end up confusing existing w/ desired ideas, but this is roughly how it goes. The only "problem" i've observed is it growing on top of workers that are currently improving a tile... I think this will have to be worked out, cuz even if I personally like it as a minor man vs nature mechanism (added value to chopping tiles first, right?), the AI doesn't know about it.
I've looked at the code and I wish you good luck. I'm surprised I didn't find this oldie for myself to fix. The problem can be resolved just by checking whenever or not there's a worker or checking (IsImproving or whatever it's called nowadays).
 
Cool mod, but I find that forests are popping up perhaps a bit too frekvent.

Edit: Forest shouldn't grow on bison, elephant, cow etc. either. That's not right. @Tekamthi Can you fix?
 
Last edited:
so I made some small changes, as per above feedback and my own observations while playing with this. Generally trying to make this effect occur less often. Basically reduced growth rate by factor of 3 and blocked forest growing on any resource (I'm not sure it should truly be any resource but this was easiest/simplest approach in existing lua).

anyway, civ 5 is not running any mods for me right now for w/e reason, and its gonna take at least another week before i can troubleshoot, but i'll upload my chaanges from modbuddy anyway. Can someone test and confirm its not crashing or throwing errors? ideaally with an eye on firetuner output panel.. it should be good to go as-is I think, my changes on this pass were very minor
 

Attachments

  • TreeGrowth (VP) (v 2).civ5mod
    2.6 KB · Views: 236
anyway, civ 5 is not running any mods for me right now for w/e reason, and its gonna take at least another week before i can troubleshoot, but i'll upload my chaanges from modbuddy anyway.
This issue is with VP only? When did it begin? I saw another thread someone mentioning various mods not functional recently.
 
This issue is with VP only? When did it begin? I saw another thread someone mentioning various mods not functional recently.

its only w/ the part (1) module of vp, where the dll sits.. it just won't show up in the mod list in-game no matter what... ultimately this means i cant enable anything else, since almost everything i use has a dependency chain that traces back to that point. i havent tried reinstall or anything that drastic yet, so that might solve... i did have some system OS changes since i last played (ie updated to newer win 10 build), so I suspect that might have something to do w/ it
 
Speaking just from memory, there's some sort of a main function, in the main .lua file, that calculates some RNG chance that a forest or jungle will spawn. iirc the code has to be changed in two places, once for forest and once for jungle. I believe its just changing a static integer in those two spots, but there is something slightly complex in how to computes this chance. I can't recall the details.

In a perfect world with unlimited time, I'd like to make a revision of this and a few other mod files i've posted here, but just not possible rn. I'll keep this in mind as a request, ie to add some easy-to-find variable to modify the likelihood of growth. For now v1 is the 'more likely' version, and v2 the 'less likely' version
 
heres a screenshot, maybe it will refresh your memory
i think where it is, up is for forest and down for jungle
hope it helps
Captura.JPG
 
excellent, thank you -- you've got it. Pretty sure you want to change that base = 1500 value (alternatively you could tweak those other multipliers, but for simplicity just change the 1500 value); I believe you want to lower this number to increase the rate at which jungle/forest grow. Eg. to roughly double the current rate, perform the inverse ie halve this integer: change 1500 to 750, or w/e corresponding number. Could be wrong, I might have read it backwards somehow in my haste; if it doesn't seem to be working, test with more extreme values in its place (ie much lower or higher than 1500): the effect should become noticeable in-game as you stretch these out.
 
Top Bottom