Skip to content

Multiplayer Scripting

Valk edited this page Feb 3, 2023 · 28 revisions

This page is a work in progress

Thread Safety

If you are the one hosting the game server, there are 3 threads, the game client thread, the game server thread and the Godot thread. If you are a client joining a server, there are only 2 threads, the game client thread and the Godot thread.

Directly accessing variables from other threads is a violation of thread safety so rather Concurrent Queues should be used to communicate between them.

Violating thread safety can lead to frequent random game crashes with usually no errors in console making these types of issues extremely hard to track down when they start acting up.

Ignoring Opcode Log Messages

Specific opcode messages can be ignored if you don't want to be spammed when debugging a specific part of the netcode.

In the future a checkbox option will be added to completely turn opcode logging off.

image

Clone this wiki locally