Opened 4 years ago

Closed 2 weeks ago

#13675 closed defect (fixed)

TWINE: Sometimes twinsen get's stuck in in a loop of throwing the magic ball

Reported by: mgerhardy Owned by: mgerhardy
Priority: normal Component: Engine: TwinE
Version: Keywords: input
Cc: Game: Little Big Adventure

Description

(hard to reproduce, happened three times during the playthrough for me) only thing that helps breaking out of it is going into the ingame menu.

This happens if you e.g. open the debug console as ctrl is pressed there, too.

Change History (10)

comment:1 by vvs-, 4 years ago

AFAIK, that happened to me when Alt release event get lost.

comment:2 by mgerhardy, 4 years ago

when you have the magicball (and the throw action is bound to alt) - and you open the debugger with ctrl+alt+d - the game gets the alt press event - and starts to throw the magicball. you now leave the debugger - and the alt release event was eaten in the meanwhile. the game never gets the up event - so you have to press alt again to stop throwing. This might be related to the issue the user reported - but as the user mentioned that only the main menu helped, it also might not be related - just the same symptom.

comment:3 by mgerhardy, 4 years ago

Keywords: input added

comment:4 by mgerhardy, 4 years ago

796f54ff895a308220b2b6162ab9d742274cf1c5 fixes the mentioned debug console issue.

comment:5 by antoniou79, 2 years ago

This issue has happened a few times during my today's play session with 2.9.0git (local build from current master HEAD) on Windows 10.

It was unrelated to opening the debug console.

I was keeping Alt down to make Twinsen spam his magic ball attack, and he kept doing it non-stop after the enemy had died and I let go of the Alt key.

Changing Twinsen's mood with "Ctrl" key did work to stop Twinsen's stuck ball throwing loop.

comment:6 by mgerhardy, 21 months ago

I can't find a way to reproduce this (on linux) - is there maybe some OS key handling bound to any of the in-game combinations. I don't know - maybe ALT+Left while turning is bound to something in the OS e.g.?

comment:7 by antoniou79, 21 months ago

I've played for a few hours the last couple of days and I think I have found a way to reproduce this pretty consistently.

It happens while Twinsen is fighting an enemy who is also attacking Twinsen, and if, while holding down Alt to throw the magic ball, Twinsen gets hit by an enemy, then it's very likely that he'll get stuck throwing the ball even if the player has stopped pressing on the Alt button.

This also happens for other animations as well; the one I've spotted is Twinsen's attack while in Aggressive mode, while holding down Space. Again, if he gets hit, he is very likely to keep repeating the air kick animation indefinitely.

The "stuck" behavior stops if Twinsen's behavior mode is changed from the Ctrl screen.

comment:8 by mgerhardy, 19 months ago

maybe related to the LastJoyFlag and LastMyFire as well as LastMyJoy input handling. In doDir is an InitAnim call that I have to check

comment:9 by mgerhardy, 2 weeks ago

The original game has this gate in its movement processing:

if (MyFire OR ActionNormal) {

process movement, detect input changes, reset animations

}
LastMyJoy = MyJoy;
LastMyFire = MyFire;

MyFire is a bitmask of ALL fire buttons (Space, Alt, Ctrl). When any fire button is held, movement processing is skipped. When the button is
released, the change is detected (MyFire != LastMyFire) and standing animation is triggered.

In ScummVM, this gate was incorrectly implemented as !_changedCursorKeys (which checks if all 4 direction keys are pressed simultaneously —
essentially always false, making the condition always true). This meant:

  1. The movement block always ran, even during attack actions
  2. _lastJoyFlag got reset to false during hit animations (when the early-return checks didn't match)
  3. The Alt/ThrowMagicBall key state was never tracked for change detection

The result: when Twinsen gets hit while holding Alt (magic ball) or Space (aggressive attack), the hit animation interrupts and queues the
attack animation to resume. After the hit, the attack animation resumes with _flagAnim = ANIM_REPEAT (looping). Since the input change was never
detected, the animation loops forever.

comment:10 by mgerhardy, 2 weeks ago

Owner: set to mgerhardy
Resolution: fixed
Status: newclosed

07a6b13ea878b206c376bc24fa4acef04f0e937f should fix the issue - if you can still reproduce this, please re-open the ticket.

Note: See TracTickets for help on using tickets.