What is "network_synchronizer" and how to use it in MMORPG (Godot 4 + Django)? #116
Replies: 3 comments 1 reply
-
Please tell me, did I write everything correctly about “network synchronizer”? 😊 |
Beta Was this translation helpful? Give feedback.
-
Please tell me, I think many novice users of Godot may be interested in the question of whether there is any difference in the “Prediction and Reconciliation” strategy, which is mentioned in the description of Netfox, and the “Prediction and Rewinding” strategy, which is mentioned in the description of “network_synchronizer” ?
|
Beta Was this translation helpful? Give feedback.
-
@AndreaCatania Hello, please tell me if I wrote the information about "network synchronizer" correctly? |
Beta Was this translation helpful? Give feedback.
-
Hello! I thank the developers for creating "network_synchronizer", as far as I can imagine it is a powerful and interesting product.
But I have not yet fully understood how "network_synchronizer" can be used 😊 I will try to describe what I understood and ask my questions about how network_synchronizer can be used in the MMORPG that we are creating on Godot 4 + Django, which is an analogue of EVE Online. I am sure that such information will be useful to people who will research this project 😎
What is "network_synchronizer"?
The main idea of network_synchronizer is to ensure efficient synchronization of game actions and states between clients and the server. One of the key features is
Action
, which allows you to execute code synchronously on all clients. For example, this can be used to synchronize actions with objects (like opening/closing doors) or to transfer information between the client and server, such as signaling loss of health or other game events.To register actions, use the
NetworkSync.register_action
method, which allows you to specify an object, a method that will be executed when the action is activated, and a method to encode the action parameters into a compact format to optimize the use of network bandwidth. A client can trigger an action usingNetworkSync.trigger_action_by_name
, which allows the action to be executed synchronously across all clients.In addition to the basic functions, network_synchronizer offers additional features such as Server validation to prevent cheating, the ability to wait for server confirmation before performing an action on the client (Wait server validation), and specific actions for individual clients (Specific peer action and Server only trigger, which improves the security and flexibility of network synchronization in multiplayer games.
"network_synchronizer" is not a replacement for Godot server?
Yes, network_synchronizer does not replace the Godot server, but is an additional component in the technology stack. In the context of Godot game development, the main purpose of network_synchronizer is to ensure efficient and synchronized processing of events and actions between clients and the server, using an action prediction and rollback model. This is critical for real-time multiplayer games that require a high degree of coordination and consistency of game state between all participants.
Godot server, in turn, is a more general concept that describes the server side of your game, which handles game logic, network requests, and other server processes. It is responsible for game world management, authentication, data storage, and other tasks necessary to support multiplayer interaction in the game.
Using network_synchronizer with a Godot server will allow you to effectively synchronize in-game actions and states between clients and the server, while providing optimization and anti-cheat capabilities. This combined solution provides greater control and security for developers looking to create robust and scalable multiplayer games powered by the Godot engine.
What is Prediction & Rewinding networking model?
The Prediction & Rewinding model is a common approach in real-time multiplayer game development that helps minimize latency and improve the gaming experience by predicting player actions on the client side and adjusting those predictions on the server if necessary.
Prediction is a technique in which the client side of the game predicts the outcome of the player's actions without immediate confirmation from the server. For example, when a player moves, the client immediately displays that transition on the user's screen without waiting for confirmation from the server. This creates the illusion of instant response, even though the movement data still needs to be confirmed by the server.
Rewinding is the process by which the server checks the predictions made by the client and, if a discrepancy is detected, adjusts the state of the game on the client to match the actual state on the server. If the prediction was incorrect (for example, due to a collision that did not exist on the client), the server sends correction information to roll back the changes and synchronize the game state on the client with the actual state on the server.
In the context of network_synchronizer, Prediction & Rewinding networking model is used to ensure synchronization of actions and states in a multiplayer game. Clients predict the results of their actions and display them immediately, resulting in fast response and smooth game mechanics. At the same time, the server regularly checks and adjusts these predictions, ensuring that all players have the same and up-to-date view of the game world.
This approach allows you to create multiplayer games with low latency and high interactivity, making the gameplay smoother and more enjoyable for players, even with high network latency. It is especially important for games that require quick response and precision, such as shooters, racing and sports simulations.
How can I connect "network_synchronizer" to my Godot project?
"network_synchronizer" is created in C++, does NOT use GDExtension, but is implemented as a C++ module that requires Godot to be recompiled.
Here is the official documentation on how to do this
https://docs.godotengine.org/en/stable/contributing/development/core_and_modules/custom_modules_in_cpp.html
???Or is this link more correct???
https://docs.godotengine.org/en/stable/contributing/development/core_and_modules/binding_to_external_libraries.html
Where can I see documentation and examples?
For a true samurai, documentation is an unnecessary barrier to learning the real truth. But still, for those who are not looking for the “real truth”, there is a small amount of documentation:
Wiki with a little bit of how to use and how to debug https://github.com/GameNetworking/network_synchronizer/wiki/Actions
Old example project implemented on an early version of Godot 4 https://github.com/GameNetworking/example-project
Most of the documentation can be found inside C++ classes
https://github.com/GameNetworking/network_synchronizer/blob/main/scene_synchronizer.h#L48
https://github.com/GameNetworking/network_synchronizer/blob/main/doc_classes/GdSceneSynchronizer.xml#L6
What projects use "network_synchronizer"?
Previously mentioned Old example project https://github.com/GameNetworking/example-project
Halcyon zero (Pahdo labs) is an isometric Action RPG set in an ethereal, anime-inspired world https://www.halcyon-zero.com/
The Mirror is a next-gen game development platform designed to empower developers and artists with real-time, limitless creativity https://www.themirror.space/
Are there alternatives to "network_synchronizer"?
There is no direct alternative to "network_synchronizer", but on the Godot Discord server, some users (who have not yet learned the zen of the samurai) claim that it is easier to use the netfox addon kit https://github.com/foxssake/netfox
Netfox addons are implemented in GDScript and can be easily installed in Godot. It should be noted that “network_synchronizer” is implemented in C++ and has better performance. These solutions also have a number of other differences.
Beta Was this translation helpful? Give feedback.
All reactions