Local multiplayer with tcp/udp

Hi, I’m new to corona sdk and i’m currently developping an app.

I would like to develop a local multiplayer mode with tcp/udp.

I’ve seen the tutorial coronalabs.com/blog/2014/09/23/tutorial-local-multiplayer-with-udptcp/

but it seems like it is not working anymore due to lua sockets update. (I’ve tried the tutorial myself without success).

So I was wondering if there’s any way I could do a Local multiplayer mode (one device is a server, others are clients) that doesn’t require a wifi access?

Thank’s a lot.

Doesn’t require Wifi access? How would they communicate? Bluetooth. It is based on the old tutorial.

You can try my version but this one requires some sort of network connection (WIFI), I have not tried it in about 9 months but it use to work:

https://github.com/agramonte/zcrmmp

Hi,

Local multiplayer is possible without a Wifi connection, but it is not a trivial process. You need to build a server and client on device using LuaSocket, which is available through the API (https://docs.coronalabs.com/api/library/socket/index.html).

Building the server and client is something you’ll need to learn with other documentation.

-dev

Lua Socket still needs a data link layer. Phones do not have built in ethernet connection. So it is either wifi or bluetooth or a dongle with ethernet, or some sort of packet transmission.

Thank you all for your great responses :)!  So, if I understand, in order to create a (LAN) local multiplayer without any wi-fi access with lua sockets, bluetooth would be a good way to transmit packets between mobile devices? (one device would be the server and others would be clients)

Thanks in advance!

Yes you can use bluetooth last time I checked there are some marketplace plugins that you can use.

I don’t know your use case but if it is a office or static location it might be easier just to set up a wireless hub even if it is not connected to the internet. If it is critical that the person get the update, I would set up a small server that could receive and send the status updates. Now if you are just talking about a game that two people can play in the back seat on the road, I believe android and ios have options for local game play that rely on local network setup (might be wrong on this one).

Especially on Android with all the different bluetooth implementations, I don’t know how reliably the bluetooth scenario would work. I wish you luck.

On a side note somebody here wanted to use my modified library for an app that would communicate between tables with iphone devices and an ipad or a window machine in the kitchen. The problem with my modified library is that it uses auto discovery to find the clients for the game and then shutdowns the auto discovery feature once the number of clients is reached. I was trying to solve my particular use case and didn’t think of the bigger picture. You can remove all the bonjour plugin code from it and just use a configured static port to make the solution much easier especially if everything is static.