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

Discussion in 'Civ5 - Mod Components' started by Bhruic, Sep 30, 2010.

  1. Bhruic

    Bhruic Emperor

    Joined:
    Nov 15, 2005
    Messages:
    1,457
    My original wasn't designed as a generic notification mod, so that's a moot point. But having a custom notification mod without the ability to set your own mouse button callbacks is pointless, imo.

    Bh
     
  2. TheChanger

    TheChanger Warlord

    Joined:
    Jul 2, 2010
    Messages:
    281
    Gender:
    Male
    Location:
    Australia
    one thing i have to say is that the forest spread is very good, but it spreads WAY too fast.
     
  3. Bhruic

    Bhruic Emperor

    Joined:
    Nov 15, 2005
    Messages:
    1,457
    Hmm, that could be a valid point. I was just guessing as to what a good rate would be. Let's take a standard size map on normal speed. In the space of, say, 100 turns, how many new forests would be considered decent?

    Bh
     
  4. CrazyAce

    CrazyAce Prince

    Joined:
    Jun 16, 2004
    Messages:
    396
    Location:
    I'm here, soon to be there.
    ooo... that’s a tough decision, given the amount of already placed forests as a variable... I would say 3 or 5 maybe?

    BTW I love the mod, it adds more immersion to the game.
     
  5. tokala

    tokala Emperor

    Joined:
    Jan 14, 2006
    Messages:
    1,739
    Location:
    Klein Texas, Germany
    How many hexes adjacent to forests does a standard size map have usually? 200?
    3-5 forests per 100 turns per 200 tiles would be rather pointless, no? RifE has resource growth probabilities of ~ 1 per turn per 2000 tiles, and even with the high value those reasources have it feels rather like flavour than some useful gamemechanic. I would suggest to aim for something like 1 per turn per 1000 tiles per adjacent forest tile for grassland, half of that for plains.

    And I don't really think it's too fast at the moment :dunno:
     
  6. lukeloh

    lukeloh Chieftain

    Joined:
    Oct 6, 2010
    Messages:
    58
    Bhruic, thanks for this mod. I actually downloaded v1 when you released it to give it a whirl.

    Unfortunately I deleted it pretty quickly because a forest grew into a plains tile my worker was improving (I was building a farm). This made me lose the worker time spent and broke my suspension of disbelief :(

    I like the concept though - is there a way to make the script check to see if the tile is currently being improved in which case it should be exempt from regrowth?
     
  7. Shakiko

    Shakiko Warlord

    Joined:
    Mar 1, 2007
    Messages:
    109
    Actually I'm feeling like it could be a tad faster... :lol:


    So, is there are way to manually tweak the spread speed/chance to personal preferences ?

    I was looking at the code in Ingame.xml and Treegrowth.lua, but sadly I could not find/understand any of it ^^;;;
     
  8. rezaf

    rezaf Warlord

    Joined:
    Dec 3, 2003
    Messages:
    179
    Isn't there a getPlotCity() function any longer?
    If there is, you could use that to get info about whether or not a city is on a given plot and thus prevent forest growing there.

    Way back when Civ4 came out, I did a similar mod ... obviously not for forests, but anyway, I think I used some variable to determine how many actual years each turn spanned to adjust growth speed accordingly.
    I.e., early on, when one turn is fifty years or whatever it was, it makes sense that the growing speed is very fast (measured in turns), whereas in the later game, where one turn is only a year, it should take a lot longer.

    This could be expanded to grow jungles and deserts, too.

    About the script itself ... I don't quite understand it either, I have to admit.
    Isn't, in a standard game, GrowthPercent and ResearchPercent 100?

    So this line:
    Code:
    local base = 500 * (info.GrowthPercent / 100) * (world.ResearchPercent / 100);
    would mean 500 * (100/100) * (100/100)?
    And the following line would roll a Random number between 0 and 500, so a forest would have a 1/500 chance (0.002%) of growth each turn?

    Anyway, cool little mod, I'll use it once I'm done playing vanilla.
    _____
    rezaf
     
  9. Shiggs713

    Shiggs713 Immortal

    Joined:
    Mar 11, 2007
    Messages:
    2,361
    Location:
    Indianapolis
    Hi again Bhruic, great mod comp once again. Using v3 now and the notifications are a very nice addition. I have recommended a couple mod comps to use with my Shiggs Earth map, and I trust it is ok that this is one of them. ;) Just a really great mod comp imo

    On the fast or not too fast, I would have to say its slightly too fast. Not much though, its close.
     
  10. Bhruic

    Bhruic Emperor

    Joined:
    Nov 15, 2005
    Messages:
    1,457
    Yeah, there is, I just hadn't noticed forests growing on city squares until after the last release. Next version should have that fixed.

    0.2% chance, but yes, on a Standard sized map, at Normal speed, the random number isn't affected by settings.

    Basically, the idea is that if you are playing a longer game, there's going to be more turns, so the chance of forests spreading should decrease. And similarily, if you are playing on a huge map, there's a lot more tiles, so again, spreading chance should decrease. Vice versa for quick, smaller maps.

    Bh
     
  11. Bhruic

    Bhruic Emperor

    Joined:
    Nov 15, 2005
    Messages:
    1,457
    Ok, that made me laugh, I hadn't even considered that possibility. There should be some way to check if a worker is improving a tile, and discounting that tile if there is - I'll look into it.

    Bh
     
  12. Bhruic

    Bhruic Emperor

    Joined:
    Nov 15, 2005
    Messages:
    1,457
    I don't think there's any way to store stuff in config files... Although if there is, then that would be a good solution. Otherwise, I could make a function that would allow the spread chance to be modified in-game, but you'd have to do it every time you started/loaded a game, which would be a pain.

    Bh
     
  13. Lodakai

    Lodakai Chieftain

    Joined:
    Oct 16, 2010
    Messages:
    7
    I love this mod.. especially since I play Iroquois mostly.
    If you ever have time I would like to see a version with jungle too.

    Its really fun playing on arid landscapes and protecting the open areas so a forest can grow on it. The bad side effect now is that I get so angry when my neighbors build improvements as I will not be able to remove them to let the great forest grow ><

    Good incentive to destroy them though.
     
  14. jenks

    jenks Prince

    Joined:
    Jan 9, 2006
    Messages:
    494
    Location:
    Yorkshire, UK
    good work on this one, very nice tweak :)
     
  15. WickedSick37

    WickedSick37 Chieftain

    Joined:
    Oct 5, 2010
    Messages:
    19
    I've tried it. Huge size, standard speed, I really like it ^^. In my opinion it grows a little bit too fast though.

    Edit: Nevermind, I think it doesn't grow as much later in the game. Might be because there are less possible tiles to grow in.
     
  16. ArbogLi

    ArbogLi Chieftain

    Joined:
    Apr 25, 2010
    Messages:
    64
    Um... good mod, if you don't mind I will add it (when I have some time) to my Random Events mod.

    And by the way, to fix your "bug" here goes the solution, I think this must work: you have this section to control the "forestable" plots:

    Code:
    function IsValidForestTile(plot)
    	local plotType = plot:GetPlotType();
    	local terrainType = plot:GetTerrainType();
    	local featureType = plot:GetFeatureType();
    	local improvementType = plot:GetImprovementType();
    	local NO_IMPROVEMENT = -1;
    
    	[B]if plotType == PlotTypes.PLOT_MOUNTAIN then
    		return false;
    	elseif plotType == PlotTypes.PLOT_OCEAN then
    		return false;
    	end[/B]
    	(...)
    This is right, but you should add a condition to the section in blod, the result:

    Code:
    [B]	if plotType == PlotTypes.PLOT_MOUNTAIN then
    		return false;
    	elseif plotType == PlotTypes.PLOT_OCEAN then
    		return false;
    	elseif plot:IsCity() == true then
    		return false;
    	end[/B]
    With "IsCity()" function (included in the API) for the plots I hope that your plobem whould be solved. :)
     
  17. Mazdek

    Mazdek Chieftain

    Joined:
    Jan 28, 2011
    Messages:
    5
    I'm glad I found this mod, since there doesn't seem to be a tech to allow for planting of forests like in earlier games. My $.02: Firstly, I don't care about forest expansion in land that I don't own, could it only notify if the growth is inside my borders plus maybe in visual range of a unit or city? That last part might be unneccessarily complicated to calculate, I'd be fine with just keeping it to internal expansion. Second, I agree with someone up there, I had a worker building a farm in the ONE open hex of my starting city and then a forest grew around him (though it was not drawn, still saw the farm base graphics) so he had to sit in the city until I researched mining so I could clear it out. :p

    How would this interact with Dale Kent's Hardwood Strategic Resource mod? Would they trip over each other and cause crashing? Could they be made to work together so that there's a chance that a hardwood resource forest is created during a growth event?
     
  18. gandalf51

    gandalf51 Chieftain

    Joined:
    Nov 10, 2005
    Messages:
    62
    Location:
    France
    Bhruic could you make a mod that allow workers to plant forests (with the right tech) ?
     
  19. gmJamez

    gmJamez Chieftain

    Joined:
    Mar 5, 2011
    Messages:
    4
    I've been playing with my own modified/bug fixed version of this mod for quite a while now and thought I'd share the result as v4.
    Changes:
    - Forest won't expand into cities or tiles that are currently being improved by a worker.
    - You will only be notified about the forest expansion when it is adjacent to or on a tile you own. The "adjacent to" option gives you the chance to consider purchasing the tile.
    - Uses Custom Notifications mod by Sneaks/alpaca rather than the compatibility breaking method in v3.
    - No longer modifies InGame.xml and NotificationPanel.xml.

    I haven't looked into expanding jungle but might...

    Enjoy.

    TreeGrowth (v 4).civ5mod, File size: 10.65 KB
    I wanted to upload the file here but for whatever reason I get an "upload failed" message without further info :confused:
     
  20. Sneaks

    Sneaks Brooklyn Bum

    Joined:
    Oct 15, 2010
    Messages:
    1,877
    Location:
    NYC
    Please upload the file to the CivFanatics site or just attach it to your post. FileServe is a pain to deal with.
     

Share This Page