Multiplayer using HTTP

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
bio1712
Citizen
Posts: 72
Joined: Wed Aug 19, 2015 4:13 pm
Location: Italy

Multiplayer using HTTP

Post 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
User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

Re: Multiplayer using HTTP

Post 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.
bio1712
Citizen
Posts: 72
Joined: Wed Aug 19, 2015 4:13 pm
Location: Italy

Re: Multiplayer using HTTP

Post by bio1712 »

Is there any way to make a Multiplayer game without a server?
User avatar
HugoBDesigner
Party member
Posts: 403
Joined: Mon Feb 24, 2014 6:54 pm
Location: Above the Pocket Dimension
Contact:

Re: Multiplayer using HTTP

Post by HugoBDesigner »

Yes, but it requires porting forward and/or a program like Hamachi.
HugoBDesigner - my Twitter
HugoBDesigner - my Blog
User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

Re: Multiplayer using HTTP

Post 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.
bio1712
Citizen
Posts: 72
Joined: Wed Aug 19, 2015 4:13 pm
Location: Italy

Re: Multiplayer using HTTP

Post 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?
User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

Re: Multiplayer using HTTP

Post by raidho36 »

Depends on the type of game. But then you might as well just make it work in browser.
bio1712
Citizen
Posts: 72
Joined: Wed Aug 19, 2015 4:13 pm
Location: Italy

Re: Multiplayer using HTTP

Post by bio1712 »

The point is that I want to make an Android game.
User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

Re: Multiplayer using HTTP

Post 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.
bio1712
Citizen
Posts: 72
Joined: Wed Aug 19, 2015 4:13 pm
Location: Italy

Re: Multiplayer using HTTP

Post 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!
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 8 guests