Quaint-Studios / Reia

Explore endless worlds and embark on a magical adventure of a lifetime! Reia is an action-adventure RPG and also an open-source game. Play offline or online with friends, or login for an MMO experience! Create and explore worlds, manage your own economy and products, and restore Reia's world via the story. Choose the way you want to play.
https://www.playreia.com
GNU Affero General Public License v3.0
84 stars 8 forks source link

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

Closed WithinAmnesia closed 3 months ago

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

Makosai commented 5 months ago

Hi, thanks for taking an interest in this project. Reia is a 3D action adventure game. So it's neither 2D nor a tool you can use to implement into other games. What you can do with it is take inspiration from the codebase or even fork it and modify it to your liking. But neither of those will yield you the results you're looking for.

If you want to seamlessly load and unload chunks, I'd suggest building a script that gets the location of the player and loads only the predicted chunks the player might encounter (i.e. if the player walks NW, load NW, N, and W chunks or if they walk W, load NW, W, and SW chunks - sort of like a cone).

This StackOverflow site will probably help you understand it a bit more. https://stackoverflow.com/questions/18542534/how-to-load-unload-tile-chunks-fasterc

Also, doing this on a separate thread is advised. https://docs.godotengine.org/en/stable/tutorials/performance/using_multiple_threads.html

Reia will eventually implement this with its Infinite City. You can read more about how the Infinite City will function. That link will tell you what's to come. I plan to continue development on this project starting Sunday or Monday.

Hopefully this helps you and maybe you'll one day contribute back to this project. :)

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

Hi, thanks for taking an interest in this project. Reia is a 3D action adventure game. So it's neither 2D nor a tool you can use to implement into other games. What you can do with it is take inspiration from the codebase or even fork it and modify it to your liking. But neither of those will yield you the results you're looking for.

If you want to seamlessly load and unload chunks, I'd suggest building a script that gets the location of the player and loads only the predicted chunks the player might encounter (i.e. if the player walks NW, load NW, N, and W chunks or if they walk W, load NW, W, and SW chunks - sort of like a cone).

This StackOverflow site will probably help you understand it a bit more. https://stackoverflow.com/questions/18542534/how-to-load-unload-tile-chunks-fasterc

Also, doing this on a separate thread is advised. https://docs.godotengine.org/en/stable/tutorials/performance/using_multiple_threads.html

Reia will eventually implement this with its Infinite City. You can read more about how the Infinite City will function. That link will tell you what's to come. I plan to continue development on this project starting Sunday or Monday.

Hopefully this helps you and maybe you'll one day contribute back to this project. :)

Okay thank you very much. it is so not easy to find talented people to help with this big puzzle. I feel I need to listen to the experts of the community to bets find answers. If we can find a solution to this problem we can all benefit and make practically infinite worlds with Godot multiplayer and that would even the field and bring Godot equal to Unity and Unreal engines in terms of world building scale or at last a foundation that can be expanded and make just as good or better but it has to start somewhere.

I really hope we can work together and find solutions. Its so critical to find open minded people and who can have these amazing like creative gifts and talents as yourself.

This puzzle with the multiplayer seamless loading unloading chunks is like once its solved its solved for good and everyone wins. I want to make a 2.5D and a 3D game too but I'm starting from the ground up with 2D as a foundation and then after 2.5D in 4k and then back to my work with 4k, 8k, 16k 3D Voxels MMORPG I had in Unreal with EasyRPG and other community Blueprints.

I'm trying to upgrade Godot 4+ so it can go toe to toe with Unity and Unreal and be equal and forever free too. its just right now its the multiplayer if we can figure this out as a community then we all win because its open source and my project, your project, any project past present future, as in everyone can have these solutions to grow.

Do you get you tired like myself with having to deal and quite frankly suffer through having the gatekeeping and legal and ownership and peace of mind limitations for these traditionally exclusive massive multiplayer world creating features? These you traditionally have to pay profit seeking companies like Unity to even use let alone make a game with and then randomly they have every single legal right to just ruin everything later on whim. Also when these world building tools are not open source and propitiatory you and the community pay for their legal team to sue and like ruin your years of work and a future peace of mind ironically. That's why open source is so amazing. Its just hard now since Godot needs a lot work from the community; but if we can find this solution to this critical puzzle everyone wins forever for its open source and everyone owns it forever free.

WithinAmnesia commented 5 months ago

Sorry for the rant at the end its just I am a RPG dev for like so many games over like 2+ decades. I've worked on Baldur's Gate retail and mods, Diablo, Various Blizzards games with art like being WoW dev for both retail and private servers (extra spicy). I'm trying to make games and it is so hard to just get the tools. This is the last critical key. Its been there for 20+ years the multiplayer seamless chunk loading and unloading and if we get this finally the community can be free to make infinite worlds forever free.