Multiplayer in Godot 4.0: Scene Replication (Part 1)
godotengine.org
godotengine.org
- open source,
- easy to learn and
- crowd funded.
By being open source, anyone can have access to it. By being easy to learn, most people who try it can do something cool with little effort. By being crowd funded, developers can work on it for as long as enough people are using.Remember yesterday PHP 8.1 was released. Much the same story but in entirely different parts of the same spectrum.
this is quite important - a good, smooth learning curve for a product (whatever it is) is important to adoption.
Being able to get up and running, and get a simple scene/game working is really great, but you also need power for the power users. Luckily for godot, since is pluggable, you can actually make it as advanced as you wish, and also have others contribute.
I hope godot success - it's one of the best open source engines out there.
I've worked on games where the entire team was using Krita for 2D assets and I feel like we were actually more productive than when everyone was on Photoshop. Outside of photography, I don't think I've even touched Photoshop in a few years now - Krita can even open PSD files.
Seriously, too many games nowadays focus on just the "visual wow" with millions of vertex + raytracing, they fall flat in terms of gameplay.
If you're half-clever with your 3D knowledge (don't render an entire world in 1 mesh), Godot 3 is perfectly fine. The tooling of UE4 will win any time if you want to do open world though. Even though I've made a pretty convincing prototype, _huge_ blade-runner kind of world in Godot with flying cars; so it's all technically possible.
In other words, if you don't need consoles (and frankly as an indie you don't want to deal with the big boys), Godot is perfect.
Just don't hope you'll live off your game any time soon though, the indie market is utterly algorithm driven and therefor fucked. The learning experience and the joy of using Godot however, is well worth learning game development with.
Godot and Blender are really becoming some of the best in class in their own field.
There are some weird things here and there, but so far the pros far outweigh the cons and I see myself prototyping ideas quickly in Godot.
The discourse on HN is even better. I come here every day for insight and context and encouragement.
Thank you Godot, thank you HN, no waiting required.
https://github.com/godotengine/godot-proposals/issues/2333
A big challenge is that the current architecture requires a custom build of the engine that builds the whole executable as a .NET app that just happens to execute all the C++ engine code rather than a regular executable that integrates other languages as a plug-in. In theory, this is fine, and maybe ideal for modern .NET, but I don’t think there is much institutional support within the project for making special exceptions for C#. I believe they also no longer have the source of external funding (maybe MS?) that funded the original mono integration.
So, from my perspective, C# development has languished and might not make the leap to Godot 4. It appears to suffer from a chicken/egg problem where a majority of current users simply prefer GDScript. I think it would be a loss to drop C#, however, as I’m sure there are developers out there (myself included) who would prefer a modern .NET integration over mono and are holding out to see what the future holds.
And I'm still curious if it's possible to make a low latency first person shooter.
I'm not confident it's currently possible to implement network prediction, even with gdnative.
I wish there was an equivalent to ogre3d, this engine was lightweight, flexible and easy to use... Urho3d is nice but the samples are verbose and hairy.
helath = value.decode_u8(4)
helath -> healthAs someone who's currently doing a "roll your own" networking scheme with Rust and a bit of Bevy's ECS, it's interesting to see how engines do it. Much more "automatic"!
"when the server adds the scene to the SceneTree, it automatically sends that information remotely. Each connected client will then instantiate the scene automatically,"
What information does it send remotely? Is it all the 3D info for every object? "Put a cube at 10,10,10, with scale 1, rotation 0 etc"?
"The RPC system will also work appropriately for the nodes spawned this way, so you can easily integrate state synchronization with messaging."
What is "messaging"? Why is integrating state synchronization with messaging a useful thing?
For most games, no. For big 3D virtual worlds, yes. This is a big difference between games and "metaverse" systems. Most games use a big bulk asset download, rather than dynamically loading assets is needed. What to load next at what level of detail given the current location of the camera has to be well handled to provide a good user experience. It's similar to the problems of displaying a partially loaded web page, only in 3D in real time with far more content.
The sentence right before your first quote answers your question -
"Note that the client code doesn't "instantiates" the scene explicitly. However, since the scene is marked for replication [... your quote]"
In this case its sending the scene for the clients to instantiate.
They gave an example of messaging as well - RPC.
And for messaging, I wrote "Why is integrating state synchronization with messaging a useful thing?" but I guess it would have been clearer if I asked "Why is integrating state synchronization with RPC a useful thing?"... what are some examples of what that's used for?
I believe you want state sync and RPC integrated because you want a meaningful order to events.
Say a bomb exploding is done via an RPC call for legacy reasons and now position is via state sync. Youd want to ensure the explosion was ordered in respect to position updates to ensure it goes off in the right place.
What you usually want is pools.
Is this the kind of pool you're referring to? Just curious, I don't know a lot of gamedev.
Also to note, Tarkov has several inherent design problems.
For a tutorial like this limiting the number of concepts to throw at the reader is better than making sure its 100% production ready. I would be worried if reading a post like this was all you need for your entire games netcode in prod.
I always take the second approach and wrap it in a class [1].
[1] https://github.com/ZuBsPaCe/godot-base-code/blob/main/Script...
see https://stackoverflow.com/questions/2151084/map-a-2d-array-o...
Edit - got me SMH
I had, had the WORST time completing a game project. I had gotten into the headspace where I thought I couldn't finish it (and, as for a large, wholly original project, maybe I can't).
I just decided to make a small match three game with minimal assets and minimal menu. Looks terrible. Unpublishable. But I finished it! I know how to plan it out, I know the warts that are involved, and I know how to get it on the platform I want should I want to publish.
There's something to be said for finishing an MVP of even a minimal project.
Anytime I’m talking with someone at a meet-up who wants to learn gamedev, I advise them to make pong and add a new mechanic to it. If they can’t learn to do that, the odds of them making the game they envision is extremely low.
I’ve been in the industry for twelve years and have done the indie thing very successfully, and I still have low confidence when it comes to making a game that is any good. I keep waiting for it to get easier, but every time it does your ambitions increase to match.
I say possibly worst advice because there have been times, and I'm currently in such a time, where I'm working on a fundamentally flawed idea but can't give it up in favour of something else. I need to finish it and finish it well, even if it feels undoable.
I suggest Ludum Dare nd GMTK jam. But there are many jams going on check out itch.io/jams
Having seen how the sausage gets made has made the lose the interest of being part of such industry.
If you want to have fun doing games, try some retro game development, homebrew, or game jams.
Naturally there are studios where the above doesn't apply, sadly they are still mostly the exception, on an industry that carries crunch time as medal of honor.