Skip to content

Send game save file on connect. #45

@DominicMaas

Description

@DominicMaas

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions