[FIXED] How long does it take to explode? [BUG]

Started by Nepster, April 16, 2016, 04:33:34 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Nepster

Quiz question: If a lemming walks into a radiation object, how long does it take for him to explode? Hint: A little "9" appears above the lemming.

Solution

Only roughly 8.5 seconds! Why? Because every 16 frames the number counts down. So the count-down takes 144 frames in total, which amounts (with 17 frames per second) to 8 8/17 = 8.47 seconds.
And it gets even better: Even though exploding takes 144 frames in total, not all "count-down seconds" are equally long! The "9" stays only for 15 frames, but to compensate the "1" stays for 17 frames!

Sorry, but fixing that will break all replays of levels that use radiation/slowfreeze objects. A few levels might even need modifiations.

namida

Ouch. o_O Fortunately, those objects (or solutions involving the nuke, which I'd be very surprised if it wasn't also affected to some extent) are quite rare, and it's primarily my own levels that use the former.

I don't think I've ever modified the code that handles the actual counting down, so this also raises a question of whether Lemmix may have an inconsistency from DOS in this area too, at least with the countdown (obviously radiation is irrelevant there, but it has timed bombers).

In regards to replay breaking - it's annoying, but should not be the primary factor in making a decision. The correct approach here would be "make the countdown start at 9 and work properly (17 frames per 1 second)", not "leave it as is" or "do weird stuff in order to preserve replays".
My projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)
Non-Lemmings: Commander Keen: Galaxy Reimagined (a Commander Keen fangame)

Simon

What benefits would the 9*17-frame countdown have over the 144-frame countdown?

The physics update should be the only unit of time for computations. Seconds are not interesting, they're a weird multiple of the main unit of time. There is cultural value in 5 seconds, the L1 exploder had that. There is hand-on value in 144 frames, because it matches the old NL radiation replays.

The only value in 9*17 is that you can keep the presentation, without the presentation lying about the mechanics. I accept that marking the radiated lems is good. But displaying the remaining physics updates rounded to seconds is too coarse to be useful.

-- Simon

Nepster

Quote from: Simon on April 19, 2016, 12:02:53 PM
What benefits would the 9*17-frame countdown have over the 144-frame countdown?
The countdown time has to set to some (arbitrary) value and none is intrinsically better than the other. I do care that the seconds displayed match the internal frame count, but it really doesn't matter whether it's 144 frames (with the "9" only displayed for half a second) or 153 frames (= full 9 seconds).
I slightly lean towards 153 frames, because seeing a "9" displayed, the player implicietly assumes to have full 9 seconds and not some fractional value. From a psychological point of view, I think players would prefer "8" for 25 frames before switching to "7", instead of displaying "9" for only 8 frames and then switching to "8". With the ["8" for 25 frames]-option they are granted an extension before the explosion occurs while with ["9" for 8 frames]-option they got cheated half a second!

ccexplore

Quote from: namida on April 16, 2016, 11:27:21 PMI don't think I've ever modified the code that handles the actual counting down, so this also raises a question of whether Lemmix may have an inconsistency from DOS in this area too, at least with the countdown

Nope, I'm fairly certain it is doing exactly what happens in DOS Lemmings, feel free to check in DOSBox or actual DOS.  My guess is the code was just ported over as-is from the Amiga version where I believe it's 16 frames per game second rather than 17.  The real mystery would be how DOS wound up using 17 frames per game second.

Tsyu

#5
The PAL Amiga version runs at 16 2/3 (specifically, 17, then 17, then 16) frames per game second, with 3 PAL frames (60 ms) per game frame. The NTSC version runs at 17.5 (18, then 17) frames per game second, with 4 NTSC frames (about 66 2/3 ms) per game frame. Neither one runs at 16 FPS.

ccexplore

Interesting.  So it sounds like "Just a Minute" would be more difficult time-wise on PAL Amiga compare to NTSC Amiga then.

To be honest I didn't know the actual timing details of Amiga, I only knew that a few one-minute levels like "It's Hero Time" and "Just a Minute" were observably faster than DOS when I played on the Amiga version, which presumably must be the PAL one based on what you said.  So I kind of assume 16 based on the number being one less than DOS's 17. ;P

It's still somewhat unexpected as I sort of assumed a game second to be closer to a real-time second on the Amiga version, but sounds like that's not the case either.

The use of a 16-based explosion timer is consistent with many other aspects of the game physics though--most skills do have a cycle of length 16 or 8 game frames.  It's just not consistent with the game timer.