What causes clipping and why is it such a common bug in video games?

552 views

I’m playing *Cyberpunk 2077* right now, and it’s a beautifully rendered visual masterpiece of a game, but the clipping issues are ubiquitous to an almost absurd degree.

You see this in “finished” games as well (particularly the Soulsborne series where I can’t count how many deathblows have come by way of an enemy’s attack landing right through a wall or floor).

I’m curious as to why it’s so common. Thanks in advance!

In: Technology

4 Answers

Anonymous 0 Comments

It’s nearly impossible to perform accurate collision detection. Not theoretically impossible, mind you, but very computationally expensive. To see why it is, just imagine if you have 2 moving triangle, you know the position and momentum of each, and you need to determine if and when they touch each other in the next second. No you don’t get to see the triangles, you just have the numbers to calculate. You will quickly find out that the math is a mess.

Now imagine a computer has to do a lot of these checks. All that, just to even merely *detect* a collision.

Next, even if the computer does detect collision, what is it going to do with it? To do anything accurate/realistic-looking, you need to model force, density, tension, etc. which are also very computational expensive. Sometimes they try, and you end up with wonky ragdoll physics, which lead to corpse flying or vibrating on the ground. Which is why computer often have very minimal response to collision detection. Oh, you collide a wall? Your main velocity is now 0. That’s about it. Many other stuff don’t change at all. A fighting animation won’t be altered, because a fixed animation can be hard-coded and blindly executed by a computer without much work, but a changing animation based on physics is very computationally expensive.

Combining the above problem, the game developers solution is to use collision detection using very few, very basic shape (the hitboxes), and they follow predetermined path according to a fixed animation. The result of this is that the hitboxes can always clip through wall.

Can you just check LoS? Not really, that’s still janky. The math for checking LoS itself is also very complicated in general, so game developers also have to shortcut this by checking from a few points only. Check LoS from a single point and you run into a problem where what looks like clean hit get blocked by random dust or some tiny object that shouldn’t matter. Check LoS between many points and the computational problem come back. That’s not to mention, many maps have invisible collision box due to the mistakes (hard to avoid when making map is so complicated).

The cheapest, and less expensive option is simply trying to make hitboxes close to accurate, and make the wall/floor *thick* so that the hitboxes don’t clip too far that it come through the other side. But this is also quite complicated. Adding a new animations? Opps we already made the map. What if the wall you need is too thick that things just looks wrong and out of proportion.

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