Local multiplayer example

#1

Hi :defold:,
some time ago I wanted to understand how I could possibly program a local multiplayer for a game. I wanted to learn everything from binoculars, so I decided to use only the Lua socket library. To represent the functions, I decided to program a simple chat between two computers. I used the UDP protocol and programmed the broadcasting, so the peers will automatically establish a connection.
I think it can help a lot for anyone who would like to learn how everything works. So here it is.

p2p.zip (6.9 MB)

p2p - Windows example.zip (9.4 MB)

And here video for visualization:

12 Likes

#2

Hi @Karel thanks for sharing, interesting to check :slight_smile:

just a little note: these days, if you want to share something in the public, it’s better to upload it to the github (for example) instead of attaching archives as zip.

4 Likes

#3

Thank you very much for the type, here it is. :grinning:

4 Likes