hengineer / CaptainsMess

A local multiplayer networking library for making games like Spaceteam in Unity
MIT License
184 stars 21 forks source link

new universal Bluetooth plugin on the AssetStore #14

Open StefanoCecere opened 4 years ago

StefanoCecere commented 4 years ago

hi what do you think of this? https://assetstore.unity.com/packages/tools/network/bluetooth-networking-for-ios-tvos-and-android-124274

i'm going to buy and test it.. sounds working

hengineer commented 4 years ago

Looks interesting. I am actually contracting someone to help me update the Android bluetooth plugin in CaptainsMess and make general improvements. The work is almost finished! As part of the task he did some research on existing Asset Store plugins so I'll ask him if he investigated this one.

hengineer commented 4 years ago

(I found my notes on this). This plugin did look promising but we decided not to use it for CaptainsMess because it only uses BluetoothLE and the bandwidth is just too low for my games. It seems like the maximum packet size is 20 bytes with a maximum of 10 packets per second (so 200/bytes/sec). This might work fine for you, and it would normally work fine for something like Spaceteam but sometimes I need to share some "large" data (say, 50k) between players like a custom word list, and this would take more than 4 minutes at BluetoothLE speeds. So we decided to build our own plugin on top of regular Bluetooth where the transfer rates are much higher. It's not cross-platform though unfortunately :(

StefanoCecere commented 4 years ago

It's not cross-platform though unfortunately :(

thanks for the details! but what do you mean with this closing sentence?

hengineer commented 4 years ago

Well the BluetoothLE plugin mentioned above seems like it will connect iOS and Android devices. The Bluetooth plugins in CaptainsMess (coming very soon!) only connect iOS-to-iOS or Android-to-Android.

Wifi and Internet modes will work cross-platform (iOS-to-Android) but Bluetooth has this restriction at the system level and I don't think it's possible to solve it.

StefanoCecere commented 4 years ago

thank you.. makes sense (if local wifi is supported it's the best compromise)

hengineer commented 4 years ago

Yeah Wifi is the preferred method, and you can also set up one device as a Hotspot even if there's no other wifi available but Bluetooth is useful in certain situations so it's important to me to have it supported.