My suggestion for "Z-Fighting"

So Z-Fighting is a sort of problem in this game. If you place something inside of something, where their surfaces are in the exact same place, there is flickering. This makes sense as it is trying to render both.

Prepare for wall of text
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Lots of games use something called "culling", or "object culling" or "dynamic culling", its all the same really. This is where, if an object intersects another, the intersecting object is culled. One example would be if you were a player in a first person shooter and you put yourself against the wall, looking at it, your arms and gun may be going into the wall (visible to other players). Your player model would be culled so that the areas intersecting the wall were simply not rendered.

In planet coaster it isn't simple a dynamic object touching a static, never moving object, its lots and lots of dynamic objects intersecting one another.
I think implementing culling, in possibly two ways, would work a treat. It may or may not be negative for the games performance, i wouldn't know.
To implement, i would have it optional. Each object you can place (walls, props, etc) could have an option when placing. "Culling Mode". Much like the way you select the camera mode in the coaster creator, you would select the culling mode. One mode would be where once the object intersects another, anything beyond that intersect is culled - it isn't rendered, and essentially isn't there.
The second option could be where the intersecting object is rendered and what-not past the intersect, but the actual intersecting part is not. For example, say you place one of those wooden wall arches that has the planks extruding outward, then you place another blank wall to cover that gap. Currently this would start some Z-Fighting, as two walls are present in the same location. You could tell the first, arched wall to use the second culling option, and where it intersects the second, blank wall it would not render, so there would be no Z-Fighting, but its extruding planks would render still, as they are not within/intersecting the wall.
To put that more clearly, so you place a wall, then place another wall at a 90 degree angle to the first, going straight through it. The part that is inside, or passing through the first wall would not be rendered/exist.

One issue that comes to mind is how do you decide which side is culled (this applies to the first option). But i would say it would be the side that first intersects the other object, and the user could decide by moving it from the other side. Along with this, objects would need to "un-cull" once they have passed fully through another object, otherwise you would be passing the object through, culling it and it would come out the other side, in full completely invisible, despite no longer intersecting the object.

The second option could even be by default, as it would not alter creations other than being a fix for Z-Fighting.
I think that this culling idea could do two things. Firstly, combat Z-Fighting. Secondly, it would enhance building to an extent. You could create new shapes etc by culling objects as in the first option. You could have an arm light, which has a shorter arm coming off of it with another light. The second light would be the exact same model as the first, just the base would not be present!

If you've taken the time to read this, thanks! Let me know what you think to this idea and what you would do instead, or to contribute to this, and any other negatives/issues you can think of!

TL;DR: Use culling to combat Z-Fighting!
 
Back
Top Bottom