Page 2 of 3

Re: Desired tutorial - multiplayer

Posted: Thu Jun 23, 2011 10:38 pm
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!

Re: Desired tutorial - multiplayer

Posted: Mon Jun 27, 2011 3:42 pm
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.

Re: Desired tutorial - multiplayer

Posted: Mon Jun 27, 2011 7:44 pm
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.

Re: Desired tutorial - multiplayer

Posted: Tue Jun 28, 2011 1:26 pm
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

Re: Desired tutorial - multiplayer

Posted: Tue Jun 28, 2011 2:48 pm
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).

Re: Desired tutorial - multiplayer

Posted: Tue Jun 28, 2011 6:25 pm
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

Re: Desired tutorial - multiplayer

Posted: Tue Jun 28, 2011 9:46 pm
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.

Re: Desired tutorial - multiplayer

Posted: Tue Jun 28, 2011 10:30 pm
by slime
UDP is nearly always the preferable option for time-sensitive information like position, velocity etc. in a real-time game.

Re: Desired tutorial - multiplayer

Posted: Thu Jul 07, 2011 2:20 pm
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 ;)

Re: Desired tutorial - multiplayer

Posted: Sun Jul 24, 2011 7:08 pm
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.