In both OpenMW and Morrowind archers and mages try to fall back if the enemy is too close.
OpenMW behaviour has two problems:
1. If there is an obstacle behind, NPC runs on place endlessly. In Morrowind NPC just stops in this case.
2. NPC can run off the cliff. This issue is not present in vanilla game.
Take a look at this branch.
I managed to solve the first issue: NPC stops and still uses evading (side) movement if there is an enemy nearby. Sometimes NPCs manage to evade obstacle via side movement.
Unfortunately, I had to use physics raytesting, so I'm aware of performance cost of this solution.
Feel free to test the branch and provide any feedback.
Also please share any ideas how to solve the second issue, or improve solution for the first one.
EDIT: to solve the second issue, I tried to modify approach from the first one:
Angle A should be more than sMaxSlope.
If the vector has no collisions, there is a cliff nearby.
Unfortunately, it works only partially for now (or I am just dumb).
Also there should be a more more generic place for this code since the normal movement should use it too.
Can we stop the actor during physics simulation?
Everything about development and the OpenMW source code.
1 post • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 6 guests