Author Topic: [Confirm V20]Enemy Running Animation Won't stop  (Read 5042 times)

ushas

  • Hero Member
  • *****
  • Posts: 661
[Confirm V20]Enemy Running Animation Won't stop
« on: July 26, 2017, 12:31:03 AM »
The enemy variant of the above allies remaining in the loop of running animation:

I'm not sure how much it's end turn related. In v18 version, an enemy running in loop can happen when there was some overwatch or perhaps AOO interruption. Sometimes it looked like at the end of the enemy's movement.

This one is happening on the ChopShop map with churchers. Sister Martinez triggered Ray's overwatch and from that point remains in the run loop animation. The log repeats many times the same error:
Code: [Select]
CharMoveScript.HandleMovement. Path is null
CharacterMovementScript.HandleMovement. Character name is: Sister Martinez
NullReferenceException: Object reference not set to an instance of an object
  at CharacterMovementScript.HandleMovement () [0x00000] in <filename unknown>:0
  at CharacterMovementScript.Update () [0x00000] in <filename unknown>:0

Later on when she gets to her turn, she moves but ends turn in running loop animation again. There seems to be slightly different error now:
Code: [Select]
CharMoveScript.StartMovement. Path position is: 8
NullReferenceException: Object reference not set to an instance of an object
  at CharacterMovementScript.StartMovement () [0x00000] in <filename unknown>:0
  at CharacterMovementScript.SetupMovement () [0x00000] in <filename unknown>:0
CharacterMovementScript.PlayFootSteps. Method called. SFX volume is: 0.7
BattleControlScript.EndCharacterTurn. Requested by AI. Can turn be ended: True
« Last Edit: August 24, 2017, 12:28:23 PM by Daithi »

ushas

  • Hero Member
  • *****
  • Posts: 661
Re: Enemy Running Animation Won't stop
« Reply #1 on: July 27, 2017, 11:55:33 PM »
Happened again. Not sure if the information is still useful, as this is the confirm fix section. But just in case:

-- Sam has a hammer and ends the turn in overwatch.
-- Enemy steps on an adjacent tile and the overwatch is triggered and it interrupts the enemy.
-- Next moment this enemy starts run movement, seems hadn't reached his destination yet.
-- But that triggered AOO from Ray and thus another interrupt.
-- The enemy stays in the run animation.

So the situation looked like Ray had two attacks, overwatch -> AOO, against the same enemy on the same tile. The run animation starts between those attacks I think.

Daithi

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1248
Re: Enemy Running Animation Won't stop
« Reply #2 on: July 28, 2017, 08:00:59 AM »
Moved this here, forgot to relocate when it split. Looks like the more recent one is overwatch and AOO interfering with one another. Both code blocks below suggests the that path has been destroyed before it should. The overwatch/AOO is a promising place to start on recreating.

ushas

  • Hero Member
  • *****
  • Posts: 661
Re: Enemy Running Animation Won't stop
« Reply #3 on: August 02, 2017, 09:16:28 PM »
By my understanding how AOO ought to work, that AOO attack after the Overwatch interrupt shouldn't happen -> thus must declare it as a bug too.

Edit: Nope. As the movement was interrupted by Overwatch, then it's alright that the next move is AOO triggering, right? AOO hadn't triggered before overwatch, because the enemy started his path not adjacent, then stepped next to Ray.
« Last Edit: August 09, 2017, 12:44:43 PM by ushas »

Daithi

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1248
Re: Enemy Running Animation Won't stop
« Reply #4 on: August 03, 2017, 08:58:41 AM »
Yeah, the AOO should trigger before the move happens, then overwatch should occur on first tile the character moved to. Will look at this soon

ushas

  • Hero Member
  • *****
  • Posts: 661
Re: Enemy Running Animation Won't stop
« Reply #5 on: August 09, 2017, 12:46:34 PM »
Quote from: Daithi
I'd really like to dig up that running animation bug. Hopefully I can make it happen prior to releasing V19.
I'll see what I can dig on reproduction tonight. Haven't played for a while so it's fuzzy, but one way I think it may happen is when an enemy decides to flee. You know which way he's heading. So... you step on a tile adjacent to the next tile on his escape path, and set CC overwatch.

Having a bunch of bugs yet to test & report. Yeah, am a bit of slow. Are you close to v19 release?

Daithi

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1248
Re: Enemy Running Animation Won't stop
« Reply #6 on: August 09, 2017, 01:28:00 PM »
Sounds good. Not too much more work left on V19 - could happen by the weekend if testing goes smoothly, and if not probably less than a week.

ushas

  • Hero Member
  • *****
  • Posts: 661
Re: Enemy Running Animation Won't stop
« Reply #7 on: August 09, 2017, 11:37:29 PM »
So did exactly that - ambushed a fleeing enemy. AOO hadn't triggered and Ray killed the enemy by overwatch attack. So the enemy is down and no looped animation to be seen. However, in the log there is still the same error repeated many times afterwards, the same as in the case of the running animation:
Code: [Select]
CharMoveScript.HandleMovement. Path is null
CharacterMovementScript.HandleMovement. Character name is: Ana Stuurman
NullReferenceException: Object reference not set to an instance of an object
  at CharacterMovementScript.HandleMovement () [0x00000] in <filename unknown>:0
  at CharacterMovementScript.Update () [0x00000] in <filename unknown>:0
 
