Map size

AdelineJ

Warlord
Joined
Apr 28, 2012
Messages
288
Location
France
Hello !
How do you create a map size ? I tried to change CIV4WorldInfo.xml :
Code:
<WorldInfo>
			<Type>WORLDSIZE_GEANT</Type>
			<Description>TXT_KEY_WORLD_GEANT</Description>
			<Help>TXT_KEY_WORLD_GEANT_HELP</Help>
			<iDefaultPlayers>15</iDefaultPlayers>
			<iUnitNameModifier>0</iUnitNameModifier>
			<iTargetNumCities>6</iTargetNumCities>
			<iNumFreeBuildingBonuses>7</iNumFreeBuildingBonuses>
			<iBuildingClassPrereqModifier>100</iBuildingClassPrereqModifier>
			<iMaxConscriptModifier>75</iMaxConscriptModifier>
			<iWarWearinessModifier>-50</iWarWearinessModifier>
			<iGridWidth>40</iGridWidth>
			<iGridHeight>25</iGridHeight>
			<iTerrainGrainChange>1</iTerrainGrainChange>
			<iFeatureGrainChange>1</iFeatureGrainChange>
			<iResearchPercent>150</iResearchPercent>
			<iTradeProfitPercent>30</iTradeProfitPercent>
			<iDistanceMaintenancePercent>100</iDistanceMaintenancePercent>
			<iNumCitiesMaintenancePercent>20</iNumCitiesMaintenancePercent>
			<iColonyMaintenancePercent>30</iColonyMaintenancePercent>
			<iCorporationMaintenancePercent>50</iCorporationMaintenancePercent>
			<iNumCitiesAnarchyPercent>6</iNumCitiesAnarchyPercent>
			<iAdvancedStartPointsMod>120</iAdvancedStartPointsMod>
		</WorldInfo>
and I changed Publicmaps\Earth2.py :
Code:
def getGridSize(argsList):
    "Enlarge the grids! According to Soren, Earth-type maps are usually huge anyway."
    grid_sizes = {
        WorldSizeTypes.WORLDSIZE_DUEL:      (10,6),
        WorldSizeTypes.WORLDSIZE_TINY:      (15,9),
        WorldSizeTypes.WORLDSIZE_SMALL:     (20,12),
        WorldSizeTypes.WORLDSIZE_STANDARD:  (25,15),
        WorldSizeTypes.WORLDSIZE_LARGE:     (30,18),
        WorldSizeTypes.WORLDSIZE_HUGE:      (40,24),
		WorldSizeTypes.WORLDSIZE_GIANT:      (45,30)
    }
...
 def generatePlotsByRegion(self):
        # Sirian's MultilayeredFractal class, controlling function.
        # You -MUST- customize this function for each use of the class.
        #
        # The following grain matrix is specific to Earth2.py
        sizekey = self.map.getWorldSize()
        sizevalues = {
            WorldSizeTypes.WORLDSIZE_DUEL:      (3,2,1),
            WorldSizeTypes.WORLDSIZE_TINY:      (3,2,1),
            WorldSizeTypes.WORLDSIZE_SMALL:     (4,2,1),
            WorldSizeTypes.WORLDSIZE_STANDARD:  (4,2,1),
            WorldSizeTypes.WORLDSIZE_LARGE:     (4,2,1),
            WorldSizeTypes.WORLDSIZE_HUGE:      (5,2,1),
			WorldSizeTypes.WORLDSIZE_GIANT:      (5,2,1)
            }
but I got a map without seas, just with any lakes...
Thanks !
AdelineJ
 
WORLDSIZE_GEANT or WORLDSIZE_GIANT?
 
Oupss, I was wrong. I modified but same result :
 

Attachments

  • CIV4_pb_carte.png
    CIV4_pb_carte.png
    39.8 KB · Views: 75
Yes, it seems that it is a bit more complicate than that.

I refer you to this post. It only took me 4 hours to find it...

