Lemmings Forums

NeoLemmix => NeoLemmix Main => Topic started by: WillLem on January 31, 2020, 05:21:16 AM

Title: A Place To Experiment!
Post by: WillLem on January 31, 2020, 05:21:16 AM
Since NeoLemmix and its wonderful editor makes it possible for us to create and play any Lemmings levels we can imagine (big thanks to all developers), I have started this topic to provide a platform for anyone who enjoys experimenting with the possibilities of the engine and its editor.

To get things rolling, here are some levels which seek to discover ways to make direct drop possible!

The first, Direct Drop Test, uses a regular-sized updraft overlaying the exit, which I believe must stop the Lemming from having standard "faller" physics, thus allowing them to drop into the exit from a great height.

The second, Believe in Yourself, is a variation on this theme made to look more like a standard level. The updraft is still providing the direct drop, but has been resized so that it is no longer visible behind the exit.

Thirdly, Wheeeee! can be seen as a celebration of updrafts, allowing the Lemmings to use an exit that doesn't even have terrain beneath it!

Fourthly, The Wierdest Shop Ever takes this concept and makes it into a (very easy) puzzle.

And finally, Just Float! discovers how floaters can also be used to facilitate direct drop technique.
Title: Re: A Place To Experiment!
Post by: WillLem on January 31, 2020, 05:32:31 AM
3.71 seconds seems to be the quickest possible time for a level!
Title: Re: A Place To Experiment!
Post by: Proxima on January 31, 2020, 05:36:53 AM
I think you're forgetting something there.
Spoiler (click to show/hide)
Title: Re: A Place To Experiment!
Post by: WillLem on January 31, 2020, 06:05:55 AM
I think you're forgetting something there.
Spoiler (click to show/hide)

Indeed so!

In that case, 0.53 seconds is the quickest possible. :lemcat:
Title: Re: A Place To Experiment!
Post by: WillLem on January 31, 2020, 06:14:54 AM
Here's a level lasting 0.00 seconds! :lem-mindblown: :crylaugh:
Title: Re: A Place To Experiment!
Post by: WillLem on January 31, 2020, 06:26:40 AM
Whilst we're on the subject, here's the shortest possible level requiring the use of at least one skill, One For The Speedrunners
Spoiler (click to show/hide)

And, another one requiring the use of 2 skills to save 2 Lems, Just a Second
Spoiler (click to show/hide)

The quickest requiring at least one destructive skill, The Flux Capacitor
Spoiler (click to show/hide)

And the quickest requiring at least one constructive skill, Think Fast, which is the closest any of these get to an actual puzzle! :crylaugh:
Spoiler (click to show/hide)
Title: Re: A Place To Experiment!
Post by: namida on January 31, 2020, 06:00:03 PM
A while back I created a level with a 1-second time limit, to prove that a non-trivial level with such a short time can be done.

I posted the result in the Random Level Sharing topic: https://www.lemmingsforums.net/index.php?topic=3743.msg75982#msg75982 (If the link doesn't work in the future, it's Reply #104.)

On a side note, those direct drop hacks with invisible (/hidden) updrafts should never, ever be used outside of theoretical proof-of-concept levels. Such a setup with a clearly visible updraft is fine, of course, because that's not hiding anything from the player.
Title: Re: A Place To Experiment!
Post by: WillLem on February 01, 2020, 01:09:52 AM
A while back I created a level with a 1-second time limit, to prove that a non-trivial level with such a short time can be done.

I posted the result in the Random Level Sharing topic: https://www.lemmingsforums.net/index.php?topic=3743.msg75982#msg75982 (If the link doesn't work in the future, it's Reply #104.)

Neat little puzzle. Can't help but think that a save-all solution would have been more satisfying, but to be fair it doesn't seem to be possible; by adding a walker I can get the button Lem to turn around and even exit, but just past the 1-second limit.

On a side note, those direct drop hacks with invisible (/hidden) updrafts should never, ever be used outside of theoretical proof-of-concept levels. Such a setup with a clearly visible updraft is fine, of course, because that's not hiding anything from the player.

Duly noted ;)
Title: Re: A Place To Experiment!
Post by: WillLem on February 05, 2020, 11:37:48 PM
Here are a few versions of a level titled Clickbait, the purpose of which is to see what the maximum possible enforcable* number of Lemmings that can be saved is in NL using cloners to increase the number (hence the title!).

* (as in - the save requirement for the level)

At first, I assumed it would be 500 (401 hatch Lems + 99 cloners - the maximum allowed in the latest version of NL), due to the fact that the editor doesn't let you specify a save requirement higher than 500.

Then, Proxima pointed out that you can edit the number of hatch Lems and indeed the save requirement pretty much as high as you like by editing the level in a text editor.

So, I made a version with 1,000,000 Lemmings with a save requirement of 1,000,099 (can still only have 99 cloners maximum).

