I keep getting put off by how badly the movement system handles collisions. It's impossible to slide along a wall and not get stuck on some random polygon. Jumping on a slope is also inconsistent. I'd like to see a more robust movement system implemented, like the Source and GoldSrc engines do it.
Here's the source code for Source movement: https://github.com/ValveSoftware/source ... vement.cpp
Better player movement collisions
Re: Better player movement collisions
The majority of the Source Engine movement solver is closely tied to the "game logic" of source's movement. Nothing can be directly learned from it.
As far as movement solvers go, there's really only one approach that works. Source uses it partially. That approach is to move the object until it has to interact with the world, then interact it with the world, then check if it needs to keep moving and repeat. And you short-circuit this after something like eight "bounces" for the sake of performance.
I don't know if OpenMW has such a correct contact based movement solver, but judging by recent performance bug reports, I would assume that it has a bug or design problem somewhere if it's doing it properly. For example, some games do this, but you should never use binary searches in the "move the object against what it collides against" part of the movement solver. You can represent all collisions of AABBs against points, lines, AABBs, and triangles as very simple closed form functions, so there's no need.
Morrowind gets you stuck on walls because the collision is janky.
As far as movement solvers go, there's really only one approach that works. Source uses it partially. That approach is to move the object until it has to interact with the world, then interact it with the world, then check if it needs to keep moving and repeat. And you short-circuit this after something like eight "bounces" for the sake of performance.
I don't know if OpenMW has such a correct contact based movement solver, but judging by recent performance bug reports, I would assume that it has a bug or design problem somewhere if it's doing it properly. For example, some games do this, but you should never use binary searches in the "move the object against what it collides against" part of the movement solver. You can represent all collisions of AABBs against points, lines, AABBs, and triangles as very simple closed form functions, so there's no need.
Morrowind gets you stuck on walls because the collision is janky.
- psi29a
- Posts: 5357
- Joined: 29 Sep 2011, 10:13
- Location: Belgium
- Gitlab profile: https://gitlab.com/psi29a/
- Contact:
Re: Better player movement collisions
Being worked on already: https://github.com/OpenMW/openmw/pull/1158
Re: Better player movement collisions
Yow this is awesome.psi29a wrote:Being worked on already: https://github.com/OpenMW/openmw/pull/1158
Re: Better player movement collisions
Who is this Logzero guy? Does he have a forum account too? I saw this PR before in a thread about solving the physics loop bug. He seems like a great guy.
Re: Better player movement collisions
I've been keeping an eye on his pull request for weeks. I was so excited to see it merged that I grabbed Ace's nightly build as soon as it updated hours later. No question about it - HUGE improvement. In fact, sliding against certain objects is now even better than vanilla in some cases. And this is merely a side effect of the main attraction, which is the big performance improvements to physics. If 0.42.0 has nothing else, it will be worth it for this pull alone. Three cheers for logzero!
Re: Better player movement collisions
Very interesting. So, does this PR solve issues Bug #3355: [MGSO] Physics maxing out in south cornerclub Balmora and Bug 3410: lag/spikes at some place/cell?
- psi29a
- Posts: 5357
- Joined: 29 Sep 2011, 10:13
- Location: Belgium
- Gitlab profile: https://gitlab.com/psi29a/
- Contact:
Re: Better player movement collisions
Test and let us know.
Re: Better player movement collisions
Unfortunately, I wasn't able to reproduce these issues with my setup. That's why I'm asking.
Re: Better player movement collisions
This is so great news.