Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send game save file on connect. #45

Open
8 of 11 tasks
DominicMaas opened this issue Nov 4, 2018 · 5 comments
Open
8 of 11 tasks

Send game save file on connect. #45

DominicMaas opened this issue Nov 4, 2018 · 5 comments

Comments

@DominicMaas
Copy link
Member

DominicMaas commented Nov 4, 2018

Introduction

When a player connects to the server, both server and client should be paused. Once paused, the server needs to grab a copy of the save game (this can be done with raw IO requests if there is no exposed method), and send it to the client (via TCP to ensure nothing is lost). Once the client receives the world, it needs to then load it (somehow) and unpause the game. To prevent the user from unpausing the game during this process, a giant loading screen will be displayed above all content.

Key Points

  • Loading screen that takes up entire window (above all content), replaces the current connection status info.
  • On client connect, pause the game for everyone, and show a loading window for everyone (client connecting).
  • Locate the game save on the server, either Cities: Skylines exposes a path to the game save, or we can locate it manually (set folder, and the gamename save which should be exposed in the API).
  • Send the game save over to the newly connected client, entire save must make it to the client (can be in multiple packets).
  • A client needs to be able to download a save game, put it in the save folder (named "multiplayer" or something) and then needs to load the game. I'm not sure if this can be done when your within a game already, or if we have to quit the game, join the new world and unpause (all while still connected).
  • Allow multiple players to join simultaneously (Requires some logic for showing/hiding the overlay for all players)
  • Maybe don't block the whole game while a player is joining (We could only pause the game and queue packets for player interactions on the joining client. I don't think it's possible to let the game run because we don't sync everything perfectly but rely on the simulation threads to be in sync)
  • Enable the host to reject join requests
  • Allow joining over the Steam friends menu
  • Implement multiplayer buttons into Escape menu
  • Add sync command that updates all clients with the world. Can be used when the game starts becoming unplayable.
@JABirchall
Copy link

Would it be possible to just send the game state to the client instead of the whole save. I beleive the server should be responsable to keeping the save file and keeping the clients in sync with that save.

@DominicMaas
Copy link
Member Author

It's more of a starting off point, the save is only synced on first connect (too much information to sync manually), after the save is sent over, the client and server will keep each other in sync.

@DominicMaas
Copy link
Member Author

Lets use the branch game-load-save as a starting off point. There's some good notes by root#0042 located here: https://github.com/DominicMaas/Tango/wiki/Development-Notes

So it's easier to understand what's happening, if you have performed some work on this feature, feel free to assign yourself to this issue.

@DominicMaas
Copy link
Member Author

Code changes are being tracked in #140

@slash-under
Copy link

Hello there. While playing on a shared network, I saw some issues that appear to be related to network corruption of the save game, in that it happens intermittently when loading. Is there any existing check-summing or hashing of the save game during the initial transfer process?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants