FullFrontalFrog / OhSoHeroTracker

Issue tracker / bug report list for Oh So Hero!
2 stars 0 forks source link

Pausing the game might affect AI behavior #29

Closed MagLjudik closed 1 year ago

MagLjudik commented 3 years ago

Oh So Hero! v. 0.16.200

Summary

OSH Discord member Jon-Nobo discovered a following bug: After they paused the game, all enemies on screen started to act weird and just idle, not reacting on Joe. I investigated the issue and can confirm it is present in the current build. While I did spam the pause button to confirm the issue, this might occur after a single pause at a certain moment, that breaks the AI behavior of all enemies that noticed Joe's presence at that moment.

This bug seems to affect all the enemies except Goliath, Blowey and O'Deerie, who keep on attacking Joe.

Consequences

Enemies don't react on Joe's presence, attacks etc. and can be easily beaten, swooned or skipped. They either don't move or move slightly, but always turn towards direction Joe's at. Only affects enemies that were actively targeting Joe, so idling enemies/ones outside the screen are not affected by this.

Steps to recreate

  1. While in-game, trigger some enemies to attack Joe
  2. Spam the pause button or push it at some moments before you notice enemies are idling.

Result expected: No behavior changes. Result achieved: Enemies are helpless!

Examples

Jon-Nobo's footage My footages: Here and Here

Configuration and system information

Was not provided by original reporter

MagLjudik commented 2 years ago

The issue still occurs in 0.17.900

MagLjudik commented 2 years ago

@FullFrontalFrog By experimental way, I found out that this AI behavior can be triggered by pausing the game during the specific moment where enemy attempts to grab Joe (at the very start of animation) or the very moment he succeeded at it. Tested to affect most enemies. I have tried to pause during other animations as well, and sometimes it triggers this behavior as well. For some reason, O'deerie is not affected by this bug.

So basically, you don't need to spam it or go to settings like it was previously reported - you just need to pause during specific moments.

FullFrontalFrog commented 1 year ago

Goliath, Blowey and O'Deere don't move around except through grab attacks, so if this bug doesn't affect them, the bug may be related to the movement code. I'm currently investigating.

FullFrontalFrog commented 1 year ago

I was able to replicate this bug and engineer a fix. The problem was simply that the AI was not checking if the game was paused and would continue to execute commands, leading to a broken state. All of the pertinent asynchronous methods in the base enemy AI class now hold in place while the time thread is paused. A fix is ready for version 0.19.100!

MagLjudik commented 1 year ago

I forgot to test this last time, but the issue is indeed gone in pre-release build as I post this.