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.
User avatar
Positive07
Party member
Posts: 1014
Joined: Sun Aug 12, 2012 4:34 pm
Location: Argentina

Re: Multiplayer using HTTP

Post by Positive07 »

To answer your question, yes there is no problem with using HTTP, it may be slow compared to TCP or UDP (since HTTP is done over TCP and TCP is done over IP which is pretty similar to UDP) but if the data you want to transmit is not much then you shouldn't have problem using GET or POST requests and answering with a txt/json/xml/lua file from your server, you can use PHP or Node.js or any other server language that exists out there, there are some Lua servers like Luv.it too, the only downside is that it's not easy to implement such a server in LÖVE although it may be possible
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
bio1712
Citizen
Posts: 72
Joined: Wed Aug 19, 2015 4:13 pm
Location: Italy

Re: Multiplayer using HTTP

Post by bio1712 »

Positive07 wrote:To answer your question, yes there is no problem with using HTTP, it may be slow compared to TCP or UDP (since HTTP is done over TCP and TCP is done over IP which is pretty similar to UDP) but if the data you want to transmit is not much then you shouldn't have problem using GET or POST requests and answering with a txt/json/xml/lua file from your server, you can use PHP or Node.js or any other server language that exists out there, there are some Lua servers like Luv.it too, the only downside is that it's not easy to implement such a server in LÖVE although it may be possible
Thanks, I'll try and let you know ;)
User avatar
josefnpat
Inner party member
Posts: 955
Joined: Wed Oct 05, 2011 1:36 am
Location: your basement
Contact:

Re: Multiplayer using HTTP

Post by josefnpat »

I have made a few games that operate on http requests, both achievements and failures in their own regard.

Flight 2942 - Quite positively evidence that HTTP requests will not do for real time games.

Bitmo Pirates MMO - A kind of turn based game that uses an HTTP server for requests and such. Evidence that you can make a 3D MMO in 48 hours, but it's an utterly dumb idea.

From my experience, unless you're only doing a few small things, don't use HTTP for a protocol.

edit:

I actually have a game that's a good example use of HTTP.

Patient Negative One does an http request on load, and when you die, and stores a bit of information. This was overall a great success!
Missing Sentinel Software | Twitter

FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
User avatar
Plu
Inner party member
Posts: 722
Joined: Fri Mar 15, 2013 9:36 pm

Re: Multiplayer using HTTP

Post by Plu »

If you want a Lua webserver to write the other end in, you can check out either Xavante which is fully Lua, or you can run OpenResty which is nginx with lua-support (and very fast).

There are options, but you're still stuck with +-10ms minimum for any communication. So nothing live-action.

Another option is of course to turn your own computer into a server. Or to purchase a Raspberry (they start at 5$ these days) and use that as a server.
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 75 guests