Page 1 of 3

Desired tutorial - multiplayer

Posted: Tue Jun 21, 2011 2:46 pm
by Taehl
I just realized that we don't have a decent networking tutorial yet, which is a shame.

It would be really nice if someone wrote one which covered the following:
1) Start by making a simple "game" where each player is a randomly-colored circle on a screen with some walls or something
2) Using LuaSocket (or maybe Lube), make a server and client (maybe as separate .love files)
3) The client would connect to the server and then tell the server when a player pressed movement keys. Note: I definitely think we should impress the values of non-authoritative clients even on this simplest of networking tutorials.
4) The server would take the client's movement requests, simulate them (i.e., make sure they don't go through walls), and then upload the new positions of each player's circle
5) When a client disconnects, the server removes their circle. Likewise, if the server quits, gracefully disconnect the clients.

It wouldn't need to cover lag-compensating systems or the like, it would just be a simple thing meant to familiarize people with networking and the (non-authoritative) client / server model.

Re: Desired tutorial - multiplayer

Posted: Tue Jun 21, 2011 9:21 pm
by Jasoco
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.

Re: Desired tutorial - multiplayer

Posted: Tue Jun 21, 2011 9:46 pm
by tentus
I also would find this very useful: I took a close look at Volleybrawl once and couldn't make heads or tails of it. A tutorial for how to make networked pong or something would be fantastic.

Re: Desired tutorial - multiplayer

Posted: Wed Jun 22, 2011 12:17 am
by TechnoCat

Re: Desired tutorial - multiplayer

Posted: Wed Jun 22, 2011 3:51 am
by Jasoco
Do any of those tell you right out how to do it with Löve?

Re: Desired tutorial - multiplayer

Posted: Wed Jun 22, 2011 8:04 pm
by TechnoCat
Jasoco wrote:Do any of those tell you right out how to do it with Löve?
No, but LOVE also doesn't abstract anything network related.

Re: Desired tutorial - multiplayer

Posted: Thu Jun 23, 2011 4:21 am
by tentus
But Lube does, as mentioned in step 2. (Unless I'm woefully confused.)

Re: Desired tutorial - multiplayer

Posted: Thu Jun 23, 2011 12:15 pm
by Wrinkliez
TechnoCat wrote:
Jasoco wrote:Do any of those tell you right out how to do it with Löve?
No, but LOVE also doesn't abstract anything network related.
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...

Re: Desired tutorial - multiplayer

Posted: Thu Jun 23, 2011 1:37 pm
by Robin
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.

Re: Desired tutorial - multiplayer

Posted: Thu Jun 23, 2011 9:30 pm
by visionpol
Technocat has a post on page 22 of the LUBE thread with attached .love files to start a server and a client. There are links to bartbes's LUBE-demo in the post that lead to NetPong server/client files. I can't honestly say that I've taken the time to look through all of the NetPong code, but I wager that it's the kind of thing you're looking for.