Page 1 of 1

Help needed for a local "multiplayer" game

Posted: Fri Sep 06, 2019 12:51 am
by Kulbeans
Hi everyone,

First of all, I'm fairly new to game development in general and Love2d in specific so I apologise for any noob question I might have. I would like to a have a quick brainstorm with you regarding my project and how can I approach it with Love2d.

Right now I have a Nodejs application (the game backend) that's running on a Raspberry Pi. There are a couple controllers connect via USB (next step is having them wirelessly). The game frontend/GUI is a simple thing I'm developing in React as a Web app. That way I could open it in a browser locally, show it on a TV through HDMI while people use their controllers. I also need to have someone connected through a different interface (let's call it an admin panel) to control some things of the game while it's running through a smartphone. I would like to use Love2d to spice up the main GUI, without being limited by a Web framework (also make the development quicker).

My questions are:
a) is this a good use case to use Love2d?
b) can I run Love2d on a Raspberry Pi? If so, how?
c) can I use the same Nodejs backend?
d) Are sockets supported?
e) how can I do with the admin panel?

Thanks!

Re: Help needed for a local "multiplayer" game

Posted: Fri Sep 06, 2019 6:17 am
by ivan
Just to clarify, is this a split/shared screen game? If "yes" then why do you need a backend at all?
Love2D supports multiple controllers which is enough for a couch multiplayer game - no need for a server/backend at all.
LuaSocket is included with Love2D and it works quite well (no support for HTTPS though).

Re: Help needed for a local "multiplayer" game

Posted: Tue Sep 10, 2019 9:09 pm
by Kulbeans
ivan wrote: Fri Sep 06, 2019 6:17 am Just to clarify, is this a split/shared screen game? If "yes" then why do you need a backend at all?
Love2D supports multiple controllers which is enough for a couch multiplayer game - no need for a server/backend at all.
LuaSocket is included with Love2D and it works quite well (no support for HTTPS though).

Everyone should be playing in the same screen (it's a trivia game). The backend would be so we can connect to the admin panel via a mobile phone, but I am open to other ideas.
What kind of controllers are we talking about? Because these are not traditional ones...
Thanks for all the info!

Re: Help needed for a local "multiplayer" game

Posted: Wed Sep 11, 2019 7:03 am
by ivan
developing in React as a Web app
Ok so I think I understand now.
For your Love2D client I would recommend downloading the trivia data/content when booting and then running the game session locally.
As mentioned before, LuaSocket could be used to make HTTP requests.
It doesn't really matter how the backend works since it would communicate with Love2D using HTTP.
I think administering the game "while in progress" would make things considerably more difficult for both your backend and Love2d client.

Re: Help needed for a local "multiplayer" game

Posted: Wed Sep 11, 2019 12:39 pm
by Kulbeans
ivan wrote: Wed Sep 11, 2019 7:03 am
developing in React as a Web app
Ok so I think I understand now.
For your Love2D client I would recommend downloading the trivia data/content when booting and then running the game session locally.
As mentioned before, LuaSocket could be used to make HTTP requests.
It doesn't really matter how the backend works since it would communicate with Love2D using HTTP.
I think administering the game "while in progress" would make things considerably more difficult for both your backend and Love2d client.
Got it, seems OK to me.
Having the admin panel is a must for what I want to do... As far as I could understand from the docs, LuaSocket doesn't work like a socket, right? Is there a way I can use sockets with Love2d?
Thanks again!

Re: Help needed for a local "multiplayer" game

Posted: Wed Sep 11, 2019 1:46 pm
by raidho36
LuaSocket is just a Lua interface for standard OS sockets library. It's a Lua-specific program so you just load it from Lua.