world-of-might-and-magic
world-of-might-and-magic copied to clipboard
Clipping through walls
Describe the bug We are allowing for coming too close to surfaces and if they aren't straight we could clip and see what's behind them. Actors also could hide in the textures there.
To Reproduce
- Load attached save.
Expected behavior Don't clip through surfaces.
Screenshots
Saved game file save007.mm7.zip
Additional context Vanilla doesn't allow such a close proximity to surfaces and so doesn't exhibit this issue.
Are you sure this is an issue with collisions and not with the near clip plane being too far?
Maybe a combination, save made in womm with position on screenshot when loaded in vanilla show much less portion (in hardware mode, in software all good). But when I backpedal and try to reach that position again in vanilla I wont able to.
OK I will look into it. My intuition tells me that there is no easy fix, but maybe we'll get lucky.
Will need to also check that #546 works after fixing this one.
Better way to reproduce:
This is dragon cave on Emerald Isle, note the party position. Reproduces 100% of the time.
Yeah, collisions are totally borked, I'm able to climb the walls all the way up to the ceiling:
First a video that illustrates the issue:
https://github.com/OpenEnroth/OpenEnroth/assets/73941350/0b44cacf-5d2d-4e74-a3ae-47eec95fedef
What's going on here:
- Collisions are only detected when the party is going INTO a polygon.
- And only when the party position is inside the right prism with the polygon as the base & sides perpendicular to that polygon.
You can sidestep both conditions by approaching a model from the corner. To illustrate further:
|XXXXX
|XXXXX
|XXXXX
-------+XXXXX
XXXXXXXX.....
XXXXXXXX.....
XXXXXXXX.....
XXXXXXXX.....
X - collisions are detected if party is here.
. - collisions are not detected if party is here.
Which means you can get real close to a model. I think with low enough FPS it should be even possible to get inside a model.
What's going on in the video:
- I approach a house from the corner & get really close.
- Then I face slightly away from the wall, and move forward – this way the party can stay really close to the wall w/o triggering a collision.
- The moment I turn facing the wall & move farward, collision is detected, and the party is pushed away from the wall.