I have sorted out what the problem is that caused the crashes in the two games I mentioned in post #714. On SMALL and TINY maps there is not always sufficient room for the generation of North and South Europe plots, even on STANDARD sized maps there is not always room for North Europe and South Europe plots to be added.
There seems to be a constraint that limits the width of the East and West Europe plots to 6 tiles width, then if there is sufficient room, North and South Europe plots are painted to the map, but in all my testing, the volume of North and South Europe plots is never very high.
The default world sizes are defined in CIV4WorldInfo.xml in the GameInfo folder. A tiny map is set by default to 22x36. On a blank map this would ostensibly generate a Europe plot patten like this:
However, this is not the case. The East and West Europe plots will swell towards the center of the map. The East Europe plots are given the heaviest weight, so if there is not land obstruction, they may stretch and fill all the way to the west side of the map. This effect can be seen on maps generated by the Firaxis Caribbean map script. So a map with no landmasses would very likely be filled with nothing but East Europe plots, which clearly demonstrates the bias of the original programmer to create maps that replicate European colonization of the Western Hemisphere.Spoiler :
Anyway, the random generation of the land mass + the 4 spaces from land default for all Europe plots can result in maps that do not have sufficient room for North and South Europe plots on any map generated by any map script, so this is not a problem limited to FaireWeather, but includes even Firaxis map scripts like A_New_World. I tried several of the other map scripts at Tiny and Small sizes and the same holds true with them all at those sizes.
Altering the proportions of the default map sizes actually seems to exacerbate the problem. When I added:
to A_New_World.py, the maps generated were square, but the North and South ends of the land mass swelled disproportionately to fill an even larger area at the edges of the map, rather than remaining narrow. (Code borrowed from Planets.py, thank you Orlanth)Code:def getGridSize(argsList): "Override Grid Size function to make the maps square." grid_sizes = { WorldSizeTypes.WORLDSIZE_TINY: (8*4,8*4), WorldSizeTypes.WORLDSIZE_SMALL: (10*4,10*4), WorldSizeTypes.WORLDSIZE_STANDARD: (13*4,13*4), WorldSizeTypes.WORLDSIZE_LARGE: (16*4,16*4), WorldSizeTypes.WORLDSIZE_HUGE: (20*4,20*4) } if (argsList[0] == -1): # (-1,) is passed to function on loads return [] [eWorldSize] = argsList return grid_sizes[eWorldSize]
My working supposition is that the issue is the fractal world generator in the Firaxis Python files being geared to create land masses vaguely shaped like the the isthmus between North America and South America with portions of those continents at either end. Basically making two triangles like arrowheads touching at the tip with a heavy randomization of the peripheral edges.
My working conclusion is that every time a map is generated with a map script it is largely a "luck of the draw" whether that map will have sufficient room for North and South Europe plots.
def afterGeneration():
gc = CyGlobalContext()
mmap = gc.getMap()
em.initialize()
europeEast = gc.getInfoTypeForString("EUROPE_EAST")
europeWest = gc.getInfoTypeForString("EUROPE_WEST")
for y in range(mc.height):
for x in range(mc.width):
i = GetIndex(x,y)
plot = mmap.plot(x,y)
plot.setEurope(-1)
if plot.isWater() == False:
continue
if x > mc.width/3 and x < 2 * mc.width/3:#dont penetrate past 1/3 of map
continue
if y < 4 or y > mc.height - 5:#make room for ice
continue
landFound = False
for yy in range(y - mc.distanceToEurope,y + mc.distanceToEurope + 1,1):
for xx in range(x - mc.distanceToEurope,x + mc.distanceToEurope + 1,1):
ii = GetIndex(xx,yy)
if ii == -1:
continue
newPlot = mmap.plot(xx,yy)
if newPlot.isWater() == False:
landFound = True
if landFound == False:
em.europeMap[i] = 1
europeAreas = Areamap(mc.width,mc.height,False,False)
europeAreas.defineAreas(europeMatch)
## europeAreas.PrintAreaMap()
## print "east europe = %d" % (europeEast)
## print "west europe = %d" % (europeWest)
#find europe areas that touch the map east/west edges
x = 0
xx = mc.width - 1
europeAreaIdList = list()
for y in range(mc.height):
i = GetIndex(x,y)
ii = GetIndex(xx,y)
if em.europeMap[i] == 1:
areaID = europeAreas.areaMap[i]
AppendUnique(europeAreaIdList,areaID)
if em.europeMap[ii] == 1:
areaID = europeAreas.areaMap[ii]
AppendUnique(europeAreaIdList,areaID)
for y in range(mc.height):
for x in range(mc.width):
i = GetIndex(x,y)
plot = mmap.plot(x,y)
areaID = europeAreas.areaMap[i]
if IsInList(europeAreaIdList,areaID):
if x < mc.width/2:
plot.setEurope(europeWest)
else:
plot.setEurope(europeEast)
Yes I'm willing to work on that scenario. But I think I'll wait till the AI can use the routes properly.
Not sure how the silk route feature fits in to the Europe map? Maybe it could be available at the Caspian sea or somewhere nearby it.
I think that portion of the code, or at least the X,Y portions, simply enforces the self.distanceToEurope option so that the East and West Europe plots don't swell to fill the map as they normally would.Good news I worked it out so that I can assign Land Routes to the North and South edges.
Also, Good news for the FaireWeather map. I discovered what was erasing the North and South trade routes. In C++ there is a function that is called that runs a python function, it is the "afterGeneration();"
Below is the Faireweather Map afterGeneration code. I simply prevented the python for using this function and the Map assigned Trade Routes (Europe tiles) as I wanted them too. I am not sure exactly what the below code does for the FaireWeather script as I haven't had time to check it all out.
if y < 4 or y > mc.height - 5:#make room for ice
continue
I think that portion of the code, or at least the X,Y portions, simply enforces the self.distanceToEurope option so that the East and West Europe plots don't swell to fill the map as they normally would.
The function:
is the part that "erases" the East and West Europe plots from the top and bottom of the map allowing the formation of a band of water Ice Feature across the top and bottom of the map for "cosmetic" purposes. I have the Ice Generation portion remarked out on my system, I have no use for purely cosmetic featuresCode:if y < 4 or y > mc.height - 5:#make room for ice continue
In the most recent update of M:C - when they do appear on the map, I noted that the North and South Europe plots take a different PlayerColor than East and West Europe. So I can easily tell if they are being generated or not. That was very helpful in determining what was to source of my crash problem. So thank you for doing it that way, Kailric
def afterGeneration():
gc = CyGlobalContext()
mmap = gc.getMap()
em.initialize()
europeEast = gc.getInfoTypeForString("EUROPE_EAST")
europeWest = gc.getInfoTypeForString("EUROPE_WEST")
europeNorth = gc.getInfoTypeForString("EUROPE_NORTH")
europeSouth = gc.getInfoTypeForString("EUROPE_SOUTH")
for y in range(mc.height):
for x in range(mc.width):
i = GetIndex(x,y)
plot = mmap.plot(x,y)
plot.setEurope(-1)
if plot.isWater() == False:
continue
if x > mc.width/3 and x < 2 * mc.width/3:#dont penetrate past 1/3 of map
continue
## if y < 4 or y > mc.height - 5:#make room for ice
## continue
landFound = False
for yy in range(y - mc.distanceToEurope,y + mc.distanceToEurope + 1,1):
for xx in range(x - mc.distanceToEurope,x + mc.distanceToEurope + 1,1):
ii = GetIndex(xx,yy)
if ii == -1:
continue
newPlot = mmap.plot(xx,yy)
if newPlot.isWater() == False:
landFound = True
if landFound == False:
em.europeMap[i] = 1
europeAreas = Areamap(mc.width,mc.height,False,False)
europeAreas.defineAreas(europeMatch)
## europeAreas.PrintAreaMap()
## print "east europe = %d" % (europeEast)
## print "west europe = %d" % (europeWest)
#find europe areas that touch the map east/west edges
x = 0
xx = mc.width - 1
europeAreaIdList = list()
for y in range(mc.height):
i = GetIndex(x,y)
ii = GetIndex(xx,y)
if em.europeMap[i] == 1:
areaID = europeAreas.areaMap[i]
AppendUnique(europeAreaIdList,areaID)
if em.europeMap[ii] == 1:
areaID = europeAreas.areaMap[ii]
AppendUnique(europeAreaIdList,areaID)
for y in range(mc.height):
for x in range(mc.width):
i = GetIndex(x,y)
plot = mmap.plot(x,y)
areaID = europeAreas.areaMap[i]
if IsInList(europeAreaIdList,areaID):
if y < mc.height/2:
plot.setEurope(europeNorth)
if y > mc.height/2:
plot.setEurope(europeSouth)
if x < mc.width/2:
plot.setEurope(europeWest)
else: x > mc.width/2:
plot.setEurope(europeEast)
As much as I like the look of FaireWeather maps, I'm starting to think it isn't worth the time-investment to continue debugging FaireWeather when so many of its functions were developed with only the vanilla DLL in mind. I was looking at the threads of the latest iteration of the Civ 4 version of the script... a month of real life man-hours spent to refine and debug it for Civ 4 BTS....
With my level of understanding, it could take 6 months >_<
def afterGeneration():
return
#Haha, you can't change Europes any more
gc = CyGlobalContext()
mmap = gc.getMap()
em.initialize()
Here is where I say DOH!!!!
*head-desk*
I thought of trying something like that, but I didn't think it would work >_<
Edit... well, on my system, this is what I got from making that change:
I get maps like that from many map scripts.
I don't think it's the map script or the code that is at issue. Not with so many map scripts doing the same thing. I have to believe that it's a system related issue. I see a call to "CvPythonExtensions" in most map scripts and I don't have a Python file with that name anywhere on my system. I wonder if that is the cause of the issue
if IsInList(europeAreaIdList,areaID):
if y < mc.height/2:
plot.setEurope(europeNorth)
if y > mc.height/2:
plot.setEurope(europeSouth)
if x < mc.width/2:
plot.setEurope(europeWest)
else: x > mc.width/2:
plot.setEurope(europeEast)
I don't know what is causing it, but now all map scripts, even the ones included in the latest update no longer generate North or South Europe plots when I use them in M:C
The same map scripts generate North and South plots in vanilla and in simple mods, even the modified FaireWeather, but none of them will work as they did 48 hours ago in M:C. I think my system is possessed by unclean spirits... when all else fails, blame it on Voodoo....
I have this idea where we expand map sizes and divide the globe into East and West Hemispheres where what we have now is the West Hemispheres. Then in order to travel to the East Hemisphere you have to unlock some Tech/Event. Until then just like now you will only see a wall of black and can not cross it. Once the East is unlocked you can then venture across to the "New World". This "New World" will have been developing its Civilizations the whole game up to this point and the new comers will have to contend with the Natives there. However, there will be lots of land and new resources to exploit and riches to bring back to the old world. Hmm, I don't know, sounds awful familiar... was this a movie or something?
New plot type
Unit require owner to have a specific civic to enter
There has been talk about something similar for col2071 and there are several ways to do something like that.
- New plot type
Unit require owner to have a specific civic to enter- Plot lock
Almost the same as #1- Chance plot type
Change impassable plot to normal water- Civ solution: shallow water (min dist to land) until certain tech
I would like something a bit more creative than this
I like to support the idea of an expanding map, but I'm not sure which way would be best.
I like this! But do you have map upside down? Don't you mean that we are now playing eastern hemisphere and across the ocean waits the western hemisphere?
Really I would like the M:C to expand to the renaissance era. Even thought it really sounds like deja vu somehow