landgreen / n-gon

2-d physics rogue-lite platformer shooter
https://landgreen.github.io/n-gon/
GNU General Public License v3.0
134 stars 193 forks source link

Idea: Multiplayer Battles (and other suggestions) #178

Closed The-Rock-21 closed 4 months ago

The-Rock-21 commented 4 months ago

I looked at the other suggestions and one of the suggestions for multiplayer would take too long. So I have a simpler suggestion. Main Suggestion - Multiplayer Battles

corneeme commented 4 months ago

that could be a lot of fun!

kgurchiek commented 4 months ago

The main problem with multiplayer is that it would require a server. The best free vps I know of is from Oracle Cloud, which can give you a permanent 8gb ram vps for free, and you have to opt-in to any payments so you won't accidentally lose money. The problem with that is that eventually as the game grows you'd need more servers, so unless you do a sponsorship with a hosting service you'd have to spend money on more hosts

The-Rock-21 commented 4 months ago

The main problem with multiplayer is that it would require a server. The best free vps I know of is from Oracle Cloud, which can give you a permanent 8gb ram vps for free, and you have to opt-in to any payments so you won't accidentally lose money. The problem with that is that eventually as the game grows you'd need more servers, so unless you do a sponsorship with a hosting service you'd have to spend money on more hosts

Maybe we could do like a limit? Or maybe like first come first serve? I honestly have no idea how vps or hosting services work though so it might not work

jo9182 commented 4 months ago

The main problem with multiplayer is that it would require a server. The best free vps I know of is from Oracle Cloud, which can give you a permanent 8gb ram vps for free, and you have to opt-in to any payments so you won't accidentally lose money. The problem with that is that eventually as the game grows you'd need more servers, so unless you do a sponsorship with a hosting service you'd have to spend money on more hosts

If it does grow large enough it could run off of donations, in the meantime, it could have a queue system. Eaglercraft used a relay system until it eventually got taken down, maybe use something like that? You could also just start by using LAN, I know plenty of people who would love to just have this implemented.

kgurchiek commented 4 months ago

I think the best solution would be to limit the amount of players that can play at once and make a queue that people wait in until someone leaves. The problem then would be that people would leave their computer after getting in the queue when they get bored and be afk when they get in, so there would be a lot more inactive players than in a first-come-first-serve system. No matter what system you use you'd also have to limit the amount of games a single person can play, until they get sent back into the queue, otherwise afk players or bots would fill up the servers and no one would be able to play

selfhosting servers on the client with webrtc could be a good idea, but that would mean you'd only get to play with your friends instead of actual online matchmaking, because officially supporting custom servers in a public list or random matchmaking would be a bad idea, since people could always just mod or entirely rewrite an n-gon client that hosts a server that lets them cheat or could even have something nsfw. Selfhosted servers would also mean that it would be a horrible experience for everyone if the one person that happens to be selected as host happens to have a slow connection, or if they choose to stop playing, ending the game for everyone. Call of Duty zombies servers are selfhosted by the players, and you're constantly affected by those problems. It's very annoying trying to play a public game and being extremely laggy because the person chosen has bad internet or a slow device, and when the host leaves you have to break the action to stare at a blank screen for possibly minutes straight while it switches hosts.

landgreen commented 4 months ago

I encourage ya'll to make a multiplayer version, but I'm just gonna focus on single player.

jo9182 commented 4 months ago

Now I just gotta get smart enough to actually start making it, where would I even start?

corneeme commented 4 months ago

you could work on a local two-player version first, just to get a framework down

interpolation-0 commented 4 months ago

peer to peer could also be a viable option through webrtc

interpolation-0 commented 4 months ago

but as kgurchiek said modifying the client to host a botched server is also an issue

jo9182 commented 4 months ago

@interpolation-0 Refer to @kgurchiek That could be a viable option, but if the host computer has a bad connection, everyone suffers.

interpolation-0 commented 4 months ago

the data transferred doesn't have to be very large what info needs to even be transferred?

interpolation-0 commented 4 months ago

but high ping is also an issue

jo9182 commented 4 months ago

@interpolation-0 The inputs would need to be transferred to the host and the positions of everything would need to be transferred back to the other players (Assuming the host computer is doing the heavy lifting)

kgurchiek commented 4 months ago

now that I've been challenged I'll work on a p2p multiplayer mod, I think just playing the game co-op instead of a pvp game would work better, so I'll probably do that first

kgurchiek commented 4 months ago

but for the reasons I mentioned it'll just be for playing with friends, not full multiplayer matchmaking

kgurchiek commented 4 months ago

the data transferred doesn't have to be very large

what info needs to even be transferred?

the host would have to handle all mobs, bullets, collisions, etc. and send that to all the other players

AnnonymousNerd87 commented 4 months ago

I think it would be a great idea, but it doesn't fit with how I see n-gon, so I think Landgreen should focus on teaching and n-gon's current state and ideas, not multiplayer. Landgreen's to-do list is already so huge and awesome, at this rate we'll get Half-Life 3/Rainworld/Noita/Sci-fi in no time!

jo9182 commented 4 months ago

@AnnonymousNerd87 Yeah, he isn’t working on it, another dude in the thread is. https://github.com/kgurchiek/n-gon-multiplayer

AnnonymousNerd87 commented 4 months ago

I know, just making sure

AnnonymousNerd87 commented 4 months ago

also I generally don't like pings, because they clog my mail I have had bad experience with my school email getting hundreds of messages from canvas that I can't opt out of, so it has soured my experience with pings

AnnonymousNerd87 commented 4 months ago

you can still use them, but use them sparingly