Multiplayer Out of Sync with custom map Script...

Refar

Deity
Joined
Apr 10, 2005
Messages
4,608
When trying to use a custom map script in MP (Direct IP) we have a Out of Sync right when the game starts.

I am quite sure it is caused by a map script (which i writen - its in my sig). I do however not have the slightest idea how...

Perhaps someone has some general pointers ? (Not that i mind specific pointers :D).

My guess is, its because my script customizes the starting plots (All in Old World etc.) Still its a bit weird, since the script is working clean in Singleplayer... and i kind of assumed, that in MP the Host generates the map the same way as it is in SP...
 
Everyone generate the script in MP games . The same process with SP games .I think i've got all possible OOS with map script .. perhaps can you post your script and i'll take a look at it . You can also learn a lot about OOS in this thread .

Tcho !

Edit : ok got the script . i take a look
 
I've seen nothing suspicious in particular , but i've not read all the script in deep .

_ i've not taken a look in detail with your globals . But don't forget that they are not reinitialized when you start a new game . For an example you have an empty list where you append some values . the values are still here if you generate the script a second time . That may cause an OOS if one of the player have generate the map before the MP game . But i don't think your globals are involved .

_ when you use setPlotType you must follow it with CyMap().recalculateAreas() . If not the areas are not well calculated and perhaps may be different with the two MP players . You can encounter some problems with assign Starting plots also.

_ You should try to copy paste all the functions in the one script just for a test .

Tcho !
 
Thanks. I am suspecting the starting plot stuff. I am going over the tutorial you pointed to for now, and will try some stuff... I will probably be back with more questions then :D
 
It seems spliting up the script in two files causes the trouble.

On the Host machine the Library file (Util) could not be found, causing the script to fail. It does the same thing when using the script in SP on the Host's computer as it seems .

Its weird however, since on the client (my) computer the game seems to know where to find the file.

Does Civ4 have a customiseable search path to look for files ? I have no idea how to explain this kind of different behaviour...

Edit.: I have a idea... On my computer the BTS User Data is stored on the default path "My Documents/My Games/Beyond The Sword/". My friend is running a localized Windows, so the Path deviates. I know he does not usually have problems runnning mods - the game seems to know where to find the user data (I assume it is reading out th Registry to know where "My Documents" is). But perhaps it just assumes the default 'english' path when loading Python libraries ?

Its kind of a long shot, since i never heard/read something like this here. But it seems to be the only difference between our setups...
 
Edit.: I have a idea... On my computer the BTS User Data is stored on the default path "My Documents/My Games/Beyond The Sword/". My friend is running a localized Windows, so the Path deviates. I know he does not usually have problems runnning mods - the game seems to know where to find the user data (I assume it is reading out th Registry to know where "My Documents" is). But perhaps it just assumes the default 'english' path when loading Python libraries ?

I don't think this is the problem because you can play in SP games . So CivIV is able to find the module in SP game . The map module is loaded when you enter in the selection screen ( if not already initialized with your last game ) , so you should have a python exception when you enter the selection screen or during initialization . That's very strange .

The only thing i think of is :

_ the simply way : make only one script

_ try to use the function new.classobj(..) so when you initialize the script , a new class object is created in your script module . But don't ask me how to do :crazyeye: . ( i found no example in the python forum )

Tcho !

Edit : all module , class , function are built up and refer to an object located in the memory . So it doesn't matter how the object is build up ( windows , mac os are a good example of civIV with different path )
 
Merging it into one file solved the issue. Thanks for your input @Sto.
 
Top Bottom