# How to achieve realistic fake physics?

In my opinion, games that are most entertaining to watch and play implement fake physics, the difficult issue is how to implement the fake physics and still allow it to appear realistic. Most popular car driving games implement this really well.

Question Anyone has any tips or know of anywhere I can learn more about how these are implemented?

Long Story For example, Need For Speed is entertaining when the player car crashes into the computer car, but it would not be fun if we land off the track each time the player collide. In the game, it is obvious that some game logic is in place to steer or land the player car upright, face correct direction and on track most of the time even after a massive collisions. The game instead causes the computer car to suffer heavier damages like flying of the screen after many spins etc to enhance effects.

As another example, suppose at a time instance, a speeding player car is driving at the close rear left of a computer car and real physics dictates in the next time instance the player will definitely bump into the computer and lose speed and control. Then at this point, the player could steer right to avoid the car, or steer left to bump into its rear. In an entertaining game, we may still want the player to avoid the front car completely if he steers away and experience an exciting near miss.

In NFS, this experience appears to be implmented in a few ways such as player auto-steer avoidance, scraping pass and rebound to right of computer, computer car steer away to avoid, computer gets hit but lose control and spin off track to give way to player.

On the other hand, it the player steers to engage in a collision, we want to add excitement to spin the computer very badly but still keep the player on track with a good speed.

In NFS, these fake collisions and steering are not easily noticeable as they feel very realistic even though if we study them closely, it looks almost like the are scripted. One method I have tried is to determine the final state of collision and then compute the path backwards. But this only ensures the car is in a desired final state, does not address the realism.

• Bear in mind Need for Speed probably has its very own physics engine written exclusively for it. They don't have to wrangle with real world physics because they don't have any real world physics to wrangle with. They have modified the laws of physics to suit their game. In this alternate universe's physics model, things can drop all motion and spin out like crazy for no reason. Also, cars have no reason to leave the road unless instructed to. – doppelgreener Oct 29 '11 at 5:36
• I am not looking for implmentation details but general conecpts or starting points that help to tweak the physics to enchance user experience. Kind of like Physics' AI. Example, like in AI, there is "path finding"; maybe there is a "directed damping" in game physics? – Jake Oct 29 '11 at 5:37
• Then I have no idea what you're actually asking. "Hey, I want my physics engine to do some neat stuff." ... ok, so program your physics engine that way. "What neat stuff should I make it do?" How should I know, that's not an answerable question. "How should it do that?" Program it such that your laws of physics allow that to happen, or ask a specific question on a specific thing you're trying to do that is actually answerable in our Q&A format. – doppelgreener Oct 29 '11 at 5:41

You probably want to start with reasonably realistic (if simplified) physics and make modifications from there. The first modification you'll likely make will be using something called damping. This is essentially adding extra friction to selected interactions and velocity components. The second modification is detecting states that aren't recoverable (i.e. being overturned) and adding small velocity components.

The basic idea is that you calculate the real forces and resulting velocity changes, apply them and then quickly dissipate the components that don't line up with the direction of predefined "friendly" velocities. This will include things like velocity components that are perpendicular to the ground (these will make your car bounce out of control) and to a lesser extent components that are perpendicular to the intended direction of travel (these will make you crash into the wall).

For the second modification you want to be able to detect those states that are "not fun" (like being upside-down) and giving a little nudge in the right direction. You can also achieve this by having a lower bound on the rotational velocity component whose axis is the length of the car under some circumstances (like the aforementioned overturned state).

Overall I'd suggest that this sort of thing is an art. The more time you spend trying to make it both natural and fun, the more you'll like it. Some experimentation is going to be required. These tips will hopefully get you started.

You could use a physics engine. Box2D is popular: http://box2d.org/ and free

Otherwise google around. Bullet, Havok, etc

• Sorry, but I can't think of a better title. Not sure if you have read the long story, Box2D etc markets themselves as "real physics" at least that is what they strive to do (I assume). What I am looking for is a procedure that somewhat yields a directed animation that looks like real physics. – Jake Oct 28 '11 at 17:38