1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

TreeGrowth (VP)

Discussion in 'Mods Repository' started by Tekamthi, Jan 4, 2018.

  1. Tekamthi

    Tekamthi Chieftain

    Joined:
    Aug 12, 2016
    Messages:
    263
    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...
     

    Attached Files:

    Last edited: Nov 17, 2018
    IcyAngel and ThirstQuencher like this.
  2. pineappledan

    pineappledan Warlord

    Joined:
    Aug 9, 2017
    Messages:
    2,629
    Gender:
    Male
    Location:
    Alberta, Canada
    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?
     
  3. Tekamthi

    Tekamthi Chieftain

    Joined:
    Aug 12, 2016
    Messages:
    263
    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.
     
    vyyt likes this.
  4. pineappledan

    pineappledan Warlord

    Joined:
    Aug 9, 2017
    Messages:
    2,629
    Gender:
    Male
    Location:
    Alberta, Canada
  5. Tekamthi

    Tekamthi Chieftain

    Joined:
    Aug 12, 2016
    Messages:
    263
    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
     
  6. pineappledan

    pineappledan Warlord

    Joined:
    Aug 9, 2017
    Messages:
    2,629
    Gender:
    Male
    Location:
    Alberta, Canada
    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
     
    vyyt likes this.
  7. Tekamthi

    Tekamthi Chieftain

    Joined:
    Aug 12, 2016
    Messages:
    263
    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
     
  8. Enginseer

    Enginseer Salientia of the Community Patch Supporter

    Joined:
    Nov 7, 2012
    Messages:
    2,837
    Gender:
    Male
    Location:
    Somewhere in California
    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).
     
  9. John.B.C

    John.B.C Chieftain

    Joined:
    Nov 22, 2016
    Messages:
    146
    Gender:
    Male
    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: Jul 17, 2018
  10. Tekamthi

    Tekamthi Chieftain

    Joined:
    Aug 12, 2016
    Messages:
    263
    yeah this overdue for an update; i'll try to get some eyes on this in next few weeks -- changing conditionals in lua like this should be relatively easy tweaking, if anyone else is feeling ambitious :D
     
    John.B.C likes this.
  11. Tekamthi

    Tekamthi Chieftain

    Joined:
    Aug 12, 2016
    Messages:
    263
    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
     

    Attached Files:

  12. ryanmusante

    ryanmusante Sesquipedalianist Supporter

    Joined:
    Jan 4, 2018
    Messages:
    788
    This issue is with VP only? When did it begin? I saw another thread someone mentioning various mods not functional recently.
     
  13. Tekamthi

    Tekamthi Chieftain

    Joined:
    Aug 12, 2016
    Messages:
    263
    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
     

Share This Page