Websocket Client-Server Framework Spike #1198
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Multiplayer Framework Spike: Websocket / Authoritative Server on Lazy Client Implementation
This PR contains multiple elements:
/multiplayer-spike
containing a barebones server and client that meet the spike requirements as specified by the ticketTest Stack
Included is a basic client-server setup that is meant to represent the framework that would be integrated into Synthesis. It pipes client inputs, simulates the world and physics on the server, and broadcasts the authoritative state to all clients on a fixed basis.
The spike server features:
The spike client features:
This spike does not feature:
Quick Setup
Online Test
An instance of the spike is live here until July 15th.
Testing the spike locally is very simple.
Prerequists:
Installation
cd multiplayer-spike npm install
Run
The server will start on port
3000
by defaultIndependent Tests
To verify the functionality, carry out the following tests:
Multi-Client Stability
Input Latency
Connection Health
Measured Metrics
All metrics observed on Windows
Performance
Memory
Based on these metrics, an implementation that uses authoritative server is probably plausible. It's also possible that other implementations including WebRTC are less memory intensive while being less performant.
Integration into Fission
These are thrown together code fragments that could serve as a basis for hooking this implementation into Synthesis.
System Integration
The multiplayer server should probably be integrated as a new system in Fission:
Jolt Integration
Replace the test physics in the spike with Jolt physics. This is easily the hardest part of this effort, unless I'm missing something, which I probably am. As an example, however, to sync the robot body:
MatchMode Integration
Thanks to the MatchMode system, we can hook some features easily, and add the following to make it actually functional:
Input System Integration
To allow inputs from Fission to work correctly through the server:
Global Configuration Changes
Changes required to support the server in a production environment
Dependencies
Modifications to
package,json
Build Config
Modifications to
vite.config.ts
Considerations and Optimizations
Beyond the missing features, these are things that should probably be implemented before multiplayer goes public.
Server Optimizations
Security
Workflow
Production
This concludes the Spike PR.
Do not merge
.