Prevent flats clipping thru walls
- pango
- Posts: 3359
- Joined: Wed Jul 18, 2018 6:14 pm
- Location: France
- Contact:
Prevent flats clipping thru walls
Fire 2 raycasts from enemy center, left and right (in the plane of the billboard), then clip the billboard using hit distances.
I'm not sure what would be the performance impact
I'm not sure what would be the performance impact
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart
- TacticalTrickery
- Posts: 36
- Joined: Tue Jan 11, 2022 9:22 pm
- Location: Shores of the Iliac
- Contact:
Re: Prevent flats clipping thru walls
For this kinda thing...?
Spoiler!
ENEMY SPELLBOOK @Nexus: Yellow-square spam, be gone!!
Ancient African proverb: To go fast, go alone. To go far, go together. ~ Humanity's greatest strength is in each other... don't waste it.
Ancient African proverb: To go fast, go alone. To go far, go together. ~ Humanity's greatest strength is in each other... don't waste it.
- pango
- Posts: 3359
- Joined: Wed Jul 18, 2018 6:14 pm
- Location: France
- Contact:
Re: Prevent flats clipping thru walls
Yes, that kind of things. Breaks immersion, and kind of spoil where enemies are located
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart
- DunnyOfPenwick
- Posts: 275
- Joined: Wed Apr 14, 2021 1:58 am
- Location: Southeast US
Re: Prevent flats clipping thru walls
The other side of this problem is seeing half an enemy disappear into the wall when fighting them.
A possible fix for these problems is creating a more appropriate sized/shaped collider for the enemies.
The standard colliders are capsule shaped, which matches humanoids well but does a poor job with other enemies.
A possible fix for these problems is creating a more appropriate sized/shaped collider for the enemies.
The standard colliders are capsule shaped, which matches humanoids well but does a poor job with other enemies.
- pango
- Posts: 3359
- Joined: Wed Jul 18, 2018 6:14 pm
- Location: France
- Contact:
Re: Prevent flats clipping thru walls
In many cases you won't be able to use a suitable collider, because it won't fit into walls and doors geometry.
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart
- TacticalTrickery
- Posts: 36
- Joined: Tue Jan 11, 2022 9:22 pm
- Location: Shores of the Iliac
- Contact:
Re: Prevent flats clipping thru walls
Do you have a generic graphic you could link or post here that demonstrates this doubleRaycast/clip? I don't have much understanding of 3D engines in general, but I know a few concepts.
I do agree that the current clipping really breaks immersion instantly (I kinda hate it), and having an enemy half-disappear into the wall during combat is certainly a problem as well...
ENEMY SPELLBOOK @Nexus: Yellow-square spam, be gone!!
Ancient African proverb: To go fast, go alone. To go far, go together. ~ Humanity's greatest strength is in each other... don't waste it.
Ancient African proverb: To go fast, go alone. To go far, go together. ~ Humanity's greatest strength is in each other... don't waste it.
- pango
- Posts: 3359
- Joined: Wed Jul 18, 2018 6:14 pm
- Location: France
- Contact:
Re: Prevent flats clipping thru walls
Not really,no. Raycasts are the easy part (used them before), but I don't know how to achieve billboard clipping
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart
- pango
- Posts: 3359
- Joined: Wed Jul 18, 2018 6:14 pm
- Location: France
- Contact:
Re: Prevent flats clipping thru walls
It should also be noted that it's no silver bullet, it should only work fine for vertical obstacles, which should be the most common case by far in dungeons and houses.
That's just the best idea I found so far.
That's just the best idea I found so far.
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart
- DunnyOfPenwick
- Posts: 275
- Joined: Wed Apr 14, 2021 1:58 am
- Location: Southeast US
Re: Prevent flats clipping thru walls
Maybe another way is to raycast from the edges of the collider capsule towards the camera. Left, right, top bottom. If all 4 raycasts are blocked, then completely disable the enemy graphic. It could potentially fix a subset of problems at least.
- pango
- Posts: 3359
- Joined: Wed Jul 18, 2018 6:14 pm
- Location: France
- Contact:
Re: Prevent flats clipping thru walls
... and sometimes fail to display enemies under some conditions (seen thru small openings?), which is why I rejected that solution. But maybe it's not that bad, that's something to experiment with.
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart