★ TouchArcade needs your help. Click here to support us on Patreon.

any dev who experience in multiplay?

03-11-2010, 02:10 AM
#1
Joined: Jul 2009
Posts: 144
any dev who experience in multiplay?

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:

Youtube link | Pop Up
03-11-2010, 02:28 AM
#2
Really nice game. Sure you can make multiplayer. Downlaoding lite version

03-11-2010, 09:26 AM
#3
Joined: Jul 2009
Location: Newfoundland
Posts: 31
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
03-11-2010, 10:13 AM
#4
Joined: Mar 2010
Location: PA
Posts: 22
Nifty little game, I'm curious how you did the recording with the touch points though?
03-14-2010, 09:33 PM
#5
Joined: Jul 2009
Posts: 144
Quote:
Originally Posted by galent View Post
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.
03-15-2010, 05:15 AM
#6
Joined: Oct 2009
Posts: 249
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.

Start your engines gentlemen, Vector Rally is out!

---
Twitter: http://twitter.com/VectorRally

Last edited by eJayStudios; 03-15-2010 at 05:18 AM.
03-16-2010, 08:58 AM
#7
Joined: Jul 2009
Posts: 144
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?
03-16-2010, 10:14 AM
#8
It's waiting for xx's iPhone.