The-Soulhunter icon indicating copy to clipboard operation
The-Soulhunter copied to clipboard

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

Open WithinAmnesia opened this issue 1 year ago • 100 comments

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 avatar Feb 16 '24 19:02 WithinAmnesia

This project was made in Godot 3, so it would need to be upgraded first. It doesn't use Godot's multiplayer system, but a custom one. There is a support for loading/unloading instances (rooms), but it's rather simple and easy to replicate.

IIRC the PDF explains the inner workings: https://github.com/KoBeWi/The-Soulhunter/blob/master/Paper/The%20Paper%20Eng.pdf

KoBeWi avatar Feb 16 '24 19:02 KoBeWi

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 avatar Feb 17 '24 16:02 WithinAmnesia

I can't run the project, nor open it in the editor. Getting some error spam about tiles.

If you want seamless loading, if you make your chunk be size of the screen, you should be loading 3x3 grid of chunks, because when going between chunks, you will see multiple of them at once. As for unloading, in my project I had a timeout (I think 1 minute?). If no player was in the room for that time, it was unloaded. Though if the player is moving fast between chunks, the timeout could adjust dynamically to unload far chunks.

KoBeWi avatar Feb 17 '24 17:02 KoBeWi

This project was made in Godot 3, so it would need to be upgraded first. It doesn't use Godot's multiplayer system, but a custom one. There is a support for loading/unloading instances (rooms), but it's rather simple and easy to replicate.

IIRC the PDF explains the inner workings: https://github.com/KoBeWi/The-Soulhunter/blob/master/Paper/The%20Paper%20Eng.pdf

Oh excellent. What are your thoughts and feeling and ideas for what should be done for seamless chunk loading and unloading now with this update and promising code from Theraot? I hope you can read this code better than I can Oh 1 sec.

WithinAmnesia avatar Feb 17 '24 17:02 WithinAmnesia

I can't run the project, nor open it in the editor. Getting some error spam about tiles.

If you want seamless loading, if you make your chunk be size of the screen, you should be loading 3x3 grid of chunks, because when going between chunks, you will see multiple of them at once. As for unloading, in my project I had a timeout (I think 1 minute?). If no player was in the room for that time, it was unloaded. Though if the player is moving fast between chunks, the timeout could adjust dynamically to unload far chunks.

error spam? What does this look like? I had to re-import stuff lots and there has been unable to write / lack permissions before but it has also been an issue of too long directory. So try a short directory path too, it might help? What system and stuff are you using I might be able to help get it running? All feedback is good.

WithinAmnesia avatar Feb 17 '24 17:02 WithinAmnesia

https://github.com/KoBeWi/The-Soulhunter/assets/2223172/d9bbec1a-3f74-4068-aa40-af276d14dd7c

This, forever. (the tile errors begin a bit later)

KoBeWi avatar Feb 17 '24 17:02 KoBeWi

powershell_zF6ApB7oHo.mp4

This, forever. (the tile errors begin a bit later)

Interesting. oh! https://github.com/jonathaneeckhout/jdungeon/tree/d941345fd187e51d7d51d24027838baae3ba4b78 this is the JDungeon main branch with the in sync version that the ARPG demo is based from its like 99% the same minus its 256x256 and the test is 128x128.

WithinAmnesia avatar Feb 17 '24 17:02 WithinAmnesia

Did I corrupt the ARPG 128x128 version? Hmmm. I uploaded it and downloaded it from its own github branch and tested it and it worked? But its supposed to work on not just my pc so I wonder what the issue is. Can you run the regular JDungeon from that link? If so it must be an issue with my 128x128 version. Maybe the .godot/imported section hmm.

WithinAmnesia avatar Feb 17 '24 17:02 WithinAmnesia

What Godot version exactly?

KoBeWi avatar Feb 17 '24 17:02 KoBeWi

What Godot version exactly?

Godot 4.2.1.NET https://godotengine.org/download/windows/ or linux / mac .etc

WithinAmnesia avatar Feb 17 '24 17:02 WithinAmnesia

