Jump to content
Sign in to follow this  
Kappatao

What causes clipping?

Recommended Posts

I'm just curious, maybe someone who actually knows how the game renders could answer this for me.

What causes the clipping of sprites through the 3d models in the game (e.g. when driving and grass shows up through the car, or when crouching near the corners of buildings), and why does it seem so difficult to fix?

Share this post


Link to post
Share on other sites

Why does it happen? I'm not a programmer, but I imagine because there isn't anything specifically put in place to prevent it. In reality, things that aren't extraordinarily tiny particles don't pass through "solid" matter because physics prevent it and simulating such behavior has a cost involved. Why isn't it often fixed? I think it comes down to three main factors. 

 

1. It is perceived to be a minor cosmetic issue that does not affect stability or performance and outside of extreme examples it doesn't affect player enjoyment to an appreciable degree.

 

2. The time spent on addressing a rather benign issue is time that isn't spent on things that are more important.

 

3. Simulating something akin to real life physics would take away from system resources that could be put towards other game functionality. So it would result in a negative performance impact.

 

 

It happens in a lot in games from very big to very small, so that in itself is probably telling of how difficult it is to deal with.

Edited by BoogieMan
typo

Share this post


Link to post
Share on other sites
8 hours ago, Planet Algol said:

Games like Tarkov and Rust also have clipping in them, even with their huge development teams and budgets.

I get why that kind of clipping happens (where two 3d models intersect and overlap). I'm talking about the type of clipping where a sprite will be rendered in front of a 3d model, where it shouldn't, e.g. when grass sometimes gets rendered infront of your car, and you can see it through the car.

Share this post


Link to post
Share on other sites
8 hours ago, BoogieMan said:

Why does it happen? I'm not a programmer, but I imagine because there isn't anything specifically put in place to prevent it. In reality, things that aren't extraordinarily tiny particles don't pass through "solid" matter because physics prevent it and simulating such behavior has a cost involved. Why isn't it often fixed? I think it comes down to three main factors. 

 

1. It is perceived to be a minor cosmetic issue that does not affect stability or performance and outside of extreme examples it doesn't affect player enjoyment to an appreciable degree.

 

2. The time spent on addressing a rather benign issue is time that isn't spent on things that are more important.

 

3. Simulating something akin to real life physics would take away from system resources that could be put towards other game functionality. So it would result in a negative performance impact.

 

 

It happens in a lot in games from very big to very small, so that in itself is probably telling of how difficult it is to deal with.

Collision is already a thing in PZ, so they are already kinda simulating IRL physics there, or else you could just walk through a wall. What I'm referring to is purely a cosmetic issue that's been in the game for years. I remember when cars where initially added, they had a much bigger problem with the draw order of sprites, but it was mostly fixed. I'm just curious why it's been so difficult to 100% fix.

In your first point, I would argue that it does affect player enjoyment (At least for me), since, especially after such a big visual upgrade as 41, it's just jarring to see half my character inside a wall. Yes it might not be a huge issue, and any other development team I'd not question it, but I know TIS have an eye for detail.

Share this post


Link to post
Share on other sites
On 10/14/2020 at 3:14 AM, Kappatao said:

Collision is already a thing in PZ, so they are already kinda simulating IRL physics there, or else you could just walk through a wall. What I'm referring to is purely a cosmetic issue that's been in the game for years. I remember when cars where initially added, they had a much bigger problem with the draw order of sprites, but it was mostly fixed. I'm just curious why it's been so difficult to 100% fix.

In your first point, I would argue that it does affect player enjoyment (At least for me), since, especially after such a big visual upgrade as 41, it's just jarring to see half my character inside a wall. Yes it might not be a huge issue, and any other development team I'd not question it, but I know TIS have an eye for detail.

 

Yes, any game where you can at least stand on the ground without falling through it simulates RL physics at least in some degree. But for example the physics box of your character is often just a simple rectangular box encompassing your character model, or at least the middle part which can sometimes allow your limbs and clothing such as cloaks, weapons, scabbard, etc clip through a wall or another object because not every individual object has a perfectly defined "hitbox" that exactly mirrors all the contours of the object and is designed to bump against it and not pass through it. The more true to reality it is the harder it is to design and the more resources it consumes.

 

Another things to consider is that with an isometric view like in Project Zomboid sometime objects can obscure the player's vision of their character so things have to be hidden on the fly. I guess the system just isn't perfect. Maybe in time it will be improved, but I wouldn't count on it being eliminated. Maybe it would be helpful to posts some screenshots so the devs can see specific situations that it happens in for easier testing if they decide to work on it some more.

Share this post


Link to post
Share on other sites
4 hours ago, BoogieMan said:

 

Yes, any game where you can at least stand on the ground without falling through it simulates RL physics at least in some degree. But for example the physics box of your character is often just a simple rectangular box encompassing your character model, or at least the middle part which can sometimes allow your limbs and clothing such as cloaks, weapons, scabbard, etc clip through a wall or another object because not every individual object has a perfectly defined "hitbox" that exactly mirrors all the contours of the object and is designed to bump against it and not pass through it. The more true to reality it is the harder it is to design and the more resources it consumes.

 

Another things to consider is that with an isometric view like in Project Zomboid sometime objects can obscure the player's vision of their character so things have to be hidden on the fly. I guess the system just isn't perfect. Maybe in time it will be improved, but I wouldn't count on it being eliminated. Maybe it would be helpful to posts some screenshots so the devs can see specific situations that it happens in for easier testing if they decide to work on it some more.

I would post screenshots of what I mean, but I don't have access to my PC ATM. Here is a clip I managed to find, where if you look close, you can see the grass appear temporarily through the car.

 

4 hours ago, EnigmaGrey said:

https://en.m.wikipedia.org/wiki/Inverse_kinematics
 

The engine does not support this. 

Sorry Enigma, I fail to see how IK factors into clipping? Could you elaborate a bit?

 

Thanks all for the insite you have provided tho.

Edited by Kappatao

Share this post


Link to post
Share on other sites

The draw order for a typical 2D isometric scene is determined by the Y-coordinate of the objects - i.e. objects are drawn top to bottom, so the objects "closer" to the camera are drawn on top (in front) of objects that are "further" away.

 

A vehicle is a long object and can cover multiple tiles across the Y-axis at certain angles. When you have such an object, it makes sense to consider its coordinates to originate from the centre of the object. If the draw order of the vehicle is determined by its centre Y-coordinate, however, there can be cases like this where an object that is just below the centre of the vehicle, yet supposed to be underneath it, is drawn over top.

 

That is my guess, at least. It would explain why the grass in the video only clips through the lower portions of the vehicle. It would be quite an easy fix, too: Just pass the renderer the Y-coordinate of the vehicle's lowest point, rather than the centre.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...