world-of-might-and-magic icon indicating copy to clipboard operation
world-of-might-and-magic copied to clipboard

Clipping through walls

Open CkNoSFeRaTU opened this issue 2 years ago • 3 comments

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

  1. Load attached save.

Expected behavior Don't clip through surfaces.

Screenshots Screenshot_20220916_132257

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.

CkNoSFeRaTU avatar Sep 16 '22 12:09 CkNoSFeRaTU

Are you sure this is an issue with collisions and not with the near clip plane being too far?

captainurist avatar Sep 16 '22 20:09 captainurist

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.

CkNoSFeRaTU avatar Sep 17 '22 05:09 CkNoSFeRaTU

OK I will look into it. My intuition tells me that there is no easy fix, but maybe we'll get lucky.

captainurist avatar Sep 17 '22 07:09 captainurist

Will need to also check that #546 works after fixing this one.

captainurist avatar Mar 17 '23 06:03 captainurist

Better way to reproduce: Screenshot 2023-06-26 at 10 58 35

This is dragon cave on Emerald Isle, note the party position. Reproduces 100% of the time.

captainurist avatar Jun 26 '23 02:06 captainurist

Yeah, collisions are totally borked, I'm able to climb the walls all the way up to the ceiling: Screenshot 2023-06-26 at 11 00 48

captainurist avatar Jun 26 '23 03:06 captainurist

First a video that illustrates the issue:

https://github.com/OpenEnroth/OpenEnroth/assets/73941350/0b44cacf-5d2d-4e74-a3ae-47eec95fedef

What's going on here:

  1. Collisions are only detected when the party is going INTO a polygon.
  2. 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.

captainurist avatar Jun 27 '23 02:06 captainurist