Desired tutorial - multiplayer

General discussion about LÖVE, Lua, game development, puns, and unicorns.
User avatar
Jasoco
Inner party member
Posts: 3727
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Desired tutorial - multiplayer

Post by Jasoco »

I could never get that to work at all. And the current download seems to be for 0.5.0.... That was like forever ago! We need one for 0.7!
User avatar
Elvashi
Prole
Posts: 45
Joined: Sat Jul 04, 2009 9:17 am
Location: Australia

Re: Desired tutorial - multiplayer

Post by Elvashi »

Networking with UDP

^_^

Okay, its not that good. :oops: But its there, I made it, it exists...and will hopefully be a useful foundation for an article that will help many young lovers in the future (hopefully...maybe... )

I'll see what I can do about making one on TCP, though someone will probably beat me to it.
Last edited by Elvashi on Tue Jun 28, 2011 12:15 am, edited 1 time in total.
"We could make a program for doing this for you, but that is for the LÖVE IDE, planned to be released in March 2142." ~mike
Networking with UDP uLove Proposal CCG: Gangrene
User avatar
Ryne
Party member
Posts: 444
Joined: Fri Jan 29, 2010 11:10 am

Re: Desired tutorial - multiplayer

Post by Ryne »

Robin wrote:
Wrinkliez wrote:Imho, I think a tutorial would be awesome. A nub is much more likely to check the wiki or a Love2D tutorial, especially if Love is their first language...
Didn't someone write a LUBE tutorial? I can't remember who, where or when, though.
Well libraries are another thing. It took me a little while before I realized what libraries were and how to use them (I knew nothing of programming when I started love), so a tutorial explaining what they are, and even how to use them would be awesome too.
@rynesaur
User avatar
Wrinkliez
Prole
Posts: 33
Joined: Tue Mar 15, 2011 4:56 am

Re: Desired tutorial - multiplayer

Post by Wrinkliez »

Elvashi wrote:Networking with UDP

^_^

Okay, its not that good. :oops: But its there, I made it, it exists...and will hopefully be a useful foundation for an article that will help many young lovers in the future (hopefully...maybe... )

I'll see what I can do about making one on TCP, though someone will probably beat me to it.
cool dood! I have a question, what are the pros / cons to using udp compared to lube? All I can see is that lube is apparently much easier lol
User avatar
nevon
Commander of the Circuloids
Posts: 938
Joined: Thu Feb 14, 2008 8:25 pm
Location: Stockholm, Sweden
Contact:

Re: Desired tutorial - multiplayer

Post by nevon »

Wrinkliez wrote:
Elvashi wrote:Networking with UDP

^_^

Okay, its not that good. :oops: But its there, I made it, it exists...and will hopefully be a useful foundation for an article that will help many young lovers in the future (hopefully...maybe... )

I'll see what I can do about making one on TCP, though someone will probably beat me to it.
cool dood! I have a question, what are the pros / cons to using udp compared to lube? All I can see is that lube is apparently much easier lol
Lube is simply a library that makes it easier to work with sockets. UDP and TCP are protocols that can both be used via Luasocket (which is what Lube lies on top of).
User avatar
TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Milwaukee, WI
Contact:

Re: Desired tutorial - multiplayer

Post by TechnoCat »

Wrinkliez wrote:cool dood! I have a question, what are the pros / cons to using udp compared to lube? All I can see is that lube is apparently much easier lol
The question hidden in your question is "UDP or TCP?"
TCP is a reliable connection.
UDP is a faster connection, but of course, unreliable.

TCP is constantly checking and making sure it gets all of the messages in order.
UDP just kind of dumps them all out and hopes the other end gets them...

Note: Depends on implementation of course.
http://www.gutgames.com/post/TCPIP-vs-UDP.aspx
User avatar
miko
Party member
Posts: 410
Joined: Fri Nov 26, 2010 2:25 pm
Location: PL

Re: Desired tutorial - multiplayer

Post by miko »

TechnoCat wrote: TCP is a reliable connection.
UDP is a faster connection, but of course, unreliable.
That is the theory. I have yet to see any dropped UDP packet in my tests. In today's internet you can assume UDP is near 100% reliable (check for yourself). And it can get through NAT/firewalls easier than TCP.
So most probably you want to use UDP.
My lovely code lives at GitHub: http://github.com/miko/Love2d-samples
User avatar
slime
Solid Snayke
Posts: 3166
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Desired tutorial - multiplayer

Post by slime »

UDP is nearly always the preferable option for time-sensitive information like position, velocity etc. in a real-time game.
User avatar
miko
Party member
Posts: 410
Joined: Fri Nov 26, 2010 2:25 pm
Location: PL

Re: Desired tutorial - multiplayer

Post by miko »

Jasoco wrote:Yes please. I can't make heads nor tails of any of the already existing multiplayer games because there's way too much code I wouldn't need that hides the stuff I do.

Just give me a simple framework that demonstrates how to do simple sending and receiving.
So no one responded yet? What a pity... So, I am attaching my sample code. This is not a real tutorial, but if someone is willing to write one, go ahead.

I wrote 2 helper libraries which try to hide everything unimportant away from you, so you can concentrate on the game logic. So:
  • - unzip the file
    - point your browser to doc/index.html
    - open stage1/*.lua and then stage2/*.lua in your editor
    - have fun
I hope it will help you. If so, make some multiplayer games for us ;)
Attachments
MultiCircles.zip
Multiplayer example with UDP networking
(311.93 KiB) Downloaded 443 times
My lovely code lives at GitHub: http://github.com/miko/Love2d-samples
User avatar
TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Milwaukee, WI
Contact:

Re: Desired tutorial - multiplayer

Post by TechnoCat »

I used the tutorial on the wiki to create a networked connect-4 game. Thanks elvashi. It took me about 2 hours to write.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests