[RELEASED] Local Multiplayer for iOS/tvOS/macOS

3096399--233709--forum_logo.png
3096399--236745--1_alpha.png

Asset Store - Pro version
Asset Store - Indie version
Check out the Android version

Ever wanted to have local multiplayer in your game that just works? With Local Multiplayer for iOS/tvOS/macOS, you can. It enables you to implement local hassle-free multiplayer to your game with just a few lines of code. Connection between devices is done automatically using whatever connectivity options are available — Bluetooth, WiFi, Peer-to-Peer WiFi, Ethernet, all without any setup! It integrates seamlessly with Unity’s built-in networking system, which means you can easily reuse your networking code with minimal changes, or use any of existing tutorials about Unity built-in networking.

Highlights:

  • Runs on the whole spectrum of Apple devices based on iOS (iPhone, iPad, iPod), tvOS (Apple TV), and macOS.
  • True peer-to-peer connection - no need to have all devices connected to the same network.
  • Fully compatible with Unity’s built-in UNet multiplayer component. No need to write special networking code!
  • Documented demo examples and components to get you started immediately.
  • Powerful API to cover even advanced use cases.
  • Comprehensive online documentation.
  • Supports iOS 7.0 or newer, tvOS 10.0 or newer, macOS 10.10 or newer.
  • macOS Unity editor is supported as well - no need to build on multiple devices when developing.

Requires Unity 5.4 or newer.