I dunno, not sure if knowing the error happens even after being already killed is important to know.
Just for the record, when the running loop happened in the past, the enemy was still active, not technically incapacitated or killed.

ushas

  • Hero Member
  • *****
  • Posts: 661
Re: Enemy Running Animation Won't stop
« Reply #8 on: August 10, 2017, 12:29:44 AM »
To this post I'm attaching excerpt from the log. It's the above situation. The lines start at the point when the enemy moves into adjacent tile and the game decides Ray is gonna get Overwatch attack. And it ends at the point where the first error occurrences start happening. Still before the next unit acts.

The reason is, it would be much more apparent to you what's happening, when taking a look at events there.

What is suspicious to me is that there are some lines called more times. As if the overwatch was resolved twice or so. There was end turn called in between.

For example CTH part:
The first time:
Code: [Select]
OverwatchManager.AttemptOverwatchAttackForThisMovement. Distance between melee overwatching Ray Case and moving: Ray Case is: 1 -> Checking if melee attack can be made
CharMainScript.SetupMeleeAttack. Body part damage modifier: 1 / is overwatch attack: True / is AOO: False
CharacterMainScript.SetupMeleeAttack. Character Ana Stuurman is not already on list. Adding
BattleControlScript.GetMeleeChanceToHit. defender wound level: 2, increasing CTH by: 10
BCS.GetMeleeCTH. Attacker Melee Skill: 49 / defence from melee 21 / defense from armour 0 / defense from evasion: 6 / attack rating: 1.814815 / melee multiplier: 37.5 bodyPart CTH Multipler:1 use mode CTH multiplier:1 / final chance to hit: 78
CharacterMainScript.SetupMeleeAttack. This is an unarmed attack
CharMainScript.SetupMeleeAttack. Attack damage is: 8.481825 defender HP: 3.613329
The second time:
Code: [Select]
OverwatchManager.AttemptOverwatchAttackForThisMovement. Distance between melee overwatching Ray Case and moving: Ray Case is: 1 -> Checking if melee attack can be made
CharMainScript.SetupMeleeAttack. Body part damage modifier: 1 / is overwatch attack: True / is AOO: False
BattleControlScript.GetMeleeChanceToHit. defender wound level: 2, increasing CTH by: 10
BCS.GetMeleeCTH. Attacker Melee Skill: 49 / defence from melee 21 / defense from armour 0 / defense from evasion: 6 / attack rating: 1.814815 / melee multiplier: 37.5 bodyPart CTH Multipler:1 use mode CTH multiplier:1 / final chance to hit: 78
CharacterMainScript.SetupMeleeAttack. This is an unarmed attack
CharMainScript.SetupMeleeAttack. Attack damage is: 8.481825 defender HP: 0

You can see other lines more times, like:
Code: [Select]
CharacterMainScript.StartMeleeAttack. Method called. Is overwatch attack: True / is AOO: FalseAnd many others...

Not sure what some do, like (2x with true/true, 4x with false/false):
Code: [Select]
OverwatchManager.SetOverwatchBeingResolved. Current state: True / new state: True
Perhaps the game just calls some functions more times for different reasons. I don't know. Could be completely ok.

But just in case, if there is really something called twice (or more times) and shouldn't, then it may as well be that some boolean/state was not set properly in case there is some loop, or anything else, and overwatch not closed. One would then get the null exceptions as things aren't as before anymore.

The issue doesn't look like being related to enemy removal event though, as when it happens as the looped animation bug, the enemy doesn't fall under this category. But there could be more problems at play, of course.

I didn't see more than one attack, but it happened fast.

Nomad

  • Sr. Member
  • ****
  • Posts: 453
Re: Enemy Running Animation Won't stop
« Reply #9 on: August 10, 2017, 07:51:51 AM »
Sounds good. Not too much more work left on V19 - could happen by the weekend if testing goes smoothly, and if not probably less than a week.
Ooooooh... I hope testing goes smoothly.  =D

Daithi

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1248
Re: Enemy Running Animation Won't stop
« Reply #10 on: August 10, 2017, 12:39:57 PM »
So did exactly that - ambushed a fleeing enemy. AOO hadn't triggered and Ray killed the enemy by overwatch attack. So the enemy is down and no looped animation to be seen. However, in the log there is still the same error repeated many times afterwards, the same as in the case of the running animation:
Code: [Select]
CharMoveScript.HandleMovement. Path is null
CharacterMovementScript.HandleMovement. Character name is: Ana Stuurman
NullReferenceException: Object reference not set to an instance of an object
  at CharacterMovementScript.HandleMovement () [0x00000] in <filename unknown>:0
  at CharacterMovementScript.Update () [0x00000] in <filename unknown>:0
 
I dunno, not sure if knowing the error happens even after being already killed is important to know.
Just for the record, when the running loop happened in the past, the enemy was still active, not technically incapacitated or killed.

