Hi there, do there any dev who wrote iPhone wifi/bluetooth multiplay before? Recently, I'm trying to make my latest game Doodle Kart to have mulityplay via bluetooth. But I found that there are hugh data need to share between the 2 devices. -your car's position and direction -your car's status(it is in normal state, it is hitting by bullet, it is falling into to hole....) -CUP car's position, dicretion, and their status -items position and status (pencil, bullet...) I'm thinking about one device calculate all the things, and the other device just wait and receive the data to display on the screen. Does it make sense? Hey, I should ask you the most important question first: Do you think it's possible to make bluetooth multiplay work on my game? It's just too much data need to share between the device. You can have a look on my game here:
Should be doable, you just need to vastly simplify your data transmission. You could go with a host/client model, but the send/recieve for the client will be longer than multicast, and the host will need to do a lot of calc. Personally, I would do some predictive code, with small dual/mult cast updates. transmit 2d x,y for player cars, event signals (one byte if possible), and just let the game handle the rest as usual. All you would need is to give the enemy car ai a 2d coord every 2-4 frames (let it fill in the rest), don't let the ai use weapons without an event, and possible pre-calc the powerups at race start, and sync during the stop light start sequence. Just my thoughts, Cheers, Galen
Thanks and I'll try to code later. Recently I'm still studying the bluetooth sample code downloaded from the Apple dev site. (GKTank). I found that if both of the devices' wifi is turned on during the bluetooth multiplay, the game will be data transfer is very slow and even show out the 'disconnect and retry' message frenquently. But it works well if both devices' wifi is turned off. I don't know why there are so large difference when wifi turns on/off.
Bluetooth is completely unreliable on iPhone when Wifi is turned on because both connection types shares same antenna. Regarding Bluetooth in your game I don't see why it shouldn't work? Just pack your data wisely and use unreliable sending mode as game is real time and it should be fine.
I'm still trying the apple's sample code(GKTank). Both devices can detect another device. But when I click the deteced device, it will show a dialog saying "Waiting for xx's iPhone". Sometimes, it holds the dialog for over than 5 minutes and still no any response. What's going wrong?