In some Map scripts (as this one), you can't just add your new WorldSize, you have to type WorldSizeTypes.NUM_WORLDSIZE_TYPES instead.

Tested, it works!
 
I don't understand. If you create two new sizes, you have to add two lines WorldSizeTypes.NUM_WORLDSIZE_TYPES: (38,24) ? but in that event, you don't define the two different sizes, no?
 
I don't know. Test it.

By the way, if you work on Map Scripts and anything else in Python, you'd better get Python exceptions enabled. Before finding the post in question, I had Python errors each time I was trying to create the map in the game. Not always very explicit but at least telling you that something is going wrong and giving you a hint at the right direction.

If you don't know what I mean by enabling Python exceptions:

under My Documents/My Games/Beyond the Sword folder, you have a file called CivilizationIV.ini. Inside you should find something like this:

; Set to 1 for no python exception popups
HidePythonExceptions = 0

The 0 setup will bring popups ingame if there are Python problems.
 
The WorldSizeTypes.X values are just numbers. They are defined in the DLL and exported to Python. You can use the next numbers just by directly specifying them. The numbers match the order of the sizes in the world info file, starting at 0, so if you add two they would be sizes 6 and 7. (You should only add them at the end so that everything still matches up for the ones that are defined.)

There may be some issues with using more map sizes than the DLL defines. On the other hand, I seem to recall the History Rewritten mod has bigger maps and it has no custom DLL (since it is Mac compatible, which can't use them).

I think that most of the mods that add new map sizes also have a custom DLL which also increases the limit of how many civilizations you can have in a game to something over 18 and as long as they are doing that they also generally add WorldSizeTypes definitions for the extra map sizes.
 
I was able to add 2 new mapsizes to C2C without changing the DLL or doing anything other than what you did, so my guess would be that it is a mapscript-specific issue.
 
You will also have to DEFINE your worldsize at the very top of the mapscript. An example from my own mod in the spoiler:

Spoiler :
EARTH2 NOTES

This is based purely on the Terra script, albeit with a lot more similarity
to Earth in terms of landmasses. Rocky Climate and Normal Sea Levels strongly
recommended for maximum earthiness.
'''

###=== Kjotleik == KLPC World Sizes == 1 of 3 == Begin ===
WorldSizeTypes.WORLDSIZE_BIG=WorldSizeTypes.WORLDSIZE_HUGE+1
WorldSizeTypes.WORLDSIZE_MEGABIG=WorldSizeTypes.WORLDSIZE_BIG+1
WorldSizeTypes.WORLDSIZE_GIGABIG=WorldSizeTypes.WORLDSIZE_MEGABIG+1
WorldSizeTypes.WORLDSIZE_SUPERBIG=WorldSizeTypes.WORLDSIZE_GIGABIG+1
WorldSizeTypes.WORLDSIZE_HYPERBIG=WorldSizeTypes.WORLDSIZE_SUPERBIG+1
WorldSizeTypes.WORLDSIZE_ULTRABIG=WorldSizeTypes.WORLDSIZE_HYPERBIG+1
###=== Kjotleik == KLPC World Sizes == 1 of 3 == End ===

def getDescription():
return "TXT_KEY_MAP_SCRIPT_EARTH2_DESCR"

def isAdvancedMap():
"This map should show up in simple mode"
return 0

...

Text in red above needs to be inserted at that location in the mapscript. Change it to whatever you call your worldsize. If you have only one size named GIANT, make it -

WorldSizeTypes.WORLDSIZE_GIANT=WorldSizeTypes.WORLDSIZE_HUGE+1

I don't know why copy/paste makes it look like a space between letters in the word WORLDSIZE inside spoiler-tags. It is not supposed to be a space there. It is written in ONE WORD:

W O R L D S I Z E (with NO spaces between the letters).





Hope this helps a bit.



Yours Sincerely

Kjotleik of Norway :)
 
Top Bottom