Author Topic: Tools for converting levels to bitmap?  (Read 9575 times)

0 Members and 1 Guest are viewing this topic.

Offline Ron_Stard

  • Posts: 312
    • View Profile
Tools for converting levels to bitmap?
« on: April 25, 2017, 08:21:09 PM »
Are there any program susceptible to use for batch-converting Lemmings and Lemmings 2 levels to PNG or bitmap format?

Offline Nepster

  • Posts: 1829
    • View Profile
Re: Tools for converting levels to bitmap?
« Reply #1 on: April 25, 2017, 08:26:36 PM »
For lemmings levels, you can load them into NeoLemmix. NeoLemmix has a hotkey (default is "I") that saves the current frame (including any lemmings, ...) as a png. If you have them as a NeoLemmix level pack, then you can even press "F5" on the main screen and mass dump images of (the initial state of) all levels in the pack.

Offline Ron_Stard

  • Posts: 312
    • View Profile
Re: Tools for converting levels to bitmap?
« Reply #2 on: April 26, 2017, 10:26:16 AM »
Thank you for your help! But while pressing "I" works fine on both Lemmix and NeoLemmix players, the F5 hotkey doesn't seem to work on NeoLemmix (on Lemmix, it extracts all the levels individually to .LVL format, which is not what I wanted, but is also pretty useful for me).

Offline Simon

  • Administrator
  • Posts: 3860
    • View Profile
    • Lix
Re: Tools for converting levels to bitmap?
« Reply #3 on: April 26, 2017, 11:12:25 AM »
I don't know level-to-image dumpers for L2. There is L2 format documentation on Mindless's Lemmings Archive.

If you write your own image dumper from these hacking notes, feel free to ask questions. geoo has written code for PCL2ED to load tilesets and levels, and code for C++ Lix to load tilesets only. But writing your own might be too much work for what you had in mind with the images. :-)

-- Simon
« Last Edit: April 26, 2017, 11:23:43 AM by Simon »

Offline Ron_Stard

  • Posts: 312
    • View Profile
Re: Tools for converting levels to bitmap?
« Reply #4 on: April 26, 2017, 11:52:00 AM »
Thank you for the info! I am planning to do a simple drag and drop level2image converter in AutoHotkey. I thought I could rely on any console program some of the conversion work. But I have no problem with writing everything almost from scratch. I will have a look to those codes :thumbsup:

Offline Nepster

  • Posts: 1829
    • View Profile
Re: Tools for converting levels to bitmap?
« Reply #5 on: April 26, 2017, 04:30:31 PM »
[...] the F5 hotkey doesn't seem to work on NeoLemmix (on Lemmix, it extracts all the levels individually to .LVL format, which is not what I wanted, but is also pretty useful for me).
When creating a level pack, one has the option to disable both dumping the level files and the level images. But I am not aware of any pack that uses this option, so I forgot to mention it in my first post. Sorry.

Offline Ron_Stard

  • Posts: 312
    • View Profile
Re: Tools for converting levels to bitmap?
« Reply #6 on: April 26, 2017, 05:05:23 PM »
When creating a level pack, one has the option to disable both dumping the level files and the level images. But I am not aware of any pack that uses this option, so I forgot to mention it in my first post. Sorry.

So, there is no way to extract the .LVLs from a .NXP file?

Offline Nepster

  • Posts: 1829
    • View Profile
Re: Tools for converting levels to bitmap?
« Reply #7 on: April 26, 2017, 05:16:00 PM »
It depends: In most packs "F4" on the main menu does the job. But if the pack creator explicitely disabled that option when creating the level pack, then you are out of luck (though namida and I can get even around that).

Offline namida

  • Administrator
  • Posts: 12398
    • View Profile
    • NeoLemmix Website
Re: Tools for converting levels to bitmap?
« Reply #8 on: April 27, 2017, 10:31:18 AM »
With Lemmix players (at least if they're my updated versions, which add the mass dump features), you'll want to use F5 for level dump and F6 for image dump, IIRC.

I can probably put together some kind of command-line app that does this for you if you like. Do be aware it'll be based on NeoLemmix code, so (a) special graphics levels won't be supported, as NeoLemmix doesn't support that anymore (instead, NL "special graphics" levels are created by using a custom tileset with a very large terrain piece, and handling objects by taking advantage of NL's ability to mix multiple tilesets in one level), and (b) there may be some very minor differences, such as that NeoLemmix has differently-colored one way arrows for the Snow graphic set than DOS L1 / Lemmix do.
My Lemmings 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)

Offline Ron_Stard

  • Posts: 312
    • View Profile
Re: Tools for converting levels to bitmap?
« Reply #9 on: April 27, 2017, 10:54:48 AM »

I can probably put together some kind of command-line app that does this for you if you like. Do be aware it'll be based on NeoLemmix code, so (a) special graphics levels won't be supported, as NeoLemmix doesn't support that anymore (instead, NL "special graphics" levels are created by using a custom tileset with a very large terrain piece, and handling objects by taking advantage of NL's ability to mix multiple tilesets in one level), and (b) there may be some very minor differences, such as that NeoLemmix has differently-colored one way arrows for the Snow graphic set than DOS L1 / Lemmix do.

That would be enough, thank you for your help! I'll post the AutoHotkey GUI code for the converter I have planned in this thread, later at night.

Offline Ron_Stard

  • Posts: 312
    • View Profile
Re: Tools for converting levels to bitmap?
« Reply #10 on: April 27, 2017, 06:46:07 PM »
This is a screenshot of the GUI I am planning to do (almost finished):



The code is attached below. For testing it, just download AutoHotkey and drop the LvL2img.ahk file into it.

(Of course, notice that it's not finished yet, since there are still no calls to any console command able to convert LVL nor NXP to images).

Offline Simon

  • Administrator
  • Posts: 3860
    • View Profile
    • Lix
Re: Tools for converting levels to bitmap?
« Reply #11 on: April 28, 2017, 06:48:25 AM »
Hah, awesome. Are you planning to write all code in AHK? Or are you building the GUI with AHK and plan to call a command-line tool from the GUI?

It looks like you will outsource the hard work to a command-line program, I like this approach. Interesting that AHK is so easy to make GUIs with. I knew it had extensive scripting.

-- Simon

Offline Geoff

  • Posts: 33
    • View Profile
Re: Tools for converting levels to bitmap?
« Reply #12 on: April 29, 2017, 07:25:58 PM »
I don't know if this might be of use to anyone?




Offline Ron_Stard

  • Posts: 312
    • View Profile
Re: Tools for converting levels to bitmap?
« Reply #13 on: April 29, 2017, 07:57:49 PM »
I don't know if this might be of use to anyone?

That's great! Exactly what I wanted to program!
It seems it crashes with Holiday 93, and can't extract Lemmings 2 levels, despite including that game inside the .ZIP

Offline Geoff

  • Posts: 33
    • View Profile
Re: Tools for converting levels to bitmap?
« Reply #14 on: April 29, 2017, 08:34:58 PM »
I can't really help you with the crashes. its a unfinished program i found on the net a couple of years ago.