Getting custom map scripts into MP

Dale

Mohawk Games Developer
Joined
Mar 14, 2002
Messages
7,848
There is a way to make your custom map scripts compatible for MP, and to show up in the list of available maps in any MP game.

In your GetMapInfo() function simply add the following line:

Code:
SupportsMultiplayer = true,

Save the map script in your "My Games" maps folder and it will be available. NOTE: all players in the game must have the map script.
 
All the players need the map script? What for? It's not created on one machine and then sent? What happens if 2 players have different versions of the script? Or if the script uses some random seeds that use time or whatever which is not reproducible on different machines?
 
Don't ask questions, just trust me on it. Ok? :)
 
All the players need the map script? What for? It's not created on one machine and then sent?
No, the seed is generated for the MP game and both (all) clients generate the map using the same seed. This means the network traffic is a bunch of numbers (the seed) and not a large file (the full map).

What happens if 2 players have different versions of the script?
It won't work, I believe you won't even be able to connect to the host player if you don't have the same version (probably simple file CRC like steam uses for several things). The file name is only part of it, if they don't match it's like you don't even have it.

Or if the script uses some random seeds that use time or whatever which is not reproducible on different machines?
See above :)

It's very similar to how it worked in Civ 4 as far as I can tell so if you encounted problems with Civ 4 MP support due to using the wrong method for generating random numbers it'll happen in Civ 5 too.
 
Back
Top Bottom