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

(Draft) Implement Networking using GameNetworkingSockets and Quake 3-like snapshot system #53

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

xezno
Copy link
Member

@xezno xezno commented Mar 4, 2023

Note - this is a draft pull request and isn't ready to be merged yet.

Description

This pull request implements networking functionality for our game engine using the GameNetworkingSockets library for transport and a snapshot system similar to Quake 3's architecture. It includes the following features:

  • GameNetworkingSockets transport for reliable and efficient data transfer
  • Snapshot system for sending/receiving game state updates
  • Prediction algorithms to minimize lag
  • Lag compensation for more accurate gameplay
  • Graceful handling of disconnections and reconnections
  • Debugging and profiling tools to help diagnose networking issues

Various low-level engine changes have also been made - these are now merged into master as part of #58.

API Changes

Networking

Synchronisation
To synchronise a property or field over the network:

[Sync] public string MyNetworkedString { get; set; }
[Sync] public string MyOtherNetworkedString;

Method Stripping
To strip methods:

[Event.Tick, ServerOnly]
public void ServerTick()
{
    DebugOverlay.ScreenText( "Server Tick..." );
}

[Event.Tick, ClientOnly]
public void ClientTick()
{
    DebugOverlay.ScreenText( "Client Tick..." );
}

How to Test

To test the networking functionality, do the following:

  1. Clone this branch and build the game engine
  2. Run the game engine and connect to a server or host a game
  3. Play the game and observe the networking behavior

Related Issues

This pull request is related to the following issues:

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

Successfully merging this pull request may close these issues.

Tracking Issue: Networking Implementation Allow passing managed callbacks to native code through interop
1 participant