Quote:
Originally Posted by clerick
Looks awesome, although I wonder if curent gen consoles can utilize this version of havok. Then again red faction had awesome physics and ran on consoles.
|
Havok 7.1.0 works for all current-gen consoles.
Quote:
Originally Posted by Coma
This makes absolutely no sense.
|
Ok, then I'll explain. *takes a deep breath*
Imagine a box, a box that a player can stand on. This is an interaction in physics, the player's physics are resting on the box, which also exists in the physics world. The player and the box are in the same physics world. If the box were to rise, the player would rise. Seems simple enough, but lets look at the example of a rising box with a player on it in more detail.
Frame 1:
Box is stationary, player is standing still on top of the box. The physics simulation step during this frame occurs, the contact point(s) between the player and the box are resolved, this keeps the player from falling through the box even though the player is affected by gravity.
Frame 2:
Box has an upward velocity, player is standing still on top of the box. Physics simulation step occurs, the box's velocity causes a change in its position (before the player's position has been updated), this means that the box is now partially inside of the player, because it has moved upward but the player hasn't been processed yet. This contact point and depth are resolved, and an upward velocity is given to the player. Now the player is processed and due to the contact and the upward velocity it causes the player to change position and end up on top of the box once again. What a person playing the game sees by the end of the frame is that the player is still standing on the box.
Now lets look at what would happen if the box were implemented on the GPU. Let me first start by mentioning that GPUs lag a few frames behind the CPU (this holds true for rendering as well). And, for the sake of argument, lets pretend that the box from the above example has already been sitting stationary for a few frames, AND for the sake of argument lets say that PhysX GPU physics allowed changes to a physics shape that a CPU controlled player could actually be affected by.
Because the GPU is a few frames off from the CPU, we'll give the GPU a few frames head start for this argument, but I am mentioning the events below in chronological order.
Frame 4 (GPU):
Box has now been stationary for a few frames.
Frame 1 (CPU):
Box is stationary on the CPU (as of this frame, but began being stationary a few frames ago on the GPU), player is standing still on top of the box. The physics simulation step during this frame occurs, the contact point(s) between the player and the box are resolved, this keeps the player from falling through the box even though the player is affected by gravity.
Frame 5 (GPU):
Box is given an upward velocity, and has now moved upward slightly, into a position that is partially inside the player.
Frame 2 (CPU):
Box is stationary on the CPU, because even though the GPU has moved the box it takes a few frames to take affect).
Looks like we have a problem now, where the box isn't moving as far as the player is concerned, but in physics it appears to. This situation does seem all that terrible, just somewhat laggy.
Now lets say the box is moving upward, and the player jumps from the ground onto that box. What would happen? The player would go right through the box, because the player is being simulated on the CPU, and when the CPU goes to check if the player is colliding with the box, it would think the box was still on the ground (because the GPU's info hasn't gotten to the system memory yet). So the player would see, on their screen, a box on the ground that they landed on, and the GPU would see a player move through a box that was in the air.
And maybe the designer wants some logic (which would have to be on the CPU) that says, if the player lands on a box and the box is moving at the time, kill the player. Well, the player wouldn't die, because the CPU didn't see the box moving at the time they landed.
There are millions of possible gameplay reasons why GPU physics cannot affect CPU physics, and it all comes down to the fact that a GPU cannot write to system memory immediately.