DennisSmuda / godot-chunking-system

Demo on how to make a 2D grid-based map with FastNoise and infinite movement in every Direction. Uses multithreading to load/unload chunks of the map! 🌎
https://dennissmuda.com/blog/godot-chunk-loading-tutorial
17 stars 2 forks source link

Can this work for Godot 4+ games with multiplayer and open world chunks? #7

Closed WithinAmnesia closed 8 months ago

WithinAmnesia commented 8 months ago

Test chunks link: https://github.com/WithinAmnesia/ARPG/discussions/15

I'm trying to find a way to seamless load and unload chunks for a 2D multiplayer game project to make an open world with a working server using Godot 4.2.1.NET.

How can this work for multiplayer and what is needed for this to potentially work? What options can be used for chunk loading and unloading seamlessly in Godot 4.2.1.NET? Please give feedback.

DennisSmuda commented 8 months ago

I've never done multiplayer to be honest.

Initial thoughts: I guess the server holds the whole state of the world. instead of loading a new chunk via theeads, or rather in addition to that, I would think each player instance could "query" the server for chunks.

The code here is only loading/onloading chunks, you'd need the networking layer on top I'd imagine

WithinAmnesia commented 8 months ago

Here is an update since I last posted. https://jonathaneeckhout.itch.io/jdungeon For the goal right now it is easy to play this but imagine it has seamless chunk loading and unloading. As instead of the black world boundary a new chunk loads in seamlessly. What are your suggestions and thoughts?

Update: https://github.com/WithinAmnesia/ARPG/tree/ARPG-Infinite-Worlds Here is the 128x128 with 32x32 pixel tile chunk to test.

My initial testing seems to feel even faster combat with the 128x128 chunk. This 128x128 chunk has the same amount of entities as the 256x256 chunk. For I moved all of the entities over into the 128x128 chunk. This 128x128 chunk is a good test for using the Infinite-Worlds using the BinarySerializer for Godot 4.2+ from Theraot: https://gist.github.com/theraot/31515e28e2d8bfea33f6c6d5bcd852f6 . There needs to be some testing how to make the chunks seamlessly load and unload. https://gamedev.stackexchange.com/questions/209002/looking-for-help-godot-4-multiplayer-seamless-open-world-chunks

WithinAmnesia commented 8 months ago

I've never done multiplayer to be honest.

Initial thoughts: I guess the server holds the whole state of the world. instead of loading a new chunk via theeads, or rather in addition to that, I would think each player instance could "query" the server for chunks.

The code here is only loading/onloading chunks, you'd need the networking layer on top I'd imagine

The downloadable demo has a server that runs the world entities that needs to be kept working ya its an extra layer alright lol.

"I guess the server holds the whole state of the world. instead of loading a new chunk via theeads, or rather in addition to that, I would think each player instance could "query" the server for chunks." With the update and potential solution by Theraot what are your thoughts on how this could work? The demo has a download just for testing since the update: https://github.com/WithinAmnesia/ARPG/tree/ARPG-Infinite-Worlds

WithinAmnesia commented 8 months ago

I've never done multiplayer to be honest.

Initial thoughts: I guess the server holds the whole state of the world. instead of loading a new chunk via theeads, or rather in addition to that, I would think each player instance could "query" the server for chunks.

The code here is only loading/onloading chunks, you'd need the networking layer on top I'd imagine

May I please ask you more questions? Your chunk system is beating many other candidates for a great multiplayer implementation candidate. We have a chance at infinite worlds for multiplayer for everyone and for it to be forever free. We are so close I must make good of the opportunities and find a way so everyone can win and be forever free.

For example this is my current short list of working Godot 4.2.1.NET seamless chunk systems. Your is so far beating a lot of them and I may need to ask you you a lot of question to try and fuse the technology of the multiplayer demos i work with and your great chunk system together. https://github.com/DennisSmuda/godot-chunking-system [2D Chunk Generator] https://github.com/dllta/ChunkLoader [2D Chunk System] https://github.com/michasng/voxel_game/tree/main [3D Voxel Generator] https://github.com/pinkavat/GroveGenChunks [3D Seamless Chunks]

I have to complete the 500+ project demos to go through. Yet your project is beating many many projects and its looking like at least top 5 or even 2nd or 1st place. I need to find really good candidates to bring with the best multiplayer to combine together as one with the best chunk candidates and push to create something really special for the community forever free.