Page 1 of 2
Multiplayer using HTTP
Posted: Sat Oct 15, 2016 3:46 pm
by bio1712
I'm trying to make a Multiplayer game. I would use UDP but I don't have any machine that could run a server.
Connection client to client would be perfect, but there are lot of problems with NAT, I could have an UDP gole punching to salve this problem, but I didn't find tutorials on how to do it in Lua or in Löve.
I know that HTTP isn't made for multiplayer however since my game wouldn't require lots of connections (Users would play 2 different matches simultaneously), shall I use HTTP or it is a bad idea?
Thanks
Re: Multiplayer using HTTP
Posted: Sat Oct 15, 2016 3:48 pm
by raidho36
HTTP is a transport protocol, not networking protocol - of which you, as of today, for practical purposes, only have UDP and TCP/IP.
Re: Multiplayer using HTTP
Posted: Sat Oct 15, 2016 3:55 pm
by bio1712
Is there any way to make a Multiplayer game without a server?
Re: Multiplayer using HTTP
Posted: Sat Oct 15, 2016 3:57 pm
by HugoBDesigner
Yes, but it requires porting forward and/or a program like Hamachi.
Re: Multiplayer using HTTP
Posted: Sat Oct 15, 2016 4:06 pm
by raidho36
Hamachi emulates local network, it's different.
P2P model doesn't requires a server but has a huge set of issues to compensate.
Re: Multiplayer using HTTP
Posted: Sat Oct 15, 2016 4:20 pm
by bio1712
Ok, so it's pretty impossible to use TCP or UDP without a server.
I know HTTP is a transfer protocol and it's not made for these purposes, but I have and idea that *could* work:
I would store player data on a MySQL table, then every client shoot a request every 3 seconds to retrieve/send data through a PHP file.
Would it be possible or it's a very bad idea, so should I give up and look for another solution?
Re: Multiplayer using HTTP
Posted: Sat Oct 15, 2016 4:29 pm
by raidho36
Depends on the type of game. But then you might as well just make it work in browser.
Re: Multiplayer using HTTP
Posted: Sat Oct 15, 2016 4:31 pm
by bio1712
The point is that I want to make an Android game.
Re: Multiplayer using HTTP
Posted: Sat Oct 15, 2016 4:38 pm
by raidho36
On mobile you're pretty much shit out of luck with P2P unless device is connected to wi-fi and even then there's gonna be problems, you gonna need a server. But depending on type of game it might be OK to use a regular web server as back-end, like if it's a turn based game. Not gonna work for action games though.
Re: Multiplayer using HTTP
Posted: Sat Oct 15, 2016 4:53 pm
by bio1712
My game is an arcade game. The players would play 2 different matches, and at the end of the matches the player with the highest score wins. The data sent would be only the score and few others things.
Thanks for your replies!