I am developing a 3D Wi-Fi multiplayer game for iPhone and iPad without using any game engine. I have taken reference of the “WiTap” sample for device connectivity for local Wi-Fi multiplayer game (Link to the sample code:WiTap).
I found that there is a performance drop in the game when I set “includesPeerToPeer” property to YES, but I found that the game performance is better when I set “includesPeerToPeer” property to NO. Also, the game performance drop is more when the device bluetooth is turned ON. I am setting this property to YES to allow faster discovery of devices (to avoid bug described here:Bug).I am testing my game on iPhone 5 (running on iOS 8.4) and iPad 3rd generation (running on iOS 7.1).
I have two questions:
How includesPeerToPeer property of NSNetservice can affect my game performance? What is the difference in the connection establishment between the two devices when I set the property to YES or NO (and device bluetooth is turned OFF)?
When devices bluetooth is kept ON, why there is a performance drop? Are these devices connected via bluetooth whenever bluetooth is available? If yes, how can I restrict my devices to communicate only over Wi-Fi?
I’d appreciate any suggestions on this issue. Thank you in advance.