Regenerate Map in Multiplayer

CrazyCanuck87

Chieftain
Joined
Oct 29, 2007
Messages
42
I play MP with a couple of friends quite frequently, usually on a LAN. In the interest of playing a game that everyone is going to enjoy, we often restart quite a few times to make sure that everyone has reasonable starting land. In MP, the Regenerate Map option in the menu is disabled, which makes sense, since you wouldn't want someone to be able to regenerate the map in online games whenever they didn't like their land. However, for local games with three friends who can agree whether or not to regenerate, it would save a lot of time to have a Regenerate Map button, rather than quitting to the main menu, creating a new game, and setting everything up again...

I've done a small amount of Civ4 modding, but I don't know where to start to add the Regenerate Map button to Multiplayer games. Any ideas?
 
I wouldn't have any idea, but it dawned on me that there is a CyMap.rebuild() method in the Python API:
VOID rebuild (INT iGridW, INT iGridH, INT iTopLatitude, INT iBottomLatitude, BOOL bWrapX, BOOL bWrapY, WorldSizeType eWorldSize, ClimateType eClimate, SeaLevelType eSeaLevel, INT iNumCustomMapOptions, CustomMapOptionType aeCustomMapOptions)
According to the documentation it is "used to initialize the map during WorldBuilder load". Now, even if invoking this method in a game actually worked, you'd still have to be able to access the Python Console. I bet its disabled also in MP games. :p

I guess you could have a mod where a custom hotkey calls this method, but there would probably be immediate Out Of Sync issues! So all other players would still have to re-join the game.

This is just me speculating, so...
 
I found an easy way to add the button, but I foresee some potential problems, as Baldyr suggested. All I did was edit line 2012 of CvDLLButtonPopup.cpp to remove !(GC.getGameINLINE().isGameMultiPlayer()). Unfortunately, I'm alone right now, so I can't test it fully, but I started a LAN game by myself, and Regenerate Map was available as an option. It regenerated the map successfully, but I'm worried that there might be problems when playing with other people.

Will their maps be updated too? Will there be synchronisation problems? I will of course test this as soon as possible, but if anyone with more DLL modding experience than me can warn me of potential problems, ideally with ideas for solutions, that would be great!


UPDATE: I tested with another player, and it was more or less as expected: my map regenerated, but the other player's map did not, and the game went out of sync. She was able to quit and rejoin, on the new map, which is faster than both of us quitting and creating a new game, so it's better than what we had for the problem we were trying to solve, but still not ideal.

Does anyone know of a way to send the new map over when it is regenerated, perhaps by calling some of the functions used when the game first launches?
 
All I did was edit line 2012 of CvDLLButtonPopup.cpp to remove !(GC.getGameINLINE().isGameMultiPlayer()).

Excellent!

The lack of even having an *option* to enable this feature in multiplayer was, IMO, a huge (and rather insulting) oversight.

I suspect it would prove fruitless to attempt to "fix" the OOS issue, simply because the game itself provides no mechanism to deal with "ordinary" OOS except for the offending player(s) quitting and re-joining.

Still, this is a huge, huge, huge improvement over the vanilla build. Starting a new multiplayer game is so absurdly tedious w/out this feature I'm amazed anybody plays it at all.

I tried to similarly enable the worldbuilder in multiplayer by eliminating the same condition from the canDoControl function definition, and while the button appeared, it seemed to provide no functionality. Perhaps the worldbuilder itself performs a similar check? I will poke around later...
 
Enabling WB in MP is suicidal.
None of the functions in WB is MP compatible.
Nice necromancy skills though.
 
So what is the point of resurrecting a dead and buried thread just to teach others how to screw your MP game?
 
No thread is ever dead. Why are you complaining about it?
 
If it is meaningful, by all means talk about it.
What is the purpose of a thread that teach you how to screw your game?
 
If it is meaningful, by all means talk about it.
What is the purpose of a thread that teach you how to screw your game?

I find it hard to regard anything which empowers the user (player) as "screwing".

I play multiplayer games with folks who insist on having a "good" starting spot. (The mere existence of this thread indicates I am not alone.)

In single player, this is easily resolved by using "regenerate map", and occasionally making a tweak using the worldbuilder.

I see no fundamental reason why multiplayer should be any different. Thanks in part to our Canadian friend, it's actually very easy to get halfway there. I was merely reporting my failure to get all the way there.
 
After playing CIV4 BTS for a lot of years, i tried to search if there is a recent solution to this problem. But the closest thing i found to a solution is on this thread, the one provided by CrazyCanuck87. I cant make it work though.
Has anyone found another way in the meantime?
 
Good question. This would be an awesome feature to include in mods.
I am playing a 6 continent game with a friend vs. 16 AIs.
It is time consuming to switch 16 open slots to AI every time we have to reset it.
I wish there was a checkbox to keep them as AI, defaulting to Open (as normal) if left unchecked.
 
Back
Top Bottom