Local Multiplayer for iOS/tvOS/macOS is available in two versions: Indie and Pro. They are functionally identical, the only difference is that Pro version includes the full source code (C# + Objective-C), while Indie version does not. You are able to upgrade to Pro version from Indie at any time.

Free evaluation version is available upon request.

Contact

Issues? Questions? Suggestions? Feel free to contact:

If you like the asset, please review/rate it on the Asset Store, I’ll greatly appreciate that :slight_smile:

3 Likes

Awesome! When can i expect the asset to be available? How much will it cost?

Can i use it for games which require immidiate response from players like for instance pong, fighting or racing games?

What is the maximum number of players on which the performance is acceptable (0-170 ms). On what kind of game(s) did you try this out?

Have you tested it on the new ios 11 beta? If not would you be able to test it on that version? I’m building a game which is targeted for ios 11.

Hopefully, somewhere next week. I really have no control here, everything depends on the Asset Store vetting team now. However, I am now preparing a free evaluation version, I’ll make it available for download in a few days.
When it is released, the Indie version will cost $40, and the Pro version will cost $70. The only difference is that Pro comes will full source code, so for pretty much all purposes Indie will be sufficient.

I’d say yes, it can be used for these kind of games. There are some caveats, though. Imagine three devices A, B, and C. Device A has only WiFi enabled, device B has both WiFi and Bluetooth enabled, and device C only has Bluetooth enabled. Device A creates a game, device B joins it over WiFi, everything is fine. But now, if device C tries to join the same session… oops, WiFi is off. What will happen is that traffic from C will first travel to B via Bluetooth, and B will then retransmit it to A. So for optimal performance, all devices have to use the same connection method.
I don’t have a whole bunch of devices to test how good it works, unfortunately. But really, it’s impossible to predict how well it will work in a specific project. At the very least, different projects have different requirements to the amount of data that’s being transferred. Here’s what I know, though: in a stress-test with 2 devices (iPhone 5 and an iPhone Simulator), and 100 moving actors controlled by each player on each device, in a WiFi network, the RTT was around 10-30, which I think is pretty good. It should be better on real devices, though - I wouldn’t entirely trust the Simulator. Also, the performance over Bluetooth will degrade faster as the number of players increases, compared to WiFi.
I haven’t tried it on any “real” games yet, just the demos that are included with the asset. I know one game is being developed with it already, but it is a card game, so probably not what you are looking for :slight_smile:

I haven’t yet. My iPhone 5 will have no support for iOS 11, and I’m pretty reluctant to install the preview version of macOS, to be honest. However, I’m 100% confident there won’t be any issues. The asset is built on top of Apple’s Multipeer Connectivity framework that was introduced back in iOS 7, and it worked the same since then. But if you already have iOS 11 beta installed, you’ll be able to try it out yourself when the evaluation version is released.
Hope this helps!

2 Likes

Awesome! It sounds liked you’ve done a great job. I’m definitely interested in your pro version. I hope your product will be approved asap.

Thanks for your quick and extensive answer!

Do you have any video examples of it in action? Extremely curious as to how well it runs and how easy the setup is when using Bluetooth.

only IOS or does it work with Android too … or do i have to buy both of your packs for ios and android? … and does the connection between ios and android work?

Good news everyone!
The day has come. Local Multiplayer for iOS/tvOS/macOS is now available on Asset Store!

I know you guys are awesome, and that you will create really cool and entertaining stuff with it :slight_smile: Have fun developing!

Asset Store - Pro version
Asset Store - Indie version

If you want to try before you buy, send me an email or a PM, and you’ll receive a fully functional evaluation version.

I don’t have any videos, unfortunately. However, if you want to try it out, drop me a message, and I’ll send you an evaluation version so you can try it yourself.

Apple only allows direct communication between Apple devices. Nothing can be done about it. If you want to support Android Bluetooth multiplayer as well, then yes, the easiest way would be to use Android Bluetooth Multiplayer, but these are separate assets and are not compatible with each other.

I know that for $40, I shouldn’t expect much of a documentation (thank you ZimM for doing this!), but the learning curve is still steep. I think it would have reduced the learning curve if you had given us a modified version of the Unity’s Network Lobby asset, rather than rolling your own demo. On the other hand, I guess doing exactly that on my own (shoe-horning AppleLocalMultiplayer into the Unity’s Network Lobby demo) is a good way to really learn this stuff.

I’ve just stumbled across your asset today, and it might be just the thing I need. However, I have some questions, but also maybe the evaluation version you’re talking about.
So I’m creating an app, where the iOS part will be native iOS, since this only works as the controller. tvOS will be the game and needs to connect with the controller. E.g. receive inputs, such as a string and player who have joined etc. Do you think your library is overkill and would you recommend me looking somewhere else for this, or would it work with your asset? I mean I would probably need the pro version since I would need to know the “serviceType” etc.

I have everything working iOS to tvOS with the build in multipeer module, but it’s the iOS to Unity that’s my issue now.

@ZimM_1 - I ended up buying your asset, it works great (even on ios11)! Just a couple of questions - first, I wrote some code which used the NetworkManager.singleton.client.Send function to send a rotation value to the clients. However, what I’m seeing on the client’s device is quite jittery - especially compared to the demo scene. Should I be using the network transform in this case instead? Is this send function slower than using that Network transform API?

Also, I’m running into some minor bugs - for instance if a low battery notification goes off during the multiplayer interaction, the client disconnects…

Good stuff, I’m testing the Indie Version for ARKit. Most of the function that I want it do is working so far. I can instantiate the players, they can translate and ARKit is working properly. I put two 3d characters and they translating pretty good. There are some glitches maybe because of ARKit. Thank you for log, it helps me solved the issue quicker.

I just picked this up and it works great over wifi but I can’t get two devices connecting with wifi off using bluetooth or personal hotspot from my phone.

Is there a trick to getting a connection working with wifi turned off on both devices using personal hotspots through bluetooth?
In MultiplayerDemo scene I can start a server on either device, connect from the other device, hit accept. But the connection never finishes. The log status says “Connecting” then a few seconds later says “Not Connected”.
Internet works so the hotspot is working.

I wanted to upload a test APP to Testflight but in Xcode Product → Archive fails with the error:
ld: bitcode bundle could not be generated because …
… libUnityMultipeerConnectivity.a

Turning off “Enable Bitcode” in X-Code under Build Options fixes this.

Do I need to Pro version to have bit code enabled?

That’s a pretty good idea. Though I believe the included are good enough. Actually, I had no clue about Unity’s Network Lobby until well after the plugin was released :slight_smile:

It is certainly possible to do this with my asset. It doesn’t really look like an overkill to me. If it were implementing this kind of project, I would probably be using UNet anyway.
For the evaluation version, just PM me here on the forum, or send an email to contact@lostpolygon.com

Just sending out raw data is not enough. It is just not frequently enough to produce smooth movement. Basically, if you send the rotation 20 times a second, visually it will look like if your game is running at 20 FPS. If you are sending the rotation manually, you have to implement interpolation to make it smooth.
The demo uses default interpolation provided by NetworkTransform to smooth out the movement, which makes it much easier.

Unfortunately, there isn’t much I can do with this, nor can I give any real advice :frowning: The asset operates on top of Apple-provided MultipeerConnectivity framework, which makes the connection using whatever method it finds best. And sometimes, with some combinations of device/iOS version… it just won’t work. In most cases, the reason is mismatching iOS versions.
Unfortunately, Apple designed MultipeerConnectivity as a black box. It never gives away any information about why exactly the connection failed, or even what type of connection is used.

No, of course you are not supposed to use Pro just for bitcode support. Please check the latest 1.0.2.0 update that I’ve just pushed, it has bitcode enabled on native libraries.

I want use your (Local Multiplayer for iOS/tvOS/macO) develop Ar multiplayer game! Your product support for Ar game? You have any solution ! Thank you!

The type of project doesn’t matter, you can use this plugin for anything, including AR.

Does this support streaming data or just send messages back and forth?

Just purchased your plugin! Everything is working as intended so far, and is very impressive.

Our game doesn’t use UNET. Is there a way to manually send byte arrays across an established connection in your API to a specific peer or array of peers? (both reliable and unreliable messages). I couldn’t find anything that did that when skimming through your c# classes. Thanks!

I sent a PM to @ZimM_1 a few days ago but did not hear back yet…so reaching out to the community

@gamecakestudios Did you get this working without UNET? I am in the same situation and was wondering if there is any API functionality that allows communication between peers

Is anyone using this as a controller (i.e. Iphones controlling game that runs on Apple TV) ??? — i understand from the thread that it has a 20ms reaction time…can anyone confirm the min / max time for sending messages between peers (let’s say 2-4 iphone controllers connected to 1 AppleTV)