Lemmings 2 style and\or level file limitations

Started by kaimitai, September 20, 2021, 05:29:56 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

kaimitai

Greetings,
A couple of weeks ago I started working on a modding tool for Lemmings 2 - a combined level and style file editor. While I have made a lot of progress with my code interfaces, the game seems to enforce some limitations that I have not seen documented anywhere. ??? Attached is an edited style and level file, which works for a while - but at some point it either:

soft locks the game
or
exits the level counting all lemmings as dead.

The edits to the style file seem fairly safe to me; I just injected some custom tile graphics (and corresponding previews), presets and changed the tiles used by some object tilemap animations.

I was hoping someone with more experience of the game and l2 tech could help point me in which direction to look to find out which limitations I am exceeding.

The files replace polar level 1, and I ran the game using the l2-fix executable.
Life is like a sewer. What you get out of it, depends on what you put into it. --Tom Lehrer

Dullstar

I'd recommend testing the edits in isolation to see if you can figure out exactly which edit is causing it. Once you've identified which edit(s) cause the issue, it will give you some information about where to look.

kaimitai

Thanks for the reply. While you are right, I have very limited free time for that kind of incremental investigation, so I just threw it out there in case the community had some knowledge to share. The video in your signature, for example, shows one unexpected quirk of the engine. :)

Most likely I will release the editor at some point, once I build a more usable gui on top of my code, and let interested parties work with me cataloguing what the actual game will allow and not.
Life is like a sewer. What you get out of it, depends on what you put into it. --Tom Lehrer

namida

It is possible that it's not a single factor's presence, but rather the overall quantity of something - in particular something that comes to mind here is the "face limit" in Lemmings 3D, where if there are too many block faces present in the level glitches start occurring (but no specific single element triggers this, it's the overall quantity).

To be clear I have no experience with L2 myself (only with L1 and L3D), this is just a general statement.
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)

Dullstar

Namida raises a good point, but testing each portion in isolation would of course give information if none of the edits alone cause the issue.

If you at least have time to give isolated versions of each edit, I have time to test them.

geoo

While I've messed around with the formats a lot to reverse engineer them back in the day (btw let me know if you want any of that code or notes, if they are not floating around somewhere, though you seem to be on top of everything in this regard), I'm not sure of what the limits are for various things.
It might be worthwhile to figure out how to take a RAM dump of the game in progress to understand a bit better what's going on there. For example, I remember blockers use some space in RAM that overlaps with parts of the level RAM if the level is too large (or has vertical scrolling, not sure anymore), so levels break in similar ways like you outlined if they have blockers.
One thing I noticed about your style file is that it's just a little above 128 KB, while all the officially ones are smaller. Bit of a stab in the dark, but if it's directly loaded into RAM, maybe some of it gets overwritten or overwrites something else?

One a different note, I'm not sure how far you are with the editor tools already, but there is this generic map editor called Tiled which has plugin capabilities (in javascript). I wrote a plugin for Kid Chameleon at some point, and so at some point I was contemplating adding L2 map editing functionality to it, which would probably just take a day or two. Then you get a really good user interface for free, and it also supports "tile stamps", which is exactly what L2 has encoded in its style files (and you can easily add additional custom ones), i.e. groups of tiles that you can just paste onto the map. Adding custom style support would probably be just a bit of extra work: if you have the tile/object images being processed by a tool into L2 format, you could probably produce some output that's convenient to process in Tiled. Let me know if you're interested and want to discuss more details.