I’ve learned that video game ‘clipping’ is caused by high velocity, thin colliders, and too-slow physics updates. Why are terrain surfaces in most 3D video games paper-thin? Why isn’t terrain given extra fill/thickness inside and under it to prevent ‘falling through the map into the void’?

2.75K views

I could see why you might not want to fill under the terrain in a game that features things like underground caves, but thin terrain seems to be present in a huge majority of 3D games (even those without underground features) and is not engine-specific. Why is terrain almost always a fragile piece of origami that’s so easily punctured?

In: Technology

39 Answers

Anonymous 0 Comments

You’ve already got some good answers explaining how physics work in 3D games and how the visual geometry may not always reflect the collision shape used “under the hood”. I want to add that the Unity engine actually *does have* a “thickness” parameter for terrain which controls how “deep” the collision actually goes. You can read about it [here](https://docs.unity3d.com/550/Documentation/Manual/terrain-OtherSettings.html), and see that it is in fact included to prevent high-speed objects from penetrating the surface.

However, recent versions of Unity actually obsolete this feature, for me in fact it happened in the middle of development and my objects started clipping through after I updated! The removal of the feature comes from internal changes to the physics engine, which is a shame. So you might wonder, how will we prevent clipping if we can’t have terrain thickness anymore? The solution is to use the “expensive” collision detection talked about in the link. Unity has a concept called “Continuous collision” which essentially shoots a physics line in the direction of the moving object (engines can easily do this because they know the velocity and direction of all physics objects) to see if it will move past a surface instead of merely checking discrete intersections. The performance hit actually isn’t too bad, especially if you don’t have many objects. As others mentioned, there are tons of other optimizations which improve physics performance in general, such as disregarding shapes not in use, or putting an object to “sleep” when it has stopped moving, which all leave more performance room for this line-based procedure to function.

It’s also worth noting that this is just how Unity specifically handles their own terrain system. It’s entirely possible to import your own terrain mesh and give it whatever thickness you want in the collision shape, if you know how to define it properly. This is how I imagine many AAA games do their terrains–they have better tools which add in thickness, or add in custom collision shapes themselves, or most likely they end up using continuous collision anyways because it helps safeguard errors with other thin colliders that aren’t terrains.

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