Page 2 of 2

Re: Multiplayer using HTTP

Posted: Sat Oct 15, 2016 9:34 pm
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

Re: Multiplayer using HTTP

Posted: Sun Oct 16, 2016 6:20 pm
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 ;)

Re: Multiplayer using HTTP

Posted: Mon Oct 17, 2016 9:46 pm
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!

Re: Multiplayer using HTTP

Posted: Sun Oct 23, 2016 9:05 pm
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.