[+][BUG][PL] Alarm sounds when not needed

Started by chroda, August 01, 2025, 11:15:18 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

chroda

NeoLemmix CE 1.0.1
The following is based on three game files with a Time Limit of 2 seconds, available as attachments
test_1.94_.nxlv
test_2.00_.nxlv
test_2.06_.nxlv   
     
If a Time Limit is assigned to a level, and the assigned value is exceeded, an alert lasting approximately 2 seconds is heard, similar to the sound of an alarm clock.

Except that...

If we run test_1.94_.nxlv: no alarm clock sound and the message "Superb! You rescued every Lemming..."  "Your time taken is 0.01. 94" is displayed.
It makes sense.

If we run test_2.06_.nxlv: alarm clock sound for about 2 seconds and no display "
It makes sense.

If we run test_2.00_.nxlv:
The result is: "Superb! You rescued every Lemming..."  "Your time taken is 0.02. 00"
and we hear the alarm clock sound for about 2 seconds, indicating that the Time Limit has been exceeded, which contradicts the result displayed.
It doesn't make sense; we should not hear the alarm clock sound in this specific case.

Can this be fixed?

WillLem

I'm aware of this one, I'll aim to get it fixed in the next update.

WillLem

#2
Had a look at this one today. The problem is that the behaviour is technically not a bug. The lemming is saved and time runs out on the same frame, so the lemming counts as saved (thus completing the level) and/but the "time up" sound is also cued (correctly).

It's possible to ask the game to wait another frame before cueing the sound, which seems to "fix" the reported bug, but is essentially cueing the sound 1 frame too late, which itself is a bug.

Not entirely sure what to do about this one.



EDIT:

It may be possible to ask at the current frame "do we need to play the sound?" and check for certain conditions, but I'm not entirely sure what those conditions should be. Ideally, they'd be anything that would cause the game to exit to postview. However, we're then making a check for "exit to postview" twice per frame purely for the purposes of cueing the "time up" sound: this is clunky.

Another idea might be to move the "time up" sound cue to later in the same frame. The hope, then, is that the game will have finished and exited before the cue is reached. I'll check for this later.