Ok I managed to run it, but only the server (the client couldn't log in for some reason).

Looks like your chunks are very big (I mean compared to the screen size). Not sure how a 3x3 grid would behave, maybe a better option is loading chunks when a player gets close to the border. There is space for that.

Also for chunked maps I'd suggest creating some specialized editor, because editing them separately is going to be a hassle if they are supposed to link seamlessly.

So what do you expect from me exactly? I already described the state of this project. I can give some general advice, but I'm not a networking expert. I didn't make any multiplayer game since I abandoned the current Soulhunter.

KoBeWi avatar Feb 17 '24 17:02 KoBeWi

I updated the main page with start instructions now. https://github.com/WithinAmnesia/ARPG/discussions/15 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.

Ok I managed to run it, but only the server (the client couldn't log in for some reason).

Looks like your chunks are very big (I mean compared to the screen size). Not sure how a 3x3 grid would behave, maybe a better option is loading chunks when a player gets close to the border. There is space for that.

Also for chunked maps I'd suggest creating some specialized editor, because editing them separately is going to be a hassle if they are supposed to link seamlessly.

So what do you expect from me exactly? I already described the state of this project. I can give some general advice, but I'm not a networking expert. I didn't make any multiplayer game since I abandoned the current Soulhunter.

WithinAmnesia avatar Feb 17 '24 18:02 WithinAmnesia

Ok I managed to run it, but only the server (the client couldn't log in for some reason).

Looks like your chunks are very big (I mean compared to the screen size). Not sure how a 3x3 grid would behave, maybe a better option is loading chunks when a player gets close to the border. There is space for that.

Also for chunked maps I'd suggest creating some specialized editor, because editing them separately is going to be a hassle if they are supposed to link seamlessly.

So what do you expect from me exactly? I already described the state of this project. I can give some general advice, but I'm not a networking expert. I didn't make any multiplayer game since I abandoned the current Soulhunter.

Oh well I just need some advice and like thoughts and what should be pursued? this is a complex issue and I will make a lot of errors so like if any help and or guidance can be give n that would be great.

I just need need like testing and what to do next for I'm not really goo at this but if eel with the right people we can find the solutions together. Once we find what works then everyone can benefit too. So it is important for myself be open minded and like I just need some ideas and knowledge and like any suggestions help too. Its really hard to find propel who are good at this stuff so any advice would help. Any thoughts and questions and insight and like what would make sense to do next with this big puzzle would be so helpful. I'll try to find people who can help too where maybe this puzzle needs a community to solve? Any feedback is welcome.

WithinAmnesia avatar Feb 17 '24 18:02 WithinAmnesia

I didn't look at the internals, but your gateway shouldn't be a Godot app, because it creates unnecessary overhead. Also perfectly the server shouldn't be a Godot instance either, or at least it should be as light as possible. In my project I couldn't work around that, but yours seem to be simpler though, because it doesn't really require physics. That's the advice I can give after seeing the demo.

That said, I don't really have time to provide any serious help. Seems like this is an open-source project? You'll need to find many people if you want to succeed, especially when you aren't experienced yourself, so good luck with that.

KoBeWi avatar Feb 17 '24 18:02 KoBeWi

I didn't look at the internals, but your gateway shouldn't be a Godot app, because it creates unnecessary overhead. Also perfectly the server shouldn't be a Godot instance either, or at least it should be as light as possible. In my project I couldn't work around that, but yours seem to be simpler though, because it doesn't really require physics. That's the advice I can give after seeing the demo.

That said, I don't really have time to provide any serious help. Seems like this is an open-source project? You'll need to find many people if you want to succeed, especially when you aren't experienced yourself, so good luck with that.

Okay I am back again sorry for the long reply times. Yeah the server being together is a simplicity thing. It was originally separate but it was hard to start and a lot of people struggled so it was made simpler and all together. Pros and cons you are right its better to have it separate but its more simpler to have it together.

I wonder what to do here then: "I didn't look at the internals, but your gateway shouldn't be a Godot app, because it creates unnecessary overhead." "Also perfectly the server shouldn't be a Godot instance either, or at least it should be as light as possible."

How do we get these simple yet work good together? That is a puzzle too.

"In my project I couldn't work around that, but yours seem to be simpler though, because it doesn't really require physics. That's the advice I can give after seeing the demo." You could maybe use some stuff from the JDungeon stuff its open source and like the license is really good too like how MIT works practically.

"That said, I don't really have time to provide any serious help. Seems like this is an open-source project? You'll need to find many people if you want to succeed, especially when you aren't experienced yourself, so good luck with that." yeah its going to need a open minded community for sure to solve but hey once its solved like the whole community can win and we can have this amazing community resource forever to build massive multiplayer games with. We just need a start and bit by bit we can find solutions.

You are right I'm not the bets at this but like I think if I try hard enough and we find solutions together and like it'll take a bunch of people like you say in the community to come together and solve this big puzzle and once its solved everyone benefits. Also we can stop using Unity and Unreal and other for profit game engine that could like on a whim ruin everything by being too greedy like Unity. Unreal is owned by Tencent in China so like that just one back update away from being like Unity then what? All we have Godot then and that's all we need for its open source forever free.

Once we solve this 20+ year old critical massive multiplayer player infrastructure puzzle we can start building massive multiplayer games across the entire community for the foundation would be there forever free for everyone. I'll be around just I'll try to get the community together too and rally behind this multiplayer seamless chunk loading and unloading system and try and solve this puzzle by by bit.

WithinAmnesia avatar Feb 17 '24 20:02 WithinAmnesia

https://github.com/KoBeWi/The-Soulhunter how do we get the game going? It is Godot 3.XX and the server .zip is in a strange website that won't allow the download?

WithinAmnesia avatar Feb 17 '24 21:02 WithinAmnesia

The link was dead, I updated it.

KoBeWi avatar Feb 17 '24 21:02 KoBeWi

Do you want to make this into Godot 4+? 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+. I really hope so for there are very few really talented people like yourself.

WithinAmnesia avatar Feb 17 '24 22:02 WithinAmnesia

Well as I said, the project is no longer developed, so I have no interest in updating it. The source is available if someone wants to upgrade it (there isn't much code to change).

KoBeWi avatar Feb 17 '24 22:02 KoBeWi

What code needs to be updated to Godot 4 and what would that look like? What are you doing now?

WithinAmnesia avatar Feb 17 '24 23:02 WithinAmnesia

How do you get past the hue part logging into the game? i go to make an account i have both the server and client.exe running and when I type in like username 'test' password 'test' set hue to default red it like stops after pressing enter? What should be done to get the game to work? I let it go past the windows firewall too so its a mystery

WithinAmnesia avatar Feb 17 '24 23:02 WithinAmnesia

Did you run the database? You need to run database, then server, then start game, register account and login. I just tested and it still works.

What code needs to be updated to Godot 4 and what would that look like?

Run the project and fix all errors. Lots of stuff was renamed, so the methods need to be updated to new names etc.

What are you doing now?

My current main project is Voice of Flowers. I had big plans for The Soulhunter, but making a MMORPG is too much hassle. I might revise the project in a different form one day.

KoBeWi avatar Feb 17 '24 23:02 KoBeWi

Did you run the database? You need to run database, then server, then start game, register account and login. I just tested and it still works.

What code needs to be updated to Godot 4 and what would that look like?

Run the project and fix all errors. Lots of stuff was renamed, so the methods need to be updated to new names etc.

What are you doing now?

My current main project is Voice of Flowers. I had big plans for The Soulhunter, but making a MMORPG is too much hassle. I might revise the project in a different form one day.

"Run run_database.bat (requires mongodb installed)" in 'how to run'. is the other one Polish? I worked on Polish tank history before lol.

"I had big plans for The Soulhunter, but making a MMORPG is too much hassle. I might revise the project in a different form one day." Awwwwwwwe. You should do the MMORPG one too i know its hard but its worth it. I got booted from the JDungeon people cus the server drove them crazy they like Matthew not one more server question reee 'but how does the chunk talk to the server?' -thats it delete the questions and ban. I Asked too many questions too quickly overstressed the poor devs lol. They did there best but they having a hard time with errors too. MMORPGS are hard too. I think we are still friends with the JDungeon people its just servers are hard to expand lol. You know people like yourself are really hard to find. I try to keep track of people and treat them really good. Do you have any plans to get the MMO stuff and running? Its hard not a lot of positive stuff too or what happened last time, maybe it'll be better now? Any feedback is welcome.

WithinAmnesia avatar Feb 17 '24 23:02 WithinAmnesia

Yep, when you run the bat file you should see this:

image

If you don't it means mongodb is not available in your PATH.

is the other one Polish?

Yes.

KoBeWi avatar Feb 17 '24 23:02 KoBeWi

How do get the "mongodb installed"? Also I made the comment bigger above.

WithinAmnesia avatar Feb 17 '24 23:02 WithinAmnesia

Yep, when you run the bat file you should see this:

image

If you don't it means mongodb is not available in your PATH.

is the other one Polish?

Yes.

run_database.bat uh is the command prompt? there is a technical way to do this. I ran .bat files before (my memory is fuzzy).

WithinAmnesia avatar Feb 17 '24 23:02 WithinAmnesia

image okay I need the mongodb hmm

WithinAmnesia avatar Feb 18 '24 00:02 WithinAmnesia

https://www.mongodb.com/atlas/database mate you gotta buy mongodb like why use godot then? Hmmm I'll keep searching.

WithinAmnesia avatar Feb 18 '24 00:02 WithinAmnesia

MongoDB Community Server is the free and open-source version of the NoSQL database system. MongoDB Atlas is the paid and fully managed version of MongoDB that integrates natively with major cloud providers, including Amazon Web Services (AWS), Microsoft Azure, and Google Cloud Platform (GCP). hmmmmmm https://www.cloudzero.com/blog/mongodb-pricing/ Amazon cloud i see a lot too for dedicated servers.

WithinAmnesia avatar Feb 18 '24 00:02 WithinAmnesia

How do get the "mongodb installed"?

Download and install: https://www.mongodb.com/try/download/community

Do you have any plans to get the MMO stuff and running?

No, as I said, too much hassle. I spent a few months developing it and it's lagging as hell. I didn't even solve basic problems. Adding content is a nightmare when you need to consider all the networking stuff and with MMOs you want the server to be fully authoritative.

KoBeWi avatar Feb 18 '24 00:02 KoBeWi