Prevent flats clipping thru walls

Talk about the mods you'd like to see in Daggerfall Unity. Give mod creators some ideas!
User avatar
pango
Posts: 3359
Joined: Wed Jul 18, 2018 6:14 pm
Location: France
Contact:

Prevent flats clipping thru walls

Post by pango »

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
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

User avatar
TacticalTrickery
Posts: 36
Joined: Tue Jan 11, 2022 9:22 pm
Location: Shores of the Iliac
Contact:

Re: Prevent flats clipping thru walls

Post by TacticalTrickery »

8-) For this kinda thing...?
Spoiler!
2022_01_17_02_37_52.jpg
2022_01_17_02_37_52.jpg (68.39 KiB) Viewed 708 times
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.

User avatar
pango
Posts: 3359
Joined: Wed Jul 18, 2018 6:14 pm
Location: France
Contact:

Re: Prevent flats clipping thru walls

Post by pango »

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

User avatar
DunnyOfPenwick
Posts: 275
Joined: Wed Apr 14, 2021 1:58 am
Location: Southeast US

Re: Prevent flats clipping thru walls

Post by DunnyOfPenwick »

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.

User avatar
pango
Posts: 3359
Joined: Wed Jul 18, 2018 6:14 pm
Location: France
Contact:

Re: Prevent flats clipping thru walls

Post by pango »

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

User avatar
TacticalTrickery
Posts: 36
Joined: Tue Jan 11, 2022 9:22 pm
Location: Shores of the Iliac
Contact:

Re: Prevent flats clipping thru walls

Post by TacticalTrickery »

pango wrote: Sun Aug 21, 2022 11:47 pm Fire 2 raycasts from enemy center, left and right (in the plane of the billboard), then clip the billboard using hit distances.
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.

User avatar
pango
Posts: 3359
Joined: Wed Jul 18, 2018 6:14 pm
Location: France
Contact:

Re: Prevent flats clipping thru walls

Post by pango »

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

User avatar
pango
Posts: 3359
Joined: Wed Jul 18, 2018 6:14 pm
Location: France
Contact:

Re: Prevent flats clipping thru walls

Post by pango »

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.
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

User avatar
DunnyOfPenwick
Posts: 275
Joined: Wed Apr 14, 2021 1:58 am
Location: Southeast US

Re: Prevent flats clipping thru walls

Post by DunnyOfPenwick »

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.

User avatar
pango
Posts: 3359
Joined: Wed Jul 18, 2018 6:14 pm
Location: France
Contact:

Re: Prevent flats clipping thru walls

Post by pango »

... 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

Post Reply