Announcement

Collapse
No announcement yet.

Anyone done much with maps?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Anyone done much with maps?

    I was very positively impressed to note that maps are set up in Python. That makes it easy to make at least some world designs, but I'd love some documentation.

  • #2
    Maps are not done in Python, they are done in text files and created with the World Builder, the BMP tool or a text editor. See the topped threads in this forum for documentation.
    Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

    Comment


    • #3
      Is he referring to map scripts?

      Comment


      • #4
        Ah ok, good point...

        Map scripts are rather complicated. They are well documented though, just open them and have a study the existing code. It requires some knowledge of OO programming and math to write completely new scripts though, so it's not exactly for the faint of heart. Modifying existing scripts may be easier, but I honesty haven't had time to try it yet. All this power comes at a price...
        Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

        Comment


        • #5
          I don't think I'd call them well documented. There's some maps that provide a custom map option. Must I leave stub functions in for the menu options there if I want to remove the option?

          And yes, I'm talking about the scripts. I didn't know there was anything else! I am more interested by the scripts; they look like a viable way to build custom-random maps.

          One obvious question, is there a set of options to generate_map that eliminates ALL water? water_percent=0 isn't it.

          Comment


          • #6
            I confess myself moderately stumped. I'm trying to do an "all-friendly-terrain" map (no ice, no desert) and I'm failing.

            What I would like to do is inherit the default terrain generator, then simply modfy the resulting map, but I can't seem to figure out how to do this except by duplicating the code. But I don't want to do that; I want to use the standard terrain generator and then just tweak the output. Is this possible?

            My idea was this:

            Code:
            def generateTerrainTypes():
              NiTextOut("Generating Terrain (Python Lakes2) ...")
              terraingen = TerrainGenerator()
              terrainTypes = terraingen.generateTerrain()
              map = CyMap();
              for x in range(map.getGridWidth()):
                for y in range(map.getGridHeight()):
                  p = map.plot(x, y);
                  t = p.getTerrainType();
                  if (t == tPlains):
                    p.setTerrainType(tGrass, false, false);
                  if (t == tSnow or t == tDesert or t == tTundra):
                    p.setTerrainType(tPlains, false, false);
              return terrainTypes
            However, this has no effect.

            tSnow, etc, were set previously:

            Code:
            gc = CyGlobalContext()
            tDesert = gc.getInfoTypeForString("TERRAIN_DESERT")
            tPlains = gc.getInfoTypeForString("TERRAIN_PLAINS")
            tTundra = gc.getInfoTypeForString("TERRAIN_TUNDRA")
            tGrass = gc.getInfoTypeForString("TERRAIN_GRASS")
            tSnow = gc.getInfoTypeForString("TERRAIN_SNOW")
            I don't know what I should be doing; I'm guessing that

            Comment


            • #7
              I'm stumped as well.

              I'm trying to get the bmp converter to work, but each time I save the file and load up the game, as soon as it starts it says I have been defeated and the game ends. I don't get it.

              I followed the tutorial Rhye wrote and changed nothing at all except I used a basic bmp I made instead of the one he included, and his works, mine doesn't. It makes no sense.
              Captain of Team Apolyton - ISDG 2012

              When I was younger I thought curfews were silly, but now as the daughter of a young woman, I appreciate them. - Rah

              Comment


              • #8
                I would like to know how to increase the % of land mass for a given map size. I have tried several things but nothing worked.

                I guess I'll have to wait for the SDK since I'm no programmer.

                Comment


                • #9
                  Ah-hah! Found the right tool for the job. afterGenerate().

                  I'm getting the hang of this a bit. I think.

                  Er. If someone from Firaxis will post and say they won't sue, I'd be happy to post some detailed discussion of how the map generator works. I don't have it all figured out, but I have a lot figured out.

                  Comment


                  • #10
                    If you haven't found it already, the "Civilization 4\Assets\Python\EntryPoints\CvMapScriptInterface.p y" file lists the functions (and the order they are called in) for map creation.

                    Bh

                    Comment


                    • #11
                      Oh, that helps a lot.

                      Comment


                      • #12
                        Originally posted by seebs
                        Ah-hah! Found the right tool for the job. afterGenerate().

                        I'm getting the hang of this a bit. I think.

                        Er. If someone from Firaxis will post and say they won't sue, I'd be happy to post some detailed discussion of how the map generator works. I don't have it all figured out, but I have a lot figured out.
                        It should not be an issue - its not like it is a trade secret or anything like that. Furthermoer, the game was marketed as being a modman dream (not in those exact words however).

                        Comment

                        Working...
                        X