SS3D
SS3D copied to clipboard
Proper server client connection/disconnection
Summary
Currently, Disconnecting and connecting clients to the server is an unclear process full of issues. A few are :
- Client crashing when the server is off.
- Client can't join again if disconnected even if the app was closed.
- Inability to properly close and reopen the server.
Apart from the obvious issue, it's also an issue for running multiple play tests in a row.
Another related issue is that systems loading order isnot properly defined, currently making us rely on tricks (wait one frame and other terrible ways of dealing with it).
Goal
This task also properly defining the connection/disconnection process.
What is expected :
- A clear graph showing the connection/disconnection process, (methods involved, timing) it must include :
- How does the client connect to server ?
- How does the client embark in the game ?
- How is the client state restored if they connect back ?
- What systems loads in which order on start ?
The second part of the issue would be to actually implement the suggested process. Something we'd like to achieve is answering yes to the following question : Can I open server -> join with client -> embark with client -> leave with client without quitting app -> close server -> open server again -> join again with client -> and find eveything in the same state ?
Of course, we don't expect this to anticipate over new features added, but we do expect some mechanisms put in place that would help for future features, as well as it working for the current features in game.
For the client saved state, think about container's content on the player, health state ... there's many thing to save. Using an interface on all script that require saving is probably the best way to go, the interface should contain at least Save and Load methods.
For the load order of systems, it should all be centralised, such that we can easily change it if needed. The system should allow waiting for a system to be properly set up before loading a new one, and eventually be able to define load order of subsystem as well.
All of this should run with no game's breaking exceptions.
@stilnat Is this still open?
@HammadRafique29 Hello there, yes, but if this is your first contribution to SS3D, please go for a simpler task first, this one ask for some experiences with the code base to be handled, it's a hard one.