fanherbaty / crustycraft

A top-down 2D MineCraft clone in GODOT 4.1
1 stars 0 forks source link

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

Open WithinAmnesia opened 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.

WithinAmnesia commented 8 months ago

I am doing a from scratch build now for the multiplayer chunk system. What should I do for the server and the data and chunk storage? I have a few leads and some more thoughts and resources can be found here: https://github.com/WithinAmnesia/ARPG/discussions/16 <Start fresh thread. https://github.com/WithinAmnesia/ARPG/discussions/15 <Previous start thread. It was suggested I build a from scratch Multiplayer seamless chunk system that eventually be put together where it can handle 2K-16K+ players on the same server. What should be done for a web deployment to also run on a browser? I was suggested to try and do a chunk storage system similar to Minecraft or Terraria where each chunk is stored individually and accessed by the server in communication with the player clients. What should be done to solve this chunk puzzle? All feedback is welcome.

WithinAmnesia commented 7 months ago

https://github.com/Zylann/voxelgame/issues/100#issuecomment-1955780686 We figured it out! Now its phase 3 with trying to convert the working multiplayer dynamic seamless chunk system to top down 2D. We are onto the next puzzle to solve now: https://github.com/Zylann/voxelgame/issues/101

How do we make the top down 2D multiplayer branch / version of this that can run on Godot 4.2.1.NET+ Compatibility and for online web / browser game hosting (so pretty much anything everything can play this power multiplayer seamless chunk system?

Requirements: A hand made and dynamic main over world map 100 areas combined with 1,024 x 1,024 tile map for an at least tile map size of 104,857,600 tiles with 16 x 16 pixel tiles at least. Perhaps double that with subterranean and interiors included to the total amount of tiles for a multiplayer seamless chunk system. The intended client / player / population / server size is to be ~2K to ~16K+ clients on one server. How can we convert the Blockygame multiplayer seamless chunk system for this forever free open source forever free goal?

My first thoughts are to get just to the basics and start from a stripped down 2D array. Yet I have to do this properly to keep the dynamic multiplayer seamless chunk system intact and future proof for 2.5D and 3D games; when they are ready to be made in subsequent order. I must seek guidance to do this properly and make a beautiful work for the community to be empowered with too for making massive multiplayer games. I call this whole open source forever free community dynamic multiplayer seamless chunk system Infinite Worlds.

WithinAmnesia commented 7 months ago

I just got the Godot_Voxel with BlockyGame to generate a flat world for testing in multiplayer: https://github.com/WithinAmnesia/ARPG/discussions/16#discussioncomment-8550111 The code for the flat world generator makes ~3 layers of grass (instead of just 1) and it might be a bit buggy but it works although I should have a simpler one like fill all with grass for example but I was not sure how to code that so i just made iterations and slowly got it to work for multiplayer). Each chunk is 16x16x16 blocks so I have to optimize that into 2D better. It works, it's just now I'm trying to figure out how to make it 2D and not 3D but its progress. I'm not sure how to start the 2D. There are some examples of minecraft in 2D with 2D arrays but I'm not sure how to get the 2D mode going and how to keep the chunk system together. It took a while to get the blocks to be flat and the code was a case of trial and error switching things on and off and adjusting values testing in multiplayer.

I am trying to not be bound to the special Godot_Voxel engine module / the special Godot Voxel engine so this solution can be used in regular Godot Engine 4.2.1.NET+ editors.

The big thing now is trying to get the 3D chunks into 2D chunks and then test in Compatibility mode. I have some examples that might help for a start but I'm not sure its super amazing at everything but they might help a bit to get a foothold of what to do next: https://github.com/pvini07BR/mijocraft/issues/2 (2D GDScript Multiplayer Minecraft in Godot 3.XX) https://github.com/pvini07BR/mijocraft/issues/3 https://github.com/pvini07BR/mijocraft/issues/4 ... https://github.com/sirarandor/lux-terra/issues/1 (2D Multiplayer expanding tile / chunk game with fog of war) ... https://github.com/KoBeWi/The-Soulhunter/issues/2 (2D Godot 3.XX multiplayer chunk game) ... https://github.com/fanherbaty/crustycraft/issues/1 (2D Minecraft with cave levels in Godot 4.2.1.NET+)[your game project]

What should the next step go? What are your thoughts and suggestions? Should I just keep tinkering away with the 4 2D multiplayer godot game demos and keep trying new things until something works with the 2D port of the multiplayer chunk system with Godot_Voxel? All feedback is welcome.

WithinAmnesia commented 7 months ago

https://github.com/Zylann/voxelgame/issues/101#issuecomment-1958792464 Big 2D/3D hybrid progress update!