DustinMEastway / generate-chunks

Godot project to test generating chunks of blocks for a game
1 stars 1 forks source link

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

Open WithinAmnesia opened 6 months ago

WithinAmnesia commented 6 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.

DustinMEastway commented 6 months ago

I have only used Godot 3 for a few weeks to play around with it. I never got past the point of generating chunks (using TileMap) with little veins in them (using OpenSimplexNoise.GetNoise2d), so I have not used any multiplayer features or had to work with saving/loading chunks.

If you want help knowing how to generate blocks within a chunk for a 2D world that wraps (like Terraria if the oceans at the end were connected) then you could use the Chunk class as an example. This class knows which chunk it is so it can generate a height that lines up with the chunks on either side of it.

If you want help knowing how to add chunks in from of a player and remove them behind them, then you could use the World class as an example. This knows how wide the world is and generates the chunk in front of and behind the chunk that the player is currently in using the modulo operator.

WithinAmnesia commented 6 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 6 months ago

I have only used Godot 3 for a few weeks to play around with it. I never got past the point of generating chunks (using TileMap) with little veins in them (using OpenSimplexNoise.GetNoise2d), so I have not used any multiplayer features or had to work with saving/loading chunks.

If you want help knowing how to generate blocks within a chunk for a 2D world that wraps (like Terraria if the oceans at the end were connected) then you could use the Chunk class as an example. This class knows which chunk it is so it can generate a height that lines up with the chunks on either side of it.

If you want help knowing how to add chunks in from of a player and remove them behind them, then you could use the World class as an example. This knows how wide the world is and generates the chunk in front of and behind the chunk that the player is currently in using the modulo operator.

Any insights or advice or thoughts what to do to next would be very helpful to solve this puzzle. I'm looking for people who are good at solving these issues / puzzles and we can solve these puzzles than the whole community can make massive games with infinite worlds in multiplayer; so everyone can benefit once we find a working solution.

Its really not easy to find people who are really talented and even little bits of help go along way and many hands make short work. I hope to just find any advice or help or thoughts, feelings and questions and like testing the demo 128x128 chunk like any feedback is helpful.

What are your thoughts and feelings and questions on what to do next to solve this puzzle since the update? It'll probably take a community of open minds to solve this puzzle. All feedback is welcome.