Skip to content

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:

@xezno xezno added this to the Initial Release milestone Mar 4, 2023
@xezno xezno linked an issue Mar 4, 2023 that may be closed by this pull request
6 tasks
@xezno xezno mentioned this pull request Mar 9, 2023
14 tasks
@xezno xezno mentioned this pull request Apr 5, 2023
@xezno xezno closed this Apr 5, 2023
@xezno xezno reopened this Apr 5, 2023
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