CitiesSkylinesMultiplayer / CSM

Source code for the Cities: Skylines Multiplayer mod (CSM)
https://citiesskylinesmultiplayer.com/
MIT License
725 stars 99 forks source link

Automatically sync map (Download save file) #131

Closed Techial closed 5 years ago

Techial commented 5 years ago

It would help being able to sync the map with the client either automatically when you join server & desync or manually.

A lot of the time I play multiplayer games with a friend I have to go and zip up my save file for him to download and rejoin.

Server could pause, save map and send it every time a client joins or desyncs?

EDIT: save files are located in %localappdata%\Colossal Order\Cities_Skylines\Saves as .crp files they do update immediately as you save them, and are not blocked by the process. Meaning you can move them, read and etc while the game is running.

Techial commented 5 years ago

Would it be able to check if desync has happened by sending back and forth MD5 data from gamesave? Or a hashed key made by an algorithm that takes into account trees, buildings (put down by player) and so on?

kaenganxt commented 5 years ago

Closing this as a duplicate of #45, but thanks for the additional ideas! It is already one of our top priorities.

About detecting a desync: I think that checking the hash of the gamesave won't work because we don't need to sync everything perfectly (some things can happen only on the hosting player).

There are already some checks (like an id reserved twice) to make sure the game state is still valid, but I think we will expand this in the future.

DominicMaas commented 5 years ago

Thanks for the extra info!