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

Planet Simulator

Discussion in 'Civ5 - Map Scripts' started by Bobert13, May 25, 2014.

  1. Bobert13

    Bobert13 Prince

    Joined:
    Feb 25, 2013
    Messages:
    345
    Putting this at the end of the Cleanup() function should do the trick:
    Spoiler :
    Code:
    
       for k = 1, #landTab do
            local i = landTab[k]
           local plot = Map.GetPlotByIndex(i)
           if plot:GetFeatureType() == featureForest then
               local roll = PWRandInt(1,100)
               if roll > 25 then
                   plot:SetTerrainType(terrainPlains,true,true)
                   table.insert(plainsTab,i)
                   table.remove(grassTab,k)
               end
            end
        end

    That's a 1 in 4 chance of forcing Plains under Forest. You could substitute in different logic. Also, it may or may not require more robust code to guarantee that the plot underneath is grass for the purposes of tracking. I'm not even sure where all I'm using those tables anymore but I do know they sped things up substantially so keeping them accurate is probably ideal.

    I'm 100% sure that both the Lua compiler built-in to Civ V and the Lua-JIT compiler available here on CivFanatics both treat "1/2" (or any fraction containing integers or even constants) as a single entity. It creates a token for it (read makes it a secret variable/constant) and passes it to the C compiler running underneath Lua as a single floating point value. You can even test it with the string.format printout if you've got the Firetuner Lua console installed from the dev kit.
     
  2. psparky

    psparky Prince

    Joined:
    Feb 24, 2011
    Messages:
    431
    Gender:
    Male
    Thank you very much for the code, you're a top man! I'll be trying it soon.

    I had already tried printing to the lua.log file to see the effect. I have a variable 'target' that I was already printing so I added target^1/2. I got 236 and 118, not 15.36...

    I just tried using the firetuner with this example:

    print((Game.GetActivePlayer()+9)^1/2)

    which gave 4.5, not 3.
    It seems there is something very odd (and somewhat troubling) going on if you get different results.:confused:
     
  3. Yaviel

    Yaviel Chieftain

    Joined:
    Aug 14, 2019
    Messages:
    45
    What a fantastic map script! I find it hard to describe justly other than . . realistic? I can wholeheartedly recommend it to any Civ V player, including Vox Populi users. Big props to you guys. :c5happy:
     
  4. saamohod

    saamohod Prince

    Joined:
    Jul 22, 2014
    Messages:
    542
    Location:
    Unoccupied Ukraine
    It may be the best map script out there and it seems to work great with Vox Populi mod, but it still has its downsides.

    While over-abundance of desert can be easily cured by adjusting some numbers as mentioned in the discussion earlier, sadly there seems no easy way to make it produce inland seas and lakes. The best this mapscript can produce is a couple of one-tile lakes on a large/huge map. Lakes larger than one hex are impossible altogether. This is very sad because inland water adds so much realism, sexiness and is also necessary to utilize a certain pantheon.
     
    Last edited: Oct 25, 2019
  5. azum4roll

    azum4roll King

    Joined:
    Jul 17, 2018
    Messages:
    625
    Gender:
    Male
    Probably too late, but you just need to add brackets around 1/2 to make it work...
     
  6. psparky

    psparky Prince

    Joined:
    Feb 24, 2011
    Messages:
    431
    Gender:
    Male

    Yes indeed! Starting at post #116, I was trying to convince the author that brackets are required in an expression like this, but he wouldn't believe me :(

    The consequence is that some code affecting tree placement isn't working as intended. However as overall tree placement seems reasonable, I suppose it doesn't really matter.
     
  7. psparky

    psparky Prince

    Joined:
    Feb 24, 2011
    Messages:
    431
    Gender:
    Male
    My most recent PS map had me starting on a narrow (1 or 2 tiles) strip of land between a 5 tile lake and a 20ish tile inland sea. The early game was largely focused on building canal cities to connect the inland sea to the open ocean. There were also two 5 or 6 tile lakes on the other continent.
     
  8. adan_eslavo

    adan_eslavo Archmage of all Pixels Supporter

    Joined:
    Apr 23, 2017
    Messages:
    2,026
    Gender:
    Male
    Location:
    Łódź, Poland
    Are the inland seas frequent on this map? How would you compare ti to tectonic or communitu scripts?
     
    ryanmusante likes this.
  9. Catan

    Catan Chieftain

    Joined:
    May 7, 2020
    Messages:
    7
    Location:
    Ostarrichi
    @psparky would you share your latest version?
     
  10. psparky

    psparky Prince

    Joined:
    Feb 24, 2011
    Messages:
    431
    Gender:
    Male
    My current version has a number of personal hacks that would need a fair bit of work to make it fit for general usage. Is there any particular feature you are interested in?
     
  11. Catan

    Catan Chieftain

    Joined:
    May 7, 2020
    Messages:
    7
    Location:
    Ostarrichi
    I'm most interested in your tweaks, improvements and fixes because if anybody is still trying to improve planet simulator, I thought it would be you. I think less desert, larger and more lakes and your bracket fix would be good additions. Although as I said, I'm most interested what you have brewed up.
     
    Padre19 and ryanmusante like this.

Share This Page