[Solved] Easy way to make a multiplayer?

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
Diehl
Prole
Posts: 29
Joined: Tue Aug 27, 2013 10:53 am
Contact:

[Solved] Easy way to make a multiplayer?

Post 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.
Last edited by Diehl on Wed Apr 02, 2014 10:25 pm, edited 1 time in total.
User avatar
Przemator
Party member
Posts: 107
Joined: Fri Sep 28, 2012 6:59 pm

Re: Easy way to make a multiplayer?

Post 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.
User avatar
Diehl
Prole
Posts: 29
Joined: Tue Aug 27, 2013 10:53 am
Contact:

Re: Easy way to make a multiplayer?

Post 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.
Germanunkol
Party member
Posts: 712
Joined: Fri Jun 22, 2012 4:54 pm
Contact:

Re: Easy way to make a multiplayer?

Post 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...
trAInsported - Write AI to control your trains
Bandana (Dev blog) - Platformer featuring an awesome little ninja by Micha and me
GridCars - Our jam entry for LD31
Germanunkol.de
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: Easy way to make a multiplayer?

Post 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.
When I write def I mean function.
User avatar
Diehl
Prole
Posts: 29
Joined: Tue Aug 27, 2013 10:53 am
Contact:

Re: Easy way to make a multiplayer?

Post 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.
User avatar
Jeeper
Party member
Posts: 611
Joined: Tue Mar 12, 2013 7:11 pm
Contact:

Re: Easy way to make a multiplayer?

Post 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. ^^
Germanunkol
Party member
Posts: 712
Joined: Fri Jun 22, 2012 4:54 pm
Contact:

Re: Easy way to make a multiplayer?

Post 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.
trAInsported - Write AI to control your trains
Bandana (Dev blog) - Platformer featuring an awesome little ninja by Micha and me
GridCars - Our jam entry for LD31
Germanunkol.de
User avatar
JackHide
Prole
Posts: 7
Joined: Sun Sep 22, 2013 12:33 am
Location: Porto Alegre - Brazil

Re: Easy way to make a multiplayer?

Post by JackHide »

Tks men.

We will try this, i think it will work! ^^
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: Easy way to make a multiplayer?

Post 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
When I write def I mean function.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 7 guests