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

PerfectWorld6 4

Map Script for Civ 6

  1. cephalo

    cephalo Chieftain

    Joined:
    Jul 26, 2007
    Messages:
    1,983
    Location:
    Missouri, USA
    cephalo submitted a new resource:

    PerfectWorld6 - Map Script for Civ 6

    Hi Everyone! This might be the best PerfectWorld yet!

    PerfectWorld creates an alternative world map that is convincingly realistic with a simulated climate based on geostrophic and monsoon weather patterns. The hydrology of these maps are simulated according to elevation and rainfall amount. Rivers and lakes use accurate drainage paths that follow elevation and rainfall amounts. The result is a believable map that makes exploration more fun and adds extra challenge to the game.

    This map also creates, as a default option, multiple continents that can be designated as 'old world' or 'new world' similar to the 'Terra' maps in previous Civ games. As usual, PerfectWorld maps do take an extra long time to generate, so after beginning the game, go do some chores or something and come back later.

    These maps do look beautiful, but my role in that is only a small part of the story. Somewhere at Firaxis is a great artist who made sure all these tiles fit together, so that a string of mountain tiles looks like a cohesive mountain range, and I am most pleased that lakes can have an outflow! I just want to give a big thank you to the artist who make this all work. They did a fantastic job!

    Now for some screenshots:

    One thing that is new for Civ is that lakes can now have river outflows. This allows them to be placed as part of the river system rather than separately. I have taken advantage of this and incorporated lakes into the river system, so that rivers can flow into lakes, and lakes can flow into other lakes, on and on toward the sea.
    20181011185335_1.jpg

    PerfectWorld also creates nice long mountain ranges, dividing up regions and creating strategic barriers.
    20181011162438_1.jpg

    PerfectWorld also creates an illusion of altitude, by making high altitude areas colder and letting the rivers follow accurate drainage paths. Sometimes it takes a bit of imagination to see it, but it's based on rules.
    20181011162358_1.jpg

    So why did it take two years? I have been busy! I recently completed my first complete game on my own called Forward Line, which you can see here if you are curious. Please however, keep all discussion of that on the Steam forum, and only discuss PerfectWorld on this thread.

    Read more about this resource...
     
    Last edited: Oct 13, 2018
    [to_xp]Gekko, Seek, Spicer and 2 others like this.
  2. Golan v

    Golan v Chieftain

    Joined:
    Oct 31, 2016
    Messages:
    137
    Gender:
    Male
    no screen shots? :)
     
  3. cephalo

    cephalo Chieftain

    Joined:
    Jul 26, 2007
    Messages:
    1,983
    Location:
    Missouri, USA
    You ninja'd my screenshots! Enjoy.
     
    Golan v likes this.
  4. pokiehl

    pokiehl Chieftain

    Joined:
    Mar 5, 2017
    Messages:
    340
    WONDERFUL! Very excited to give this a spin later today. I think many of us have been waiting since the release of Civ 6 for this! Thank you so much for doing this, cephalo - PerfectWorld was my favorite Civ 5 map script by far.

    EDIT: Will you be uploading this to Steam at any point?
     
  5. cephalo

    cephalo Chieftain

    Joined:
    Jul 26, 2007
    Messages:
    1,983
    Location:
    Missouri, USA
    I am trying to figure it out right now... Looking for the button that says 'post new mod to Steam Workshop'. Haven't done it before.
     
  6. pokiehl

    pokiehl Chieftain

    Joined:
    Mar 5, 2017
    Messages:
    340
    If you can't figure it out, just add me on Steam and I'll be happy to talk you through it via steam chat instead of cluttering up this thread.

    EDIT: Unfortunately this mod doesn't seem to work with custom map sizes. I made a mod called Larger Map Sizes and when I select any of my 3 custom sizes, I get kicked back to the start menu. I tested with only PW6 and Larger Map Sizes active, no other mods. No database errors, but the Lua log reports this:

    Code:
    Runtime Error: C:\Users\ilovewubbabzy\Documents\My Games\Sid Meier's Civilization VI\Mods\PerfectWorld6\Maps\PerfectWorld6.lua:1959: attempt to index a nil value
    stack traceback:
        C:\Users\p0kiehl\Documents\My Games\Sid Meier's Civilization VI\Mods\PerfectWorld6\Maps\PerfectWorld6.lua:1959: in function 'RiverMap:SetRiverSizes'
        C:\Users\p0kiehl\Documents\My Games\Sid Meier's Civilization VI\Mods\PerfectWorld6\Maps\PerfectWorld6.lua:2701: in function 'GeneratePlotTypes'
        C:\Users\p0kiehl\Documents\My Games\Sid Meier's Civilization VI\Mods\PerfectWorld6\Maps\PerfectWorld6.lua:219: in function 'GenerateMap'
        [C]: in function '(anonymous)'
    Lua callstack:
    Runtime Error: Call to GenerateMap() had errors
    stack traceback:
        [C]: in function '(anonymous)'
     
    Last edited: Oct 16, 2018
  7. cephalo

    cephalo Chieftain

    Joined:
    Jul 26, 2007
    Messages:
    1,983
    Location:
    Missouri, USA
    Hmm. so it only the custom map sizes this happens on? The place it crashed shouldn't have anything to do with map size. I will check it out. Right now I have YnAMP installed, I will try the mod you mentioned.

    EDIT: it happens on the YnAMP sizes too. Let me try to figure it out. Haha, it's also reporting a map size of width=zero hight=zero.

    I think we might be overriding the same function to increase map size, and it's incompatible. I'll have to look into how those mods work.
     
    Last edited: Oct 13, 2018
  8. cephalo

    cephalo Chieftain

    Joined:
    Jul 26, 2007
    Messages:
    1,983
    Location:
    Missouri, USA
    Another question, when I subscribe to a Steam Workshop mod, where do those files go? I'm not finding Larger Maps mod in my normal mods folder, even though I am subscribed.

    EDIT: I found them buried deep in the bowels of the Steam folder
     
  9. pokiehl

    pokiehl Chieftain

    Joined:
    Mar 5, 2017
    Messages:
    340
    Civ 6 Steam mods are sent to a weird folder: C:\Program Files (x86)\Steam\steamapps\workshop\content\289070. Each mod is within another numbered folder. Larger Map Sizes is 894934462.

    Sorry for the trouble. Now curiously, I'm not getting this crash to menu with YNAMP when I choose Gedemon's custom sizes. I tried to load Enormous and it sent me into a pangaea breaker loop, but I'm trying again and seeing if it loads.

    Larger Map Sizes simply adds new sizes to the database, and does nothing with Lua. Hmm. I've already tried messing with LoadOrder to force PW6 to load before or after Larger Map Sizes and that hasn't done the trick yet.
     
  10. pokiehl

    pokiehl Chieftain

    Joined:
    Mar 5, 2017
    Messages:
    340
    Well, YNAMP is working fine - I just generated a map with Gedemon's Giant size. This is so weird..I'l keep messing about on my end too.
     
  11. cephalo

    cephalo Chieftain

    Joined:
    Jul 26, 2007
    Messages:
    1,983
    Location:
    Missouri, USA
    Ok so I've look at the xml in your mod pokiehl, and it looks very basic, like it should just work. For some reason the Map.GetGridSize() function is returning zero for width and height.

    This function is the problem somehow:
    Code:
    function GetMapInitData(MapSize)
        local MapSizeTypes = {};
        local Width = 0;
        local Height = 0;
    
        for row in GameInfo.Maps() do
            if(MapSize == row.Hash) then
                Width = math.floor(row.GridWidth * 1.15);
                Height = math.floor(row.GridHeight * 1.15);
            end
        end
        
        if ( Width % 2 ~= 0 ) then
            Width = Width + 1
        end
        if ( Height % 2 ~= 0 ) then
            Height = Height + 1
        end
        print("width and height",Width,Height)
        local WrapX = true;
    
        return {Width = Width, Height = Height, WrapX = WrapX,}
    end
    
    If I comment this function out, that I use to expand the map, then your additional sizes work. The problem is that PW kinda needs the extra size in here. A PW 'Massive' map needs to be 15 percent more massive... What to do?
     
  12. cephalo

    cephalo Chieftain

    Joined:
    Jul 26, 2007
    Messages:
    1,983
    Location:
    Missouri, USA
    It's funny YnAMP's sizes are NOT working for me.
     
  13. pokiehl

    pokiehl Chieftain

    Joined:
    Mar 5, 2017
    Messages:
    340
    Don't go changing your mod on account of mine, cephalo. I'll just use standard map sizes or some other workaround. I didn't mean to rain on the parade of this mod's release with this issue.

    Although I am flabbergasted why YNAMP works for me and not you with PW6...So weird man.

    @Gedemon - Any idea what's going on here? :p
     
  14. pokiehl

    pokiehl Chieftain

    Joined:
    Mar 5, 2017
    Messages:
    340
    In other news I am getting some awesome scripts...I love the lakes and the bays and seas...

    Very happy!

    20181013151459_1.jpg
     
  15. cephalo

    cephalo Chieftain

    Joined:
    Jul 26, 2007
    Messages:
    1,983
    Location:
    Missouri, USA
    Woah, that's a nuts map.
     
  16. pokiehl

    pokiehl Chieftain

    Joined:
    Mar 5, 2017
    Messages:
    340
    I think I've got a lead on fixing the custom map size problem. Scrum Lord (who made Got Lakes? for Civ 6) was having the same problem in this thread and posted this some months ago:

    So it seems to be that the hash value for custom map sizes is nil. No one responded to him, but I know he fixed the issue eventually. I peeked at Got Lakes and saw this function:

    Code:
    function InitWorldSizeInfo()
        -- Set the global world size info based on user inputs such as climate.
        --
        -- Returns:
        --   scaled world size info 
        local worldSize = ScriptData.worldSize;
      
        -- Note: Map.GetMapSize() returns -1 in this function.
      
        --g_iW, g_iH     = Map.GetGridSize();
        --print("Map Grid Size: " .. CoordString(g_iW, g_iH)); 
        --print("Map Size hash: " .. worldSize);
      
        -- Look for the world-size hash in game info.
        local mapSizeType = nil; -- Default val in case hash not found.
        for row in GameInfo.Maps() do 
            if(worldSize == row.Hash) then
                mapSizeType = row.MapSizeType;
                break;
            else
                --print("Map Size is NOT " .. row.MapSizeType .. " with hash " .. NonNilStr(row.Hash));
            end
        end
      
        if (not mapSizeType) then
            print("Got an unidentified map size.");
            -- Just return and let map-gen calculate world size info based on grid size.
            return;
        end
      
        print("Map Size is " .. mapSizeType);
      
        -- Standard sizes mapped to GL's linear scale for map sizing.
        local standardSizes =
        {
            [MAPSIZE_DUEL]      = {width = 44,  height = 26},
            [MAPSIZE_TINY]      = {width = 60,  height = 38},
            [MAPSIZE_SMALL]     = {width = 74,  height = 46},
            [MAPSIZE_STANDARD]  = {width = 84,  height = 54},
            [MAPSIZE_LARGE]     = {width = 96,  height = 60},
            [MAPSIZE_HUGE]      = {width = 106, height = 66}
        };
      
        local enlargedSizes =
        {
            [MAPSIZE_DUEL]     = {width = 60,  height = 38},
            [MAPSIZE_TINY]     = {width = 74,  height = 46},
            [MAPSIZE_SMALL]    = {width = 84,  height = 54},
            [MAPSIZE_STANDARD] = {width = 96,  height = 60},
            [MAPSIZE_LARGE]    = {width = 106, height = 66},
            [MAPSIZE_HUGE]     = {width = 116, height = 74},
        };
      
        local gridSize = standardSizes[mapSizeType] or nil;
        if (not gridSize) then
            print("Got an identified but unexpected map size.");
            -- Let map-gen calculate world size info.
            return;
    I know very little about Lua, but it seems the choice bit here is

    " -- Look for the world-size hash in game info.
    local mapSizeType = nil; -- Default val in case hash not found."

    Does that give you any idea at all about how fix it? I'm not sure how to apply his "fix" to PW6 to test it. If you want to see the entire mod for context, here is the link to it on CivFanatics: https://forums.civfanatics.com/threads/got-lakes-map-script.623726/
     
    Last edited: Oct 13, 2018
  17. cephalo

    cephalo Chieftain

    Joined:
    Jul 26, 2007
    Messages:
    1,983
    Location:
    Missouri, USA
    Thanks for looking into it pokiehl, I will get to it when I can. Tomorrow I have to go to the pumpkin festival.

    EDIT: I wonder if it's possible to supply the proper hash with a custom size setting. Maybe there's a hidden xml attribute.
     
    pokiehl likes this.
  18. BlameOmar

    BlameOmar Chieftain

    Joined:
    Oct 13, 2018
    Messages:
    2
    Gender:
    Male
    Jungles on grassland tiles tend to starve the band around the equator of production (if it's not wet enough, it tends to be desert). This could probably be fixed with another mod, but it would be nice if by default jungles forced plains like vanilla. There also seems to be a dearth of plains tiles in general, although this is going off a rather small sample size. I'll take a look at the code after I play on a few more maps.
     
  19. cephalo

    cephalo Chieftain

    Joined:
    Jul 26, 2007
    Messages:
    1,983
    Location:
    Missouri, USA
    This is actually a very easy change to make. In Civ5 I just couldn't stand the way jungle looked on plains. I needed my jungles to look wet, like it rained a lot. I will experiment with this and certainly I can make it a tweakable option.

    Philosophically, do you think it's a bad thing to starve the equator of production?

    Civ is funny in this regard. In the real world, what would be the difference between plains and grassland? I picture plains as being more dry, but really its an absurd differentiation.

    EDIT: Annnnd... welcome to Civfanatics!
     
  20. HiddenNinja

    HiddenNinja Chieftain

    Joined:
    Oct 14, 2018
    Messages:
    1
    This timing is amazing. Decided to play a game of Civ6 after a 6 month break and randomly thought about looking up PerfectWorld (my fav Civ5 map script); what a great decision. I claim spidey-sense.
    Thanks for the amazing script!
     
    cephalo likes this.

Share This Page