Smooth moves

Started by Simon, September 08, 2016, 06:42:35 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Simon

I've dabbled in the Lemmini source on bitbucket, or
git clone https://bitbucket.org/fade0ff/lemmini
Does the Superlemmini source sit somewhere on the web, too? namida pointed me to the zip in the Superlemmini 1.03 release thread.

I've always wondered whether Lemmini is fully hi-res, or lo-res physics with hi-res graphics. The lemmings move very smoothly compared to other games. Is this a purely visual perk, or are the game physics this smooth?

The answer is full hi-res: Builders move 4 pixels ahead during a cycle, that's hi-res. Nonetheless, hi-res isn't obvious: Fallers fall 3 pixels per physics update, that's the same speed as Dos L1 fallers, which would imply lo-res. Hmm.

The solution is that Lemmini performs a physics update every 30 ms, this means 33 frames per second. It updates twice as fast as Dos L1 or Neolemmix at 17 fps, and more than twice as fast as Lix at 15 fps. If we fall at Dos L1 speed, and the distance fallen is half as much as Dos's due to hi-res vs. lo-res, and we fall twice as often, everything fits together again.

But 33 fps isn't obvious from the source either. The source boldly claims:
/** Lemmini runs with 50fps instead of 25fps */
TIME_SCALE = 2;
Bleh? This comment won't digest smoothly with
/** time per frame in microseconds - this is the timing everything else is based on */
MICROSEC_PER_FRAME = 30*1000;

...and this is the code used in the main loop. But doesn't matter, either 25 fps or 33 fps is more than Dos L1, and the thing is definitely hi-res.

Now, if you watch Lemmini closely, you will notice that the lems moonwalk. In detail: Walkers alternately move ahead by a hi-res pixel and animate, and then, in every other physics update, they move ahead by a hi-res pixel, but don't animate. This comes from TIME_SCALE = 2; the lemmings animate only every other physics update.

I conjecture that Windows Lemmings was lo-res physics with hi-res animations, and then Lemmini took the hi-res animations into faster, hi-res physics. Can someone shed light on the Windows Lemmings?

-- Simon

ccexplore

Tsuyu can confirm, but from vague memories I believe Lemmini was intended from day one of conception to be hi-res in both physics and graphics.  Using the WinLemm graphics was probably a practicality as there were no other readily available hi-res graphics to borrow.  Your conjecture on WinLemm is probably correct and would explain why Lemmini compromised on the animation given that the source did not have animations at a doubled framerate.

Simon

Thanks, these design decisions are good to know. 2006 was before I began to lurk Lemmingsforums. 8-)

-- Simon

Tsyu

Quote from: Simon on September 08, 2016, 06:42:35 AM
But 33 fps isn't obvious from the source either. The source boldly claims:
/** Lemmini runs with 50fps instead of 25fps */
TIME_SCALE = 2;
Bleh? This comment won't digest smoothly with
/** time per frame in microseconds - this is the timing everything else is based on */
MICROSEC_PER_FRAME = 30*1000;

...and this is the code used in the main loop. But doesn't matter, either 25 fps or 33 fps is more than Dos L1, and the thing is definitely hi-res.
MICROSEC_PER_FRAME (or NANOSEC_PER_FRAME in SuperLemmini) sets the time interval between frames--in this case, 30 ms, which results in a frame rate of about 33.33 FPS. TIME_SCALE only affects lemmings, and it sets how often lemming graphics animate, among other things--in this case, every 2 frames. (By the way, the "50fps instead of 25fps" comment is wrong; neither Lemmini nor SuperLemmini runs at 25 or 50 fps. I'm not sure where the 25 figure came from, but it's definitely wrong for Lemmini, SuperLemmini, and even the Amiga version of Lemmings.)

Quote from: Simon on September 08, 2016, 06:42:35 AM
I conjecture that Windows Lemmings was lo-res physics with hi-res animations, and then Lemmini took the hi-res animations into faster, hi-res physics. Can someone shed light on the Windows Lemmings?
Correct. I'll also add that Windows Lemmings runs a bit slow, with each game second taking longer that it should, but I think it still has 17 frames per game second.

Quote from: ccexplore on September 08, 2016, 07:09:46 AM
Tsuyu can confirm, but from vague memories I believe Lemmini was intended from day one of conception to be hi-res in both physics and graphics.  Using the WinLemm graphics was probably a practicality as there were no other readily available hi-res graphics to borrow.  Your conjecture on WinLemm is probably correct and would explain why Lemmini compromised on the animation given that the source did not have animations at a doubled framerate.
I'm pretty sure you're correct there.

Simon

Awesome, thanks for making this clear.

-- Simon