Page 1 of 2

[Solved] Easy way to make a multiplayer?

Posted: Tue Mar 25, 2014 10:28 pm
by Diehl
Hello everyone, how are you?

My group and I are starting the development of a new game, which we wish to place an order online multiplayer matches. The big problem is that none of us know how to make online connections with Löve.

I would like to know if any of you know an easy way to create online matches with Löve, preferably in a manner which the players themselves can 'host' matches without the need for a third machine to perform the function "host". It would also be nice if we could support up to 4 simultaneous players ...

So does anyone know how to do this?

Since now, thank you for your attention.

Re: Easy way to make a multiplayer?

Posted: Tue Mar 25, 2014 10:38 pm
by Przemator
There is LUBE

https://love2d.org/wiki/LUBE

And there is lua-enet

http://leafo.net/lua-enet/

I assume it's better to use lua-enet.

Re: Easy way to make a multiplayer?

Posted: Thu Mar 27, 2014 10:27 pm
by Diehl
Przemator wrote:There is LUBE

https://love2d.org/wiki/LUBE

And there is lua-enet

http://leafo.net/lua-enet/

I assume it's better to use lua-enet.
Thanks, I will test both.

Re: Easy way to make a multiplayer?

Posted: Fri Mar 28, 2014 10:02 am
by Germanunkol
I hate to be that guy, but I feel I should warn you: There is no "easy" way to make a multiplayer game. If you're a team of a few people, I recommend dedicating one of you almost fully to multiplayer support.

As for the hosting you mentioned:
You don't want to have any server on the internet from what I understand. This means that people playing together will need to manually send each other their IPs (more specifically, the host needs to send the IP to the other players). Online servers are often used for matchmaking or server lists - but this requires a host with a set, fixed IP or at least a URL. Also, the hosting player will need to port-forward the ports you're connecting on, if he/she is behind a firewall.

Another thing: I found it easiest to make the server a seperate program altogether, rather than a client with more privileges. It makes the game much easier to handle if all clients are treated exactly the same. But this is up to you, really.

With all that said: Good luck! Hope it works out well...

Re: Easy way to make a multiplayer?

Posted: Fri Mar 28, 2014 10:08 am
by kikito
Germanunkol wrote:There is no "easy" way to make a multiplayer game.
I am of the same opinion. Multiplayer is one of those "intrinsically complex" things.

Re: Easy way to make a multiplayer?

Posted: Sun Mar 30, 2014 11:41 pm
by Diehl
Oh, yeah ... We've even given up on making online multiplayer.

However, we still think about making a multiplayer mode, but only local, with split-screen. Does anyone know how we could to do this?

Thank you for your attention.

Re: Easy way to make a multiplayer?

Posted: Mon Mar 31, 2014 12:00 am
by Jeeper
Diehl wrote:Oh, yeah ... We've even given up on making online multiplayer.

However, we still think about making a multiplayer mode, but only local, with split-screen. Does anyone know how we could to do this?

Thank you for your attention.
You need to be more specific on what it is that you wonder. Very vague questions will get very vague answers. If you make local multiplayer game, then all you pretty much need to do is fix the input method and 2 cameras. ^^

Re: Easy way to make a multiplayer?

Posted: Mon Mar 31, 2014 9:03 am
by Germanunkol
Well, for split screen, this might get you started:
viewtopic.php?t=8427
It's old, but I guess it still applies. Only note that the newFrameBuffer function has been renamed to newCanvas - if you want to go for that method.

I would try the setSissors function first - simply draw the whole scene, but offset it by a quarter of the screen size to the left and set sissors which only display the left half of the screen. Then do the same thing again for the right side.
Make sure to draw any UI elements AFTER releasing all the sissors again.

Re: Easy way to make a multiplayer?

Posted: Mon Mar 31, 2014 12:47 pm
by JackHide
Tks men.

We will try this, i think it will work! ^^

Re: Easy way to make a multiplayer?

Posted: Mon Mar 31, 2014 2:27 pm
by kikito
My camera lib can help you draw the split screen (it's limited to rectangular regions though)

viewtopic.php?f=5&t=12033