But, obviously, in the light of this new knowledge it would be theoretically possible to have an infinite number of Lemmings, so this experiment must conclude: ERROR! Please reset! :lem-mindblown:

I therefore decided to make a "sensible" version of the level with just 1 Lemming and a save requirement of 100.

If you're interested to see what a level with 1,000,000 Lemmings looks like though, see attached. :lemcat:
Title: Re: A Place To Experiment!
Post by: namida on February 06, 2020, 12:07:29 AM
2147483647 is the highest number of lemmings that would "make sense" to the game. Beyond this, overflow occurs, and NL thinks there's -2147483648 lemmings (note the minus sign at the start). This is a technical thing - look up "overflow" in the context of programming if you want more info.

So - cloners or no, that's the most lemmings you could actually have theoretically.

In practice, it's much lower due to memory limitations. NeoLemmix is a 32-bit application, so it can only use up to 2GB of memory - you'd hit this long before reaching anywhere near that number of lemmings. But exactly when, would depend on many factors, including the size of the level, how many interactive objects it has, how much variety of pieces it contains, even how many frames it actually takes to spawn the lemmings (you'd be able to get in slightly more if they're all preplaced rather than spawning over many frames).
Title: Re: A Place To Experiment!
Post by: WillLem on February 06, 2020, 01:55:12 PM
2147483647 is the highest number of lemmings that would "make sense" to the game...So - cloners or no, that's the most lemmings you could actually have theoretically.
---
In practice, it's much lower due to memory limitations.

Interesting. Why 2,147,483,647? It seems such a specific number! Is there a reason for this particular amount, as in relating to other factors in the game's code?

I've changed the 1,000,000 Lemmings level so that it no longer involves having to assign cloners, so that it's easier to perform tests with.

Using an older version of NL, I can frameskip 1000 frames at a time without it taxing the memory too much, but only until about the 120th minute, at which point it begins to lag.

This level features multiple hatches, because I wanted a random Lemming to come out from a different hatch (hence the title One in a Million), requiring a glider assignment. There are therefore 17 hatches in this level - would this slow things down?

Just in case, I've also made a level which is simply 1,000,000 Lemmings spawning from a single hatch and falling directly into an exit, simply titled Lemmillionism.

I've noticed that, upon cancelling these levels, the post-screen only displays up to 4 figures for saves/save requirement, so... would the level be "passed" if 9999 saves was reached?
Title: Re: A Place To Experiment!
Post by: Proxima on February 06, 2020, 03:53:23 PM
Interesting. Why 2,147,483,647? It seems such a specific number! Is there a reason for this particular amount, as in relating to other factors in the game's code?

That's 2^31 - 1, or the highest value that can be expressed with 31 binary digits.
Title: Re: A Place To Experiment!
Post by: WillLem on February 06, 2020, 05:36:14 PM
That's 2^31 - 1, or the highest value that can be expressed with 31 binary digits.

Ah right, thanks - I'm guessing 31 binary digits is the limit for 32-bit software...?

I'm still learning binary... as far as I know, there are 10 types of people: those who understand binary, and those who don't.

As an experiment, I left Lemmillionism running with a 100 frameskip applied whilst I was out today. When I got back, I had the "Out of memory" error message! 76,312 Lemmings had been saved though - the post-screen recorded this as 6,312, with a save requirement of 0000. :crylaugh:
Title: Re: A Place To Experiment!
Post by: namida on February 06, 2020, 05:55:42 PM
Quote
Interesting. Why 2,147,483,647? It seems such a specific number! Is there a reason for this particular amount, as in relating to other factors in the game's code?

Because the game stores the lemming count in a 32-bit signed integer. It's nothing to do with it being a 32-bit app specifically - a 32 bit app could still have a signed (or unsigned) 64-bit integer, and that's without going into floating-point values which work a bit differently.

On this note - an unsigned integer has the same amount of possible values as a same-bit-count signed integer; just the range is different. In the case of 32-bit, a signed integer can have values from -2147483648 (ie: -(2^31)) to +2147483647 (ie: (2^31)-1), for 2^32 possible values. An unsigned integer still has 2^32 possible values, but instead they range from 0 to 4294967295 (ie: (2^32)-1).

A 64-bit integer would instead have 2^64 possible values. However, aside from that it's clearly not going to matter in any real-world situation, increasing the lemming count to a 64-bit value probably wouldn't achieve anything useful here - it's very likely the TObjectList (a Delphi structure that contains list of "objects" (in the programming sense), in this case, the lemmings) uses a 32-bit integer to count how many objects it contains, so we'd still get issues. And even if not - we'd exceed the available memory for a 32-bit app before we got anywhere near 2^32 lemmings; a full change to 64-bit app would be needed to avert that.

Quote
This level features multiple hatches, because I wanted a random Lemming to come out from a different hatch (hence the title One in a Million), requiring a glider assignment. There are therefore 17 hatches in this level - would this slow things down?

Yes, but the impact would be almost negligable compared to the thousands of lemmings. Lemmings are complicated to process. Objects are not. Drawing objects is processor-intensive, but they aren't actually being drawn during a frameskip. The game does have to quickly check each object to see if it needs anything, but in the case of an entrance, that's all it needs to do with them once they've opened. (Spawning the lemmings happens seperately from the general object update code.)

On a side note, the lack of a need to draw anything during frameskips (aside from updating the terrain layer with destructive / constructive skill masks; it also takes save-states every so often but this is just a blind "make a copy" without doing any actual new drawing) is why processing times for a frameskip don't really differ much between low-res and high-res, even though high-res does slow down live gameplay. Indeed, on a level with not so many lemmings, I tried out a 1mil frame frameskip once; high-res did take a bit longer to process but the difference was basically negligable.

Quote
Just in case, I've also made a level which is simply 1,000,000 Lemmings spawning from a single hatch and falling directly into an exit, simply titled Lemmillionism.

No-longer-existing lemmings (whether due to death or exiting) are less processor-intensive than still-existing ones, but they still have an impact. There are technical reasons the game still needs to know about them.

Quote
I've noticed that, upon cancelling these levels, the post-screen only displays up to 4 figures for saves/save requirement, so... would the level be "passed" if 9999 saves was reached?

No. That's purely a cosmetic thing. Looks like you already answered that with your 76312 saved situation, though. (Interestingly though, vanilla Lemmix does have a bug along these lines. It calculates the %, rounds it off, then determines pass or fail based on the rounded % instead of the actual saved count / requirement. This means for example, if you had a level with 200 lemmings that required 199 to be saved, the player could save 198 and still pass the level, as both of these come out as 99% in Lemmix. This bug was fixed very early in NeoLemmix.)
Title: Re: A Place To Experiment!
Post by: Strato Incendus on February 07, 2020, 09:28:40 AM
A different thing just came to my mind this morning:

What happens when you put a splat pad into an updraft and then have terrain go through it? Can you make it so that lemmings can fall through the updraft (which resets their fall height) so that they don't splat underneath it, but when you try to e.g. platform through the updraft to have the lemmings land within the updraft area, they will splat because the area is entirely covered by splat pads? :evil:

With splat pads and anti-splat pads overlapping, this wouldn't make much sense to try out, because both require terrain inside their trigger area in order to work. But due to the slight differences between updrafts and pads, this might be an interesting corner case.

Or does the updraft simply always overwrite any "splat" characteristics, so that the splat pad inside the updraft simply is ignored, even when a lemming lands on terrain inside the trigger area of the splat pad (that is also covered by an updraft)?
Title: Re: A Place To Experiment!
Post by: namida on February 07, 2020, 05:11:39 PM
If the splatpad and updraft overlap, I'm not sure which takes priority. A splatpad below an updraft would work as normal.
Title: Re: A Place To Experiment!
Post by: WillLem on February 08, 2020, 03:24:11 AM
What happens when you put a splat pad into an updraft and then have terrain go through it?

I've attached a level which I think tests what you're asking - feel free to edit it accordingly if it's not quite what you mean. I have the Lemming on the left walk up a diagonal slope which takes him upwards through an updraft/splatpad combo - there is also a walker so he can turn and walk back through it. Also, there is an updraft/splatpad combo in the gap; platforming through it doesn't seem to have any effect...

Or does the updraft simply always overwrite any "splat" characteristics

As shown in the level - splatpads override updrafts! This is the case no matter which is "in front".

If the splatpad and updraft overlap, I'm not sure which takes priority. A splatpad below an updraft would work as normal.

Conversely, anti-splat pads override splat pads! Again, this is the case no matter the order of the objects. The Lemming on the right falls onto a splat/anti-splatpad combo, with the spatpad in front. They fall safely!
Title: Re: A Place To Experiment!
Post by: namida on February 08, 2020, 07:10:02 PM
It makes sense that one takes priority regardless of object order. NeoLemmix's object detection basically checks "Is there an object of type A here? If so, handle it. If not, check - is there an object of type B here? If so, handle it. If not, check - is there an object of type C here?" and so on, until every type is checked for.

NL only checks for the individual object, if it's an object type where the individual object matters. So for example - if NL detects "there's a fire object here", the lemming dies - NL never makes any effort to figure out which fire object it is, because this doesn't matter, a fire object will always kill a lemming, so the object order doesn't matter. At the start of the level, NL has already figured out "this pixel is covered by a fire object" and that's all it pays attention to from there on. On the other hand, if NL detects "there's a triggered trap here", NL must then figure out exactly which trap it is (because firstly, it must check the trap isn't already in use, and secondly, it must animate the trap). Only at this point does the order of objects become relevant.