-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can this work for Godot 4+ games with multiplayer and open world chunks? #2
Comments
hello, so, uh, i made this project long time ago, and i dont remember how exactly i did it, but i think i still remember the general idea:
however, when a chunk gets out of bounds of the screen, or according to render distance, the chunk gets unloaded. however, the server will only unload a chunk when there is no players loading it, and then the chunk gets saved on disk and unloads it. |
Here is an update since I last posted. 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 |
Okay thank you. Its not easy to find people who are skilled and can give insights and like it probably going to take a community to solve this puzzle but once its solved everyone can forever free. Please any testing of the 128 x128 chunk demo and like any insights tinkering thoughts suggestions and like any help reading Theraot's code and like how to bets solve this would be so helpful. I really hope we can find solutions together. it's just once this big puzzle is solved everyone wins every massive multiplayer game uses this and like if Godot can have it we all win forever free. Please give feedback test the demo any help with the chunks to seamlessly load and unload them will be so amazingly important that like everything is built upon this foundation for BIG games and if we can do this the whole community will benefit. Please given any feed back or thoughts or questions. I wish to help too and I just need some guidance on what to do next too. What should be done? Any feedback is welcome. |
This was made in Godot 3.XX how do we get it to work on Godot 4.2.1.NET and also how do we get the server and the client to work together / what are the start up instructions? |
as i said, this project was made long ago, so i dont remember all the details. all i know is that the server and clients needs to be launched separately and manually. after the server starts, you put 127.0.0.1 (localhost) and the default port to connect to the server. this assuming youre running the server on the same device as the client. |
Are you still making games? Your game could use a Godot 4+ update to work now? Godot is using 4+ now and its not backwards compatible. Yes there is so long term 3.XX support but 99/100 new projects are using Godot+ and the dev team is focusing on Godot 4+ and eventually wants everyone to use Godot 4+. "all i know is that the server and clients needs to be launched separately and manually. after the server starts, you put 127.0.0.1 (localhost) and the default port to connect to the server. this assuming youre running the server on the same device as the client." |
the client and the server are separate godot projects. you open then individually, you can have both open, and yes, you can open from the editor. i still use godot, in version 4, of course. however i dont have plans rewriting the game in godot because i am doing it in other engines/frameworks/languages, because in godot it felt too messy and this idea of game didnt really fit in there. or maybe its just skill issue of mine, who knows. |
okay so do you use 2 godot editors and 1 open the server project and runs it and the other godot editor open the client project and runs it and then once both the server and client are running they communicate and the client can login into the server and work? |
exactly. they dont communicate when both are open, of course, you have to set the localhost ip and the port in the client to connect to the server. |
I hope you are using Godot 4 and Unreal but I would not trust Unity and Unreal is owned by Tencent in China so with Unreal you are one bad corperate decision away from like the whole thing falling apart. Also in China they are cracking down on gaming and Tencent might be in a lot of trouble and might either leave china or break apart so who knows? I like Unreal I have a 4k,8k,16k multiplayer RPG prototype with EasyRPG but after Unity I am not to sure about these for profit game engines. I lie Godot but it needs more power with the multiplayer. I am think a proper Multiplayer Seamless Chunk System would go a long way to equalize the playing field for Unity and Unreal for Godot 4+. I'll have to see and keep working with the community. What are your thoughts and feelings? you are really smart and I hope we can talk more too. |
|
yeah, uh, i felt the multiplayer RPC thing from godot was messy for me, specially when doing client and server, i didnt like the idea of having to create two separate projects... i tried unifying it but it also ended up being a mess and harder to code. but remember, in godot youre not limited to this, there are third party multiplayer extensions, or you can even use some NuGet package in C#, like another multiplayer library. |
I keep seeing NuGet get mentioned across the community. The JDungeon people agreed with you and did not like 2 projects thing for server and client and unified the gateway and server and clients into one project. Can you look at that to see if its like good or bad or neutral? https://github.com/WithinAmnesia/ARPG/tree/ARPG-Infinite-Worlds Does this add things to think about to help? How to start: Run 3-4 instances in the debug -> run multiple instances. Then run the first instance as Gateway. The second instance should run as Server. The third instance as Client. Make an account then log in. The fourth and more instances can be for client multi-boxing testing and work the same as the third instance. "but remember, in godot youre not limited to this, there are third party multiplayer extensions, or you can even use some NuGet package in C#, like another multiplayer library." This make me wonder what you know lol like you seem to know so much stuff about this. I wonder if you have the bright mind to know how to properly tackle the multiplayer seamless chunk system in Godot 4+. Yet the work might be a lot too so I'd like to do the work but I gotta figure out like a guide or something to get a start going? Is it a case that work is a lot you know like do you feel the work would be a lot that I am asking? Is your brain so smart it can imagine what the work would entale and like you can feel the amount of work needed? Do you have the ability to imagine the mental architecture required to solve this puzzle? |
the multiple instances thing is... quite confusing. i have no idea how it would work when it gets exported. the players should be able to run the standalone server executable somehow, you know? also, i'm not a professional, all i did was watch some tutorials on youtube, check documentation and use logical reasoning to code stuff. there might be or not other people more experienced with this than me. and yes, i agree, this system required a lot of thinking to make, actually, i was just coding it blindly without even trying to grasp what i just coded. so not even myself is sure if it really works, or even what bugs are present. this is literally my limit of hobby coding. maybe only on university i could grasp it better. |
What tutorials and documentation did you follow? https://www.youtube.com/watch?v=Q2iWDNq5PaU this one maybe? |
i was refering to tutorials and documentation regarding to multiplayer in general. in youtube, search for "godot client and server tutorial" or something. and the official godot docs has also docs about multiplayer stuff. for the voxel engine and chunk implementation... well... i just came up with my own implementation. you cant rely on tutorials for everything, you know? you have to get creative with the available tools, and also have optimization in mind. thats just how programming is, buddy. also, you know you can view the code of my project, right? there you can see how i did it. |
How can this be converted to work in Godot 4.2.1.NET? First snag I couldn't catch was 16:00. The mesh would render fine but without the material. Godot spits out no errors at this point so its a bit difficult to tell what's going wrong. I'll check back another day.. >_> PS. 39:20 Raycasts are enabled by default now :D" Is there a similar process to convert this to work with Godot 4.2.1.NET+? Also how is the data saved and how does it work with the server? i have not been able to get this to run on Godot 4.2.1.NET to test it so I am still really curious as to how this all works. Any feedback is welcome. |
look, i cant help you with every single detail, i have my business to do. what i know is that translating GDScript code to C# isn't that hard. it uses the same names for the classes, functions, members and variables, except they are in PascalCase because that is the standard for C#. but as i can remember by far, the chunk system works like this: the chunk is actually a Custom Resource. It stores all the block IDs in a array, you can do it in a 2D array if you prefer. It's an array of integers basically, with the number 0 representing air block. so, what the server and client sends between each other is just the chunk resource data. and the chunk mesh is actually built in the client based on the chunk resource data. that's it. this chunk resource data can also be saved in disk to be loaded later. and as i said before, i wont update this project anymore, don't try to make it work in the newest versions. what you can do is checking the code of the project. it's right there, its all there. i really encourage you to try to do your own solution to this. but you can also ask for help in the r/godot subreddit, in the forums, in the official godot discord server, etc... theres a whole community that can help you. |
"This chunk resource data can also be saved in disk to be loaded later." "What I know is that translating GDScript code to C# isn't that hard. it uses the same names for the classes, functions, members and variables, except they are in PascalCase because that is the standard for C#." This is really encouraging and I feel I can use C# and some good people I know to help with this and there are servers that run on C# and some minecraft example projects that run on C# OH!!!! Mate I just membered I did more testing and found some more leads and they are like your project but in C#: What do you think of the first one https://github.com/Solicey/minecraft-made-with-godot/ ? It should have working multiplayer but is like in Chinese but its in C# and on Godot 4.2.1.NET. What are your thoughts of this? "So, what the server and client sends between each other is just the chunk resource data. and the chunk mesh is actually built in the client based on the chunk resource data. that's it." "I really encourage you to try to do your own solution to this. But you can also ask for help in the r/godot subreddit, in the forums, in the official Godot discord server, etc... There's a whole community that can help you." What are your thoughts and suggestions? What should I do next too? All feedback is welcome. |
ah yeah, i have a tip for you: begin with the multiplayer and chunk system first. its probably the hardest thing to code, and it being the only thing on the project will make it easier to debug, and even avail if its possible to code at all. |
"Ah yeah, I have a tip for you: begin with the multiplayer and chunk system first. its probably the hardest thing to code, and it being the only thing on the project will make it easier to debug, and even avail if its possible to code at all." Then I am trying to learn C# and make a big custom multiplayer seamless chunk system with a bit of help from : https://www.youtube.com/watch?v=LEZGrHyWNmQ + https://astruggletosurvivedevblog.blogspot.com/ I working to reverse engineer the entities and online ARPG and browser aspects from JDungeon too: https://jonathaneeckhout.itch.io/jdungeon + https://github.com/WithinAmnesia/ARPG/tree/ARPG-Infinite-Worlds It all starts with what the community with yourself have said to master first create a from scratch made form the ground up custom tailored big game multiplayer optimized seamless chunk system as a solid proper foundation: "begin with the multiplayer and chunk system first. its probably the hardest thing to code." Lots of good progress so far too. I should get to work on the Godot 3.XX LTS with your example project and give more feedback too. What server and data suggestion should I consider too? Amazing Web Service is what JDungeon is hosted on but there are other options. It is recommended I use a fast langue like C# for server data and also GDscript can be converted to C# relatively reasonably the community says too so they get along it seems. I am trying to future proof this as much as I can to make solutions that can grow into big games. https://www.youtube.com/watch?v=It9D08W8Z7o These big mass produced 100+ CPU miniaturized server rooms that fit in a PC are coming to consumer market in the mid to late 2020's and will be everywhere by the early 2030's as the next big computer upgrade. So I want to build that 2030's M.M.O. infrastructure today over ~2-6 years and be ready for it and aim for up to 2K to 16K+ clients on one server to try my best shot at 10,000 player battles. What are your thoughts and suggestions? What have you considered for server options in the past and going forward? All feedback is welcome. |
sorry, i don't know anything about hosting game servers. all i do is code standalone client and server, so its up to whoever downloads it to host the server, just like how minecraft/terraria works. also, you know that my project is 2D, right? the youtube video you showed me was for 3D. i don't know if you're using 2D or 3D. but assuming you were just asking about the multiplayer thing, i would say its probably the same proccess for both modes, but for mesh building, it really isnt. i would even say that it's harder in 3D if you really care about optimization and perfomance. |
How do we get 2 players working at the same time? |
"also, you know that my project is 2D, right? the youtube video you showed me was for 3D. i don't know if you're using 2D or 3D. but assuming you were just asking about the multiplayer thing, i would say its probably the same proccess for both modes, but for mesh building, it really isnt. i would even say that it's harder in 3D if you really care about optimization and perfomance." I could not find many Godot 3 minecraft tutorials so I went with that one as a starter to see if it was close / I still wonder what tutorials you might have followed? Also how do we test saving the game chunks to disc and loading them up in a multiplayer world? |
you just open two clients that connects to the same server.
i dont even remember if i implemented that in this project. i do remember rewriting this project in godot 4, but i scrapped it. but i think i did implement it in this project... in a nutshell: idk. |
you just open two clients that connects to the same server.I have done this and and client 2 spawn on to of client 1 and in the chat window it said ~'player 2 has joined' and then client 1 freezes and is booted then client 1 disappears from client 2 and the chat says ~'player 2 has left' and meanwhile client 1 does not see player 2 it just gets booted? Does each client from separate editors compete over the same connection or something? I am using 3 editors and I am not sure what is going on? |
"
i dont even remember if i implemented that in this project. i do remember rewriting this project in godot 4, but i scrapped it. but i think i did implement it in this project... in a nutshell: idk." So you said you have savable chunk data to disk and you can have lot sof chunks in a 2D array sorta like how multiplayer minecraft works. What is needed to use the save chunk data and save and load it on a multiplayer server locally hosted for testing like how minecraft works with multiplayer work saving? What is needed for this in that this is really key feature to be able to save world chunks on a multiplayer server and have people / clients join the same server and experience the dynamic chunks in sync and this needs the chunk data to be saved and stored and the server needs to read it when players are near the chunk and auth the changes too from what people have said is a good multiplayer set up for this kind of multiplayer seamless chunk system puzzle. |
Zylann/godot_voxel#602 (Main Godot Voxel Game with multiplayer options and written in various languages with GDscript and C++ and C#) |
Zylann/voxelgame#100 (comment) 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: Zylann/voxelgame#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. |
What are your thoughts on getting the Blockygame demo to work in 2D and keep the chunk system intact? How can the 2D Compatibility mode conversion work? Perhaps this can fix your multiplayer in Godot 4.2.1.NET too? How can 2D be used to port over the 3D chunk system in Blockygame demo? If done this will be a great foundation for the entire community to make massive multiplayer games. |
I just got the Godot_Voxel with BlockyGame to generate a flat world for testing in multiplayer: WithinAmnesia/ARPG#16 (comment) 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: 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. |
Zylann/voxelgame#101 (comment) Big 2D/3D hybrid progress update! |
Zylann/voxelgame#103 How can entities and player storage work for this demo? Are there any examples or prototypes? How can entities and storage system like chests stored in chunk data like minecraft? Bonus for account linked storage like M.M.O. player inventory and banks / minecraft player account inventory with shulker boxes. |
Do you have any free time to look at the code for this RPG Inventory from scratch tutorial and see how it can be translated / implemented with the Blockygame multiplayer demonstration? What should be done? What are your thoughts and suggestions? All feedback is welcome. |
Test chunks link: WithinAmnesia/ARPG#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.
The text was updated successfully, but these errors were encountered: