Project

General

Profile

Bug #2678

Combat with water creatures do not end upon exiting water

Added by William Sogge over 2 years ago. Updated 7 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Game Mechanics
Target version:
Start date:
06/14/2015
% Done:

100%

Reproducibility:
Always
Operating system:
Other
Severity:
Normal

Description

In vanilla morrowind when enganging combat with water creatures, combat ends immediately when you exit the water. In OpenMW, combat continues when exiting the water. So unless you kill them you
have to exit the cell the water creatures is in for cobat to end.


Related issues

Related to OpenMW - Bug #2767: Water creatures attempt to attack players who don't enter the water Rejected 07/10/2015

Associated revisions

Revision 25c64dbb (diff)
Added by R. D. 8 months ago

Make combat engagement logic more like vanilla

(Fixes #2678, Fixes #3705)

History

#1 Updated by vivec Ae Seht about 2 years ago

I can confirm this is happening. usually, it results in me running around in circles for ~5-10 mins trying to figure out what's triggering the combat music.

#2 Updated by scrawl . about 2 years ago

  • Related to Bug #2767: Water creatures attempt to attack players who don't enter the water added

#3 Updated by scrawl . about 2 years ago

In vanilla morrowind when engaging combat with water creatures, combat ends immediately when you exit the water.

Are you sure about this? I just found the opposite when I did a quick test. The battle music kept playing when the player exits water.

#4 Updated by Thomas Staudinger about 2 years ago

So, I just tested this and the actual behavior seems to be the following in vanilla Morrowind: Combat with a water creature stops immediately when exiting the water as long as it hasn't actually hit you, as soon as it has it will continue the combat and try to get to your location even after you exit the water. Here's a video showing this behavior: https://www.youtube.com/watch?v=yVvi95kR3-M&feature=youtu.be

#5 Updated by Jeffrey Haines about 2 years ago

  • Status changed from New to Confirmed

#6 Updated by Jeffrey Haines 12 months ago

  • Assignee set to Jeffrey Haines

#7 Updated by R. D. 10 months ago

I've given this some pretty thorough testing, and I think I understand the vanilla behavior.

Creature behavior in this case is determined by their movement flag. Biped creatures and NPCs will follow the player between water and land. Flying and walking creatures won't follow the player into water, and swimming creatures won't follow to land.

Combat continues even after the player leaves or enters the water if the player attacked the creature (whether they hit the creature or missed), or, I believe, if the creature completed an attack animation at least once, whether they hit the player or missed (maybe the check on the player is also if the animation completed, although I don't think the player can interrupt an attack animation). When in combat between water and land like this, the creature will turn to face the player if they have line of sight and will attack if they are within range, but they won't move to follow the player.

#8 Updated by Miroslav Remák 10 months ago

It seems that if canFight() evaluates to false while the "hit flag" is active, the actor will disengage from combat instead of fleeing.

For example: execute "fargoth->startcombat player", jump over Fargoth's head and he will no longer be in combat with you (unless you let him hit or attempt to hit you). If you had started combat by hitting him, he would have fleed.

#9 Updated by Miroslav Remák 10 months ago

Also, leaving the actor's cell appears to reset this flag.

#10 Updated by Miroslav Remák 10 months ago

Correction:

It seems that if canFight() evaluates to false while the "hit flag" is not active, the actor will disengage from combat instead of fleeing.

#11 Updated by Jeffrey Haines 9 months ago

  • Assignee deleted (Jeffrey Haines)

Removing myself while I update bug tracker.

#12 Updated by Jeffrey Haines 9 months ago

  • Target version set to openmw-0.42

#13 Updated by R. D. 9 months ago

  • Status changed from Confirmed to In Progress
  • Assignee set to R. D.

As an extension of work on another bug, I should hopefully have a fix in the works for this, so I'm marking it as in progress.

#14 Updated by R. D. 7 months ago

  • Status changed from In Progress to Closed
  • % Done changed from 0 to 100

#15 Updated by R. D. 7 months ago

Also, leaving the actor's cell appears to reset this flag.

Yes, that does seem to be the case. It wasn't quite how I expected, though. With a slaughterfish that had set the flag by attacking the player, when I left the water and went into and out of an interior to reset the flag, I expected combat to end, but instead the combat music still played and it still had the player as a target. When I then went in the water and left before it could attack me, though, it ended combat due to the reset flag. Maybe rather than being done constantly the canFight check was only done when the target (the player in this case) changed context between land and water or something. Not sure how that would work with levitating or jumping out of range, though...

In my PR for this I implemented this as an actorID, not a flag. I didn't notice your comment and didn't implement resetting for AI actors during cell changes, but I think I'm going to leave it as it is for now unless there's a problem with it.

Also available in: Atom PDF