Author Topic: [Resolved] AI Hang: Masked churcher with a grenade  (Read 12061 times)

ushas

  • Hero Member
  • *****
  • Posts: 661
[Resolved] AI Hang: Masked churcher with a grenade
« on: January 26, 2018, 05:49:52 PM »
(v23, linux, HB)

Had a bit time on the afternoon so this is the second AI freezing the battle recreation as reported by steam users:
http://steamcommunity.com/app/545600/discussions/1/1693785035818232948

This time it's a churcher trying to throw a grenade situation:

Used the same map as on awg's picture, DowntownMed4.
In this setup, according to the log he was aiming a tile where Emilia is standing on the picture.

Last lines of Mr. Mask:
Code: [Select]
PathFindingScript.FindPath. Open list count is zero
PathFindingScript.TraceAndReturnPath. Number of elements in path: 0 No path has been found. Can trace through occupied: False
CharacterAIScript.GetMoveCloserOrder. Position of player to move closer to: -1
CharacterAIScript.GetRangedOrdersAgainstEnvironmentObjects. Method called. There are: System.Collections.Generic.List`1[InteractableEnvironmentObject] IEOS. Current meta orders: 16
Item.CheckIfEnoughAmmoForAttack. Use mode: 0
CharacterAIScript.GetRangedOrdersAgainstEnvironmentObjects. Completed. Current meta orders: 16
CharAIScript.GetThrownWeaponOrders. Distance between character 0 : Sam Contino and character 1 : Elena Furey is: 2
CharAIScript.GetThrownWeaponOrders. Distance between character 0 : Sam Contino and character 2 : Emilia DeSoto is: 1
CharAIScript.GetThrownWeaponOrders. Distance between character 0 : Sam Contino and character 3 : Ray Case is: 3
CharAIScript.GetThrownWeaponOrders. Distance between character 1 : Elena Furey and character 2 : Emilia DeSoto is: 1
CharAIScript.GetThrownWeaponOrders. Distance between character 1 : Elena Furey and character 3 : Ray Case is: 1
CharAIScript.GetThrownWeaponOrders. Distance between character 2 : Emilia DeSoto and character 3 : Ray Case is: 2
CharAIScript.GetThrownWeaponOrders. Number of AOE connections is: 6
CharAIScript.GetThrownWeaponOrders. Number of characters: 6
CharAIScript.GetThrownWeaponOrders. Target with most surrounding targets is: 0
CharAIScript.GetThrownWeaponOrders. Chose tile: (7.0, 45.0)
PathFindingScript.FindPath. Open list count is zero
PathFindingScript.TraceAndReturnPath. Number of elements in path: 1 No path has been found. Can trace through occupied: False
PathFindingScript.FindPath. Open list count is zero
PathFindingScript.TraceAndReturnPath. Number of elements in path: 1 No path has been found. Can trace through occupied: False
PathFindingScript.FindPath. Open list count is zero
PathFindingScript.TraceAndReturnPath. Number of elements in path: 1 No path has been found. Can trace through occupied: False
CharAIScript.ScoreAndChooseMetaOrder. Method called. Number of Meta Orders to choose from: 19 behaviour type is: 0
CharAIScript.CalculateAggressiveOrderScore. Scoring orders for aggressive character. Average distance to enemy: 7.5
CharAIScript.GetFireScoreMultiplier. Number of fire tiles passed through: 3 penalty: 0.4
CharAIScript.GetFireScoreMultiplier. Number of fire tiles passed through: 4 penalty: 0.5
CharAIScript.GetFireScoreMultiplier. Number of fire tiles passed through: 4 penalty: 0.5
CharAIScript.GetFireScoreMultiplier. Number of fire tiles passed through: 3 penalty: 0.4
CharAIScript.GetFireScoreMultiplier. Not standing on fire tile. No penalty.
CharAIScript.GetFireScoreMultiplier. Not standing on fire tile. No penalty.
CharAIScript.GetFireScoreMultiplier. Not standing on fire tile. No penalty.
CharAIScript.GetFireScoreMultiplier. Not standing on fire tile. No penalty.
CharAIScript.GetFireScoreMultiplier. Not standing on fire tile. No penalty.
CharAIScript.GetFireScoreMultiplier. Not standing on fire tile. No penalty.
CharAIScript.GetFireScoreMultiplier. Not standing on fire tile. No penalty.
CharAIScript.ScoreAndChooseMetaOrder. Chosen order position is: 16
CharAIScript.ExecuteNextAIOrder. Chosen meta order position is: 16 current order position is: 0 number of orders is: 1 order type: 3
CharMoveScript.AnimateThrownWeaponDraw: Method called
CharacterMainScript.SetupThrownAttack. Method called. Target tile is: (7.0, 45.0)
CharMainScript.SetupThrowAttack. Can't throw this far

It ends with the same as noted by awg, "Can't throw this far".
What visibly happened is that he switched from smg to grenade and turned. Then he freezes, not even any idle movement. This AI hanging seems happen a bit later than in other cases, i.e. he managed to do some actions.
« Last Edit: January 30, 2018, 04:06:23 PM by Daithi »

Daithi

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1250
Re: AI Hang: Masked churcher with a grenade
« Reply #1 on: January 26, 2018, 06:02:24 PM »
Thanks, I'm going to tackle this one soon. Will review code to figure out how invalid orders are getting through and set up a test scenario where eveyone gets grenades to test fixed.

ushas

  • Hero Member
  • *****
  • Posts: 661
Re: AI Hang: Masked churcher with a grenade
« Reply #2 on: January 27, 2018, 01:41:59 AM »
Heh, adding nothing new on top of what was already reported. Sounds like a fun. Good luck with that!
In this case, fire is indeed suspicious element. However, the churcher had no problem to go through fire and switch to smg to shoot at one of us on a turn before that. It hangs after he changes to grenade.

I'll try catch (well, 'try' as far as luck goes) if there are other situations, in case it might help to narrow things down for you.
Were there any other AI hanging reports? Those screens help a lot.

Daithi

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1250
Re: AI Hang: Masked churcher with a grenade
« Reply #3 on: January 30, 2018, 01:46:43 PM »
Trying to untangle this now. Hard to call on the fire - it could well be a factor. Another possibility: does the character ever move before the throw when the game hangs on an AI throw? In the recent examples I've seen, I don't think they have.
« Last Edit: January 30, 2018, 01:49:47 PM by Daithi »

Daithi

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1250
Re: AI Hang: Masked churcher with a grenade
« Reply #4 on: January 30, 2018, 03:20:26 PM »
Many debug statements later: looks like a logic error which is more likely to occur when fire is present. Now to test...

ushas

  • Hero Member
  • *****
  • Posts: 661
Re: [Resolved] AI Hang: Masked churcher with a grenade
« Reply #5 on: January 30, 2018, 05:11:51 PM »
Re movement: In the OP situation no, he only changes weapons on that last turn. It's not so near, perhaps he should have moved before trying to throw?

Have another AI hanging for this one saved in the pockets, can fetch the screen and log lines later on in case you need it? Think it was a construction site, also one 3x3 fire present, but only from a barrel.

Daithi

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1250
Re: [Resolved] AI Hang: Masked churcher with a grenade
« Reply #6 on: January 31, 2018, 10:48:45 AM »
If the last line is can't throw this far, or it's grenade related no need to send. Had to spend half and hour adding debug statements to get enough info to fix, either way, it's unlikely to have enough info to be very useful.

ushas

  • Hero Member
  • *****
  • Posts: 661
Re: [Resolved] AI Hang: Masked churcher with a grenade
« Reply #7 on: January 31, 2018, 05:04:15 PM »
Oh. Sorry, haven't realized it's already fixed, that's neat.
Uff, debug exercise. There was a time, I would declare gdb a sworn enemy. Then a friend introduced me to Python... 
Yeah, there is a limit what can supply. Yup, the same last line and a masked guy unwilling to detach from his grenade. Nothing new.

... there are yet other AI hangings, however. A bit different. Will post later on when having time to write down and upload screens. Bet sounds like happy news ;D

Daithi

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1250
Re: [Resolved] AI Hang: Masked churcher with a grenade
« Reply #8 on: January 31, 2018, 05:23:08 PM »
Yay, more bugs! Please do - don't like the idea of there being serious bugs, but it's a nice feeling to get them fixed