This takes a little backstory, bear with me.
This is also a very general question, and I'm aware that without greater specifics the best answer might be "it depends."
So the context is that we're doing a real-time two-player iPhone game, with one iPhone acting as host and the other as client.
One of the things that's happening in the game, that needs to sync properly across devices, is similar to a Break-Out style situation: multiple rows of bricks at the top of the screen and a ball that bounces up and destroys them.
The wrinkle is that the projectile is more like a bullet than a ball. It takes out all the bricks in its path.
So to sync this across devices, what we're doing is calculating all the bricks that will be hit as soon as the bullet launches along a given trajectory. We have to do this because due to the physics model we're using, if we just launch the bullet at the identical angle and identical velocity on each of the two devices, the bullet ends up taking out slightly different bricks on each device.
So that's the task at hand: we need a calculation of all the bricks that will be taken out by a given bullet. Once we have that, we can send that array to the client, and then (ideally) the clients knows what bricks to take out before the bullet actually hits them, and the games sync infinitely better than if the collisions were reported in real time.
The last important element to consider is that there can be lots of bullets shooting at once. Anywhere from 4-40+ of these arrays need to be calculated as rapidly as possible.
So what's the best way to do it? We've thought of two ways:
1) Drawing an imaginary line along the path of the bullet and detecting all the bricks it intersects.
2) Shooting a separate invisible bullet along the normal bullet's path at something like 20x faster velocity. This "phantom bullet" doesn't cause any reaction upon contact with the bricks, it just passes right through them. But when it passes through a brick, that brick gets added to an array, and it ends up creating the array we need.
I should note that we've actually implemented option 1, and it works really well. The only problem is that when we get upwards of ten or twenty bullets it seems to cause massive slowdown. We're considering option 2 to try to boost framerate because we think it would be easier on the processor.
So, we're looking for a way to figure out if that's true.
I know that different physics simulators are different, and everything is different and difference is different and etc. etc. different, but I guess I was wondering if anyone has a general idea whether or not, in general, one of these methods should perform better than the other.
I'm hoping there's some knowledgeable individual here that can provide insight--or even suggest a simple test we could do to find out for ourselves.