Great, this can be recreated. This is just a boolean not being reset, must be something in the flee code block which is skipping this part of the code.

Daithi

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1248
Re: Enemy Running Animation Won't stop
« Reply #11 on: August 10, 2017, 12:42:35 PM »
To this post I'm attaching excerpt from the log. It's the above situation. The lines start at the point when the enemy moves into adjacent tile and the game decides Ray is gonna get Overwatch attack. And it ends at the point where the first error occurrences start happening. Still before the next unit acts.

The reason is, it would be much more apparent to you what's happening, when taking a look at events there.

What is suspicious to me is that there are some lines called more times. As if the overwatch was resolved twice or so. There was end turn called in between.

For example CTH part:
The first time:
Code: [Select]
OverwatchManager.AttemptOverwatchAttackForThisMovement. Distance between melee overwatching Ray Case and moving: Ray Case is: 1 -> Checking if melee attack can be made
CharMainScript.SetupMeleeAttack. Body part damage modifier: 1 / is overwatch attack: True / is AOO: False
CharacterMainScript.SetupMeleeAttack. Character Ana Stuurman is not already on list. Adding
BattleControlScript.GetMeleeChanceToHit. defender wound level: 2, increasing CTH by: 10
BCS.GetMeleeCTH. Attacker Melee Skill: 49 / defence from melee 21 / defense from armour 0 / defense from evasion: 6 / attack rating: 1.814815 / melee multiplier: 37.5 bodyPart CTH Multipler:1 use mode CTH multiplier:1 / final chance to hit: 78
CharacterMainScript.SetupMeleeAttack. This is an unarmed attack
CharMainScript.SetupMeleeAttack. Attack damage is: 8.481825 defender HP: 3.613329
The second time:
Code: [Select]
OverwatchManager.AttemptOverwatchAttackForThisMovement. Distance between melee overwatching Ray Case and moving: Ray Case is: 1 -> Checking if melee attack can be made
CharMainScript.SetupMeleeAttack. Body part damage modifier: 1 / is overwatch attack: True / is AOO: False
BattleControlScript.GetMeleeChanceToHit. defender wound level: 2, increasing CTH by: 10
BCS.GetMeleeCTH. Attacker Melee Skill: 49 / defence from melee 21 / defense from armour 0 / defense from evasion: 6 / attack rating: 1.814815 / melee multiplier: 37.5 bodyPart CTH Multipler:1 use mode CTH multiplier:1 / final chance to hit: 78
CharacterMainScript.SetupMeleeAttack. This is an unarmed attack
CharMainScript.SetupMeleeAttack. Attack damage is: 8.481825 defender HP: 0

You can see other lines more times, like:
Code: [Select]
CharacterMainScript.StartMeleeAttack. Method called. Is overwatch attack: True / is AOO: FalseAnd many others...

Not sure what some do, like (2x with true/true, 4x with false/false):
Code: [Select]
OverwatchManager.SetOverwatchBeingResolved. Current state: True / new state: True
Perhaps the game just calls some functions more times for different reasons. I don't know. Could be completely ok.

But just in case, if there is really something called twice (or more times) and shouldn't, then it may as well be that some boolean/state was not set properly in case there is some loop, or anything else, and overwatch not closed. One would then get the null exceptions as things aren't as before anymore.

The issue doesn't look like being related to enemy removal event though, as when it happens as the looped animation bug, the enemy doesn't fall under this category. But there could be more problems at play, of course.

I didn't see more than one attack, but it happened fast.

Looks like overwatch isn't resolved in this scenario, some code which fleeing characters aren't calling. Worse still, it looks like Ray is attempting to target himself : )

Daithi

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1248
Re: Enemy Running Animation Won't stop
« Reply #12 on: August 10, 2017, 12:43:17 PM »
Ooooooh... I hope testing goes smoothly.  =D

Hey Nomad! As usual, it isn't :)

ushas

  • Hero Member
  • *****
  • Posts: 661
Re: Enemy Running Animation Won't stop
« Reply #13 on: August 10, 2017, 03:37:33 PM »
Well, in other scenarios the enemy wasn't fleeing at the beginning. But it's possible, that after the overwatch attack their status changed.

I was also thinking to report an issue of fleeing enemy reseting behaviour on AOO. But I'm not sure about that. Just preliminary mentioning in case it's something related.

Worse still, it looks like Ray is attempting to target himself : )
I think he's a little bit depressed. As it happens he killed a lot of people. His comrades are using him as a bait, but at the end of the day, they haven't hesitated to sacrifice Ray.
« Last Edit: August 10, 2017, 03:46:21 PM by ushas »

Daithi

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1248
Re: Enemy Running Animation Won't stop
« Reply #14 on: August 11, 2017, 01:33:36 PM »
I think he's a little bit depressed. As it happens he killed a lot of people. His comrades are using him as a bait, but at the end of the day, they haven't hesitated to sacrifice Ray.

:) Fixed the issue with the combined AOO & overwatch. This was one instance whereby the running animation wouldn't stop. I believe this issue was also causing the problem with enemies appearing to be knocked into another tile. Based on your posts, it's likely there are some more issues in this area. Will try to dig some of them up.