what is it in racing game code that so often results in the car rapidly spinning and flying around colliding into everything?

265 views

seems like every game with a car has this happen occasionally, and I was wondering what the underlying theme is in how vehicles are coded in these games that makes it such a common glitch?

[example](https://v.redd.it/w1qkg6qji2ca1)

In: 5

5 Answers

Anonymous 0 Comments

I remember a developer posting an update to “Last Oasis” explaining why this phenomenon occurred in their games. It’s not exactly racing, but it is moving vehicles. The way they explained it was essentially that it was due to “Static” objects colliding with “Dynamic” objects. I don’t understand it fully, but from what I could gather, the physics engine doesn’t know how to properly handle when a dynamic object collides with an object (at high speeds) that is static, meaning the object they collide with should not move under any circumstance. Because the dynamic object (the vehicle in this case) is moving so fast, it goes inside of the static object and the physics engine’s job is to now remove this anomaly, generally causing it to wildly flip out and get pushed out of the other object in any way possible. But since they’re lodged together, there’s no concrete way of doing it (physics engines don’t support this phenomenon) hence the random rapid spinning or being launched.
Think of the game Halo when you drive a warthog into a pole and the hood of the vehicle gets lodged inside of it and the car starts spazzing out. The physics engine is trying to remove the collision, but the properties of both objects force them to remain in the same position. The warthog is constantly trying to be removed, but according to the physics, it can’t be removed.
Take my explanation with a grain of salt. I’m no game dev or anything, but I’ve done a couple very small projects where the same phenomenon occurs in Unity Game Engine.

You are viewing 1 out of 5 answers, click here to view all answers.