Replies: 4 comments
-
Hi, thanks for the compliments :)
So, this is expected to be honest, the way to develop dealing with a fully deterministic game state is way different from the usual. This is true for any rollback netcode implementation. Also, this example was made based on a monogame sample, so I reused a bunch of code from it here, and as they are different "engines" with different approaches it ends up helping this being less Godot idiomatic in the end.
This is inevitable, as I said, programming a game with online requirements is way different from the usual approach. But, you don't need to make it exactly the same as this example, you need a deterministic game state and handle the inputs through Backdash, I choose to completely separate the game date from the game objects/nodes because I believe it is easy to handle. Look at the Backdash developer guide to understand better how it works.
I disagree with this, I am making a game from scratch, and, indeed, a bunch of features of the engine are not applicable, there is another whole bunch of features that are, which make it worth using. And, to be fair, for this kind of requirement this would be true for almost any game engine. |
Beta Was this translation helpful? Give feedback.
-
Thanks. I think that it very good advantage, that godot (and many other engines) have nodes\components. And necessity to divide game representation and network state is breaking "LEGO approach". Why not to make more deep integration to Godot using special nodes? I don't expect you to have to do this integration yourself, but don't you think this would be the better approach? I imaging some network-specific nodes as child nodes. And when network game starts, it will pass through nodes and collect all network entities. Then it will broadcast all network entities to other players. Determinism is good but I am not sure that it is 100% necessary. I understand that there could be some problems with floating point number physics or something like this. And this will result in more sync events. But we can make some threshold of difference in some parameters to prevent most sync events. And game will be playable in network. I experimented with this and it worked in some scenarios, which can be enough for many developers. |
Beta Was this translation helpful? Give feedback.
-
It is possible, would be necessary to build a layer
For Godot? Yes, but not necessarily for other engines that use .NET
This is not how rollback netcode works, no entity is broadcasted, only the player inputs, please check the introduction docs
It is, with 100% sure, as the only synchronized data are the inputs, the game state must be the same when applying the same set of inputs |
Beta Was this translation helpful? Give feedback.
-
Thanks, cool.
It is a blanket term. Most real games has some data which has to be broadcasted from server. For example - some random events on server which spawn new entities.
That's right. The other way is to synchronize entities time to time. I think we understand each other. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
This sample looks nice, but it looks very different of normal Godot project. Let me try to explain.
Some developer started creating some game. He moved step by step, using bunches of tutorials for Godot.
He added ships with collision and physics, added shooting.
Then he tried to add multiplayer, using Godot replication API like here described: https://godotengine.org/article/multiplayer-in-godot-4-0-scene-replication/
And then he found that ships doesn't move properly in multiplayer with higher network latency. He did some investigation and clarified that he need make network predictions (based on latency) and rollbacks on desync.
And for now Godot doesn't suggest any comfortable solution for this. There is no even physics saving and restoring and other problems.
One solution is to use Backdash similar to this sample. But it means to take very big part of existing code and throw to the trash bucket.
That's the reason why it is very uncomfortable to use it in Godot.
But if someone will create new game from scratch, based on Backdash, it would be better not to use Godot, because many Godot features will not be applicable.
P. S.: Backdash and this Sample is awesome. Really good code quality. You are probably true expert in this field of software development.
Beta Was this translation helpful? Give feedback.
All reactions