Map Script Compatibility with Mac Warlords

I let the file above . But in fact , there is still the problem ... i will recheck the script !

i think the problem can be cause by that -> this the two specific modules that are called when the script is initialized and i try to remove them :

Code:
load_module encodings.latin_1
load_module encodings.string_escape

I will check to see for what encodings.string_escape is made for ( i don't know :confused: ) ... i think that when i will achieve to remove , there should be no more problem .

Tcho !
 
I tried the last version you posted. I put it in PublicMaps alone, with no other map scripts.

It crashes repeatably the fifth time I select it. I've repeated this three times, and a few more times trying different indentation methods. It always crashes on the fifth time I select Sto_Fractal_Test. In between the five Sto_Fractal_Test selections I select Archipelago.

Note that this is similar to my first test, when I went though the maps in turn, and it gave an error *after* the fourth map I tried, when I was going back to the main menu from the generated map, and then it crashed when I selected the fifth map script.

I have tried using all tabs and all spaces for indentation, and it made no difference.

The debug log still includes:

load_module encodings.latin_1

The fact that it fails predictably after five initialisations seems to indicate that there is either a memory leak problem in Python - it does its own garbage collection, so this should not be an application coding issue; or maybe some global variable is not being initialised properly, and after five runs it reaches an invalid value.
 
Ok , i will try to remove the encoding problem first -> then check all globals ( check if there are list or python bound function ) .

And i will post a file after i can reach that !

Tcho !
 
For "load_module encodings.latin_1" , i've understood that it's called when i get description of resources , etc for the menu listing ... i need probably to use unicode or something like that (i don't understand encoding problems) and that's a ton of work . that will not be ready soon . So i decide to force the import into the script instead of letting civ4 do it .

For "load_module encodings.string_escape" , it's called between two functions ( getNumCustomMapOptions() and getNumCustomMapOptionValues()) . And i don't understand what this module is made for ( i'm not very good in english , especially programming vocabulary . And i found no good french python documentation ) ... So i also decide to force the import into the script instead of letting civ4 do it .

So , i post a test file with all global values rewritten . That can be a good test to see if the problem comes from global values !?

Tcho !
 
It still crashes the same after five cycles, swapping between the Sto_Fractal_Test map and the standard Archipelago map. I have no other maps installed.

encodings.latin_1 is not loaded now, but encodings.string_escape is still loaded.

Have you tried this same test on a PC?
 
I had not check it , because i was always test every map in a loop withoup any problems ... but now as you said, i've just made a test and get the same error after 20 switch ... So i'm terribly sorry to have borrowed you because there is the same bug with windows . :blush: :blush: :blush: :blush: :blush: :blush:

But I will rewrite all the scripts without description or another language . I can't do anything else . But i think the problem will still not be solved probably ... that must be something with memory allocation or size ( probably because i get the bug many times after you , and never get it before ).

Thanks for all , and i apologize for all this wasted time :blush:

Tcho !
 
No problem. It's all good fun :). And if it takes four times as long to trigger the problem in Windows, then it may not be a real problem for PC users. Presumably no one has complained before.

It might be a good idea to work out how your text editor is mixing up the spaces and tabs, though. Just to eliminate any lingering doubt on that issue.
 
No , i've never got any feed back on this bug ( there is not a lot of player with my scripts ) ... I will still test a script without encoding , but i have no hope . I add a note to clarify this in the thread .

Thanks again , tcho ! :)
 
For infos , the problem is solved : there is no solution !

First , i try to understand why there is "load_module encodings.string_escape" . this is a special module that translate special character like "\n" and "\\" used into path strings . As i took the function to smart map , i try to get the bug without success with smart map. then remove all special character from my script and also get the bug .

Second , i test this file . I simply add that to the original fractal map :

Code:
def getNumCustomMapOptions():
	return 90

def getCustomMapOptionName(argsList):
        return unicode(CyTranslator().getText("TXT_KEY_MAP_SCRIPT_LANDMASS_TYPE", ()))

def getNumCustomMapOptionValues(argsList):
        return 80

def getCustomMapOptionDescAt(argsList):
        return unicode(CyTranslator().getText("TXT_KEY_MAP_SCRIPT_SNAKY_CONTINENTS", ()))

def getCustomMapOptionDefault(argsList):
        return 40

And i get the bug , ( any other sto_script removed before ) ... So there is no ambiguity , civ4 is not made to load a map with many buttons and selections .

Tcho !

Edit : why didn't i begin by doing that :crazyeye:
 
Well done :goodjob: I wonder what limit you're hitting in Civ4 with this level of complexity ... It might be worth asking Firaxis what the limits are.
 
It might be worth asking Firaxis what the limits are.

Thanks , Great idea :) , I'm curious to know the limit . I remember that the game crash if there is 100 buttons or more , but perhaps there is a way to remove the bug if i know the limit .

Do you know where to contact Firaxis for this kind of questions ? ( i've searched and hesistate to ask at <support> , this is the only thing i've found )

Tcho !
 
You could try a PM to Sirian (Bob Thomas). He is with Firaxis and wrote a lot of the original map scripts. He also wrote the map reference in the C&C forum.
 
Thanks , i'll do that now ! :)
 
For infos , Sirian can't help ... So i tried to get the limit of the number of button and selection you can have -> there is no limit . Whatever the number of buttons you have , they should be saved somewhere (or because of an incrementation ) , after a number of time you load a script with any number of buttons the game crash . I get the bug with smartmap ( 15 buttons , after selecting it about 140 times ) . By making many tests , it seems to have a limit of the number of buttons you can load by launch of civ IV ( looks like : (nbButtons^0.8) * const ) .

Tcho !

Edit : replace nbButtons^1.2 by nbButtons^0.8

Edit : It seems that waiting between selection change the max number of time you can select a script ... but i get the bug even after waiting 10 min between two selection .
 
[PS] Here is the Terra script I modded. It works without Python errors.

It's just possible that the barbs and animals are controlled from the modded CvGameCoreDLL file. If that is the case then this aspect of the maps will fail on a Mac.

Just downloades and tried the thingy, works well as far as I can see, and boy, will this change experience of playing the game (finally). And yeah, I completely overlooked these (as the reason why reacting now). And AlanH....U did it again...(oops).

Maybe make this one a sticky so that people can find it easier?
 
All changes made by AlanH for Mac compatibility has been included in these scripts . there is most of public maps generator in customized .

Tcho ! :)
 
Well done ... thanks for supporting the Civ-underdogs :)

I had a look at the script, and I *think* the modified version I've attached here ought to work on both Mac and Windows, including saving settings. I have only changed the Windows registry stuff a little, so I don't think it should be broken, but I can't test it as I don't have Civ4 for Windows. If it works, this will remove the need to maintain two versions.
 

Attachments

  • Planet_Generator_0_45.py.zip
    18.1 KB · Views: 64
Great, I will install Civ4 in Vista and will check that out too (I am worried about the way Vista user profiles differ from XP). I also had somewhere 0.45 version with working oasis support, but haven't released it yet, so I am hoping to dig that out too :).

Also, I think a have made quite efficient engine here for writing map scripts, so if anyone is interested on building something new on top of it, I can help with documentation.
 
Top Bottom