Hi guys i’m planning to make a wifi multiplayer game in android just like mini militia and i have been searching for long for a solution to implement this. In many forums i saw suggestions to use unet but it shows its deprecated and i think photon multiplayer supports only server based multiplayer. Can anyone help me regarding this.
can we use unet again?
The network discovery feature of Unet was a bit buggy, and doesn’t work on some android devices. I don’t think it is a popular feature either, as I can’t think of another network API which implements it (I admit I haven’t done an exhaustive search). If your game can support clients manually typing in the IP address of the server, most network API’s will work for what you’re trying to do though.
1. broadcast works strange on some android devices, especially on google pixel. But I think that wifi router will accept broadcasting…
2. The problem here not in broadcasting, but mostly with the automatic discovery hot spot device… in general wi-fi direct (some sort) should be used, but android solution is not compatible with iPhone…
You can try to use hot-spot solution, (you can use any network library for this) with unit do following
- Allow hot-spot on one device
- Connect other device to hot-spot device
3a. Start broadcasting onto-spot device and obtain connection on other device or
3b. check gateway address on other device and try to connect to hot-spot using this address
3b can be used with other libraries not only obsoleted unit lap
but which one to use for doing this?photon or unet? when i used unet its saying that its deprecated and photon forum says that photon does not support offline multiplayer
Hmm, you can try with unit, and you can ping @nxrighthere posts here fore enet using in unity. Transport api usually is pretty similar to each other, so you (I hope) will be able smoothly migrate to unity solution when it will be ready. Check as well @ posts afaik he was able to use this library with ecstatics and got awesome results, it doesn’t support broadcasting, so you will need to use 3b approach
ENet supports IPv4 broadcast out of the box, this feature enabled at the socket creation stage for hosts at both ends. All that you need to do is just send a connection request to 255.255.255.255 address, ENet will automatically respond to the broadcast and update the address to a server’s actual IP.
If you can use low level stuff where you send byte[ ] I’d recommend Google Play Games Service(Nearby Multiplayer) or tcpclient/udpclient. That Is what I am using.
does google play games support local wifi multiplayer