Skip to content

Commit

Permalink
Refine multiplayer sync proposal for Godot by removing details on sha…
Browse files Browse the repository at this point in the history
…dow scene tree and web server integration, focusing on synchronization protocols for node scene trees.
  • Loading branch information
fire committed Jan 27, 2025
1 parent 7b2147d commit 628062c
Showing 1 changed file with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions decisions/20250126-multiplayer-sync-between-godot-instances.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

## What is the context of the proposal?

We aim to enhance multiplayer capabilities in the Godot Engine by synchronizing node scene trees across different instances. We never RPC; instead, we only sync property data and do network events. Additionally, we intend to create a shadow scene tree to generate asynchronous glTF 2.0 binaries served via a web server.
We aim to enhance multiplayer capabilities in the Godot Engine by synchronizing node scene trees across different instances.

## What is the problem being solved?

Currently, synchronizing complex node scene trees in multiplayer scenarios within Godot is challenging. There's a need for an efficient method to ensure consistency across all client instances. Moreover, generating async glTF 2.0 binaries for web servers requires a reliable shadow scene tree mechanism.
Currently, synchronizing complex node scene trees in multiplayer scenarios within Godot is challenging. There's a need for an efficient method to ensure consistency across all client instances.

## Describe how your proposal will work with code, pseudo-code, mock-ups, or diagrams.

Expand All @@ -21,24 +21,13 @@ The proposal involves implementing a synchronization protocol that mirrors the n
sync_scene_tree(child)
```

- **Shadow Scene Tree:** Creating a duplicate of the main scene tree to handle asynchronous operations like glTF 2.0 binary generation.

```gdscript
var shadow_tree = duplicate_scene_tree(main_tree)
func generate_async_gltf():
Thread.new().start(shadow_tree.export_gltf())
```

- **Web Server Integration:** Serving the generated glTF binaries through a web server for external access.

## What are the benefits of the proposal?

This proposal ensures consistency by providing all multiplayer clients with a synchronized view of the scene. Performance is enhanced by offloading heavy operations to a shadow tree, preventing main thread blockages. Scalability is facilitated through reliable synchronization of multiplayer environments. Flexibility is achieved by enabling asynchronous processing and external access to generated assets via a web server.
This proposal ensures consistency by providing all multiplayer clients with a synchronized view of the scene. Performance is enhanced by offloading heavy operations to a shadow tree, preventing main thread blockages. Scalability is facilitated through reliable synchronization of multiplayer environments.

## What are the downsides of the proposal?

There is increased complexity from implementing synchronization protocols and shadow trees. Resource consumption may rise due to maintaining shadow trees and processing synchronous operations. Latency issues might occur with high-frequency updates.
There is increased complexity from implementing synchronization protocols. Latency issues might occur with high-frequency updates.

## What are the alternative proposals?

Expand All @@ -48,7 +37,9 @@ There is increased complexity from implementing synchronization protocols and sh

## When might the proposed solution be used rarely or not at all?

In single-player environments or where scene complexity is minimal, the synchronization overhead might be unnecessary. Projects not requiring asset exports would not benefit from the shadow scene tree approach.
In single-player environments or where scene complexity is minimal, the synchronization overhead might be unnecessary.

We do not need to maintain a shadow tree for web server gltf-binary export, since it's only another synced gltf instance.

## Is this a V-Sekai core responsibility, and should it be done by us?

Expand Down

0 comments on commit 628062c

Please sign in to comment.