Extracting levels from console versions

Started by WNivek, May 03, 2007, 02:06:57 PM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

WNivek

I've been wondering, does anyone know of a way to extract level data from the various console versions of Lemmings, so as to generate PC-playable versions of the console-exclusive levels?

ccexplore

Unfortunately no one knows anything about this as far as I can tell.

For the SNES and Genesis versions, since the game mechanics appear to be extremely close to the computer versions, there's a chance that the levels may be stored in a similar format as well (either the compressed .DAT format, or less likely, the uncompressed .LVL format).  So you can try to take a level that exists in both the computer and console versions, and do a byte-sequence search of parts of the level data and see if you can locate it in the console version.  This can be the first step in trying to find the levels you actually want.

One thing to note about the Genesis version is that the graphics style appears to have additional terrain pieces that don't exist on the computer versions, so even if you manage to extract the level data, you still won't be able to port the level directly to the computer versions.

For other consoles, it can very well be the case that the levels are stored in a totally different format.  The more different the game mechanics and/or the hardware capabilities of the console, the more likely the format will be different.  The NES and Gameboy versions for example, the game mechanics isn't even pixel-based, due to the tile-based characteristics of those consoles' display handling.  The levels are as expected pretty much completely different from the computer versions, and there's simply no meaningful way to use the levels in the computer versions.

Another possible approach to porting the levels is to write a program to reverse-engineer the locations of terrain pieces based on screenshots of the level.  Screenshots of levels in various ports, particularly the SNES and Genesis ports, can be found on the Internet, and of course you can always download the ROM and an emulator, and make screenshots yourself.  You then write a program to basically find matches between pixels in the screenshot and pixels from a terrain piece.  Maybe when I have spare time, I'll look myself into writing such a program and see if I can successfully port the levels in question.

WNivek

Just thought I should mention that, based on a bunch of screenshots, I've adapted the five Sega levels ('Sega One' through 'Sega Five'. Catchy titles, huh?) from the Sega MasterSystem version to play under Lemmini as 'special' levels. (They use their own graphics set, and I figured it probably isn't worth it to try creating a whole style just for five levels)

Download

(Also included in that archive are the Sega Genesis special levels, the Budget Amiga special-replacement levels, and Going Their Separate Ways.)

By the way, any chance there's a Mod of the music for the Sunsoft Special level floating around somewhere? Or a way to create a mod from VGZ file?

ccexplore

Quote from: WNivek on May 07, 2007, 08:55:34 PMBy the way, any chance there's a Mod of the music for the Sunsoft Special level floating around somewhere? Or a way to create a mod from VGZ file?

Unlikely.  The Sega sound chips use FM synthesis, while MODs use waveform samples.  To convert from the former to the latter is far from trivial.  You can try searching the Internet for conversion tools but good luck.

If it's just for your personal use with Lemmini, one possible approach is to record the VGZ as a WAV audio file, and then see if you can find tools on the Internet that can "convert" WAV to MOD.  I said "convert" because what those tools would do is simply to chop up the WAV into many segments and make each segment its own sample.  So it's a MOD only in terms of format, and will end up larger than even the WAV file, but for personal use that could suffice.

0xdeadbeef

There are VGM to Midi converters though. For FM synthesis, maybe the Midi files are not that bad. For tools look e.g. here:
http://www.smspower.org/music/vgmtools.shtml

ccexplore

Quote from: WNivek on May 07, 2007, 08:55:34 PMBy the way, any chance there's a Mod of the music for the Sunsoft Special level floating around somewhere? Or a way to create a mod from VGZ file?

Ok, I must be posessed by the devil; I actually went ahead and try out a WAV -> MOD "conversion".  Sadly I failed to find a program out there to do it automatically, so much of this is done manually with aid from Modplug tracker.  Here's the result (slightly under 1 MB):

http://it.travisbsd.org/lemmings/lemmingswelt/index.php?cmd=get&file=/sunsoftspecial.mod

Yeah I know, it doesn't sound great.  Blame Lemmini (more precisely, the MicroMod library) for only supporting the true original MOD formats and not better ones like s3m/xm/it.  The original MOD formats limit the amount of sample data so I'm forced to chop up the WAV into pieces, downgrade the audio quality significantly to reduce the amount of data, and stitch the pieces back together in the MOD.  Ugh.

0xdeadbeef

Well, if there's a demand for it, I could update to the IBXM player which supports XM formats (Fast Tracker 2, ScreamTracker 3 and Protracker):
http://geocities.com/sunet2000/

If you just want to abuse the mod format to play a WAV, it would be more reasonable if I would support WAV in the first place. I just never considered it since I figured WAV music would take too much space.

BTW: Midi conversion is not an option?

ccexplore

Quote from: 0xdeadbeef on May 11, 2007, 05:33:25 PM
Well, if there's a demand for it, I could update to the IBXM player which supports XM formats (Fast Tracker 2, ScreamTracker 3 and Protracker):
http://geocities.com/sunet2000/
I wouldn't say a huge demand for it, but since it's almost no work on your part, go for it.

QuoteIf you just want to abuse the mod format to play a WAV, it would be more reasonable if I would support WAV in the first place. I just never considered it since I figured WAV music would take too much space.
I agree on all points.  It probably makes more sense anyway to support formats like MP3 and OGG instead of WAV.

QuoteBTW: Midi conversion is not an option?
Hmm, didn't know Lemmini supports MIDI.  But in any case, I can tell you the MIDI conversion is not that great and would need a lot of manual cleanup work.  I should know since I made an attempt with this music via conversion back when I'm making MIDIs for Ahribar.

0xdeadbeef

Quote from: ccexplore
I wouldn't say a huge demand for it, but since it's almost no work on your part, go for it.
Not much work but more than almost none. I'll have to check.

Quote
I agree on all points.  It probably makes more sense anyway to support formats like MP3 and OGG instead of WAV.
MP3 should be possible, though it would increase runtime and memory footprint considerably. Could be hard to find a stable library with a acceptable license though.

Quote
Hmm, didn't know Lemmini supports MIDI.  But in any case, I can tell you the MIDI conversion is not that great and would need a lot of manual cleanup work.  I should know since I made an attempt with this music via conversion back when I'm making MIDIs for Ahribar.
Was just an idea and yes, Lemmini does support Midi.

Just in theory, it would probably be possible to emulate the YM2612 in Java. Looking at some of the C code available, it doesn't look much more complex than a mod player. Then again, I didn't find a Java library yet.

ccexplore

Quote from: WNivek on May 03, 2007, 02:06:57 PMI've been wondering, does anyone know of a way to extract level data from the various console versions of Lemmings, so as to generate PC-playable versions of the console-exclusive levels?

All right, some good news.  Last week I worked on and managed to figure out much of how the levels are stored in the Sega Genesis/Megadrive version of Lemmings.  You know, the one that has many, many extra and different levels.

I'll write a program this week to try and extract them into LVL files.  There's still the issue that some (many?) of the levels will require additional terrain graphics.  I'll work on that next after the levels are successfully extracted.

WNivek

Quote from: ccexplore on May 21, 2007, 06:11:50 PMAll right, some good news.  Last week I worked on and managed to figure out much of how the levels are stored in the Sega Genesis/Megadrive version of Lemmings.
Awesome!  :thumbsup:

Of course, now I feel slightly foolish for having manually recreated the Genesis's Fun 14 & 15, but at least those two were easy enough.

Any chance the info you've uncovered will also be helpful for the SNES version, or should I be remaking those six levels myself? (Already done Tricky 21, 'Ohayo Lemming san!')

ccexplore

There's a moderately good chance that what I knew from the Genesis version may help with the SNES version, because they are both made by the same company I think.  That said, there are many technical differences between the two consoles so who knows.

Of the six unique levels in SNES, two of them appears 100% identical (besides the titles) to levels in the Genesis/Megadrive version:

  • Sunsoft Special 1 (SNES) -> Two Heads Are Better... (Genesis, Sunsoft #27)
  • Sunsoft Special 5 (SNES) -> Lemmings' Ark (Genesis, Mayhem #30)

Another three are very similar to levels in the Genesis version, except the Genesis version of the levels are shortened (to fit the reduced 512x160 playfield used in the Genesis version):

  • Sunsoft Special 2 (SNES) -> I am A.T. (Genesis, Sunsoft #29)
  • Sunsoft Special 3 (SNES) -> Private Room Available (Genesis, Present #29)
  • Sunsoft Special 4 (SNES) -> Final Impediment (Genesis, Present #30)

This leaves "Ohayo Lemmings San" as the one and only level that's truly unique to the SNES version.


WNivek

Quote from: ccexplore on May 21, 2007, 10:19:10 PM
Of the six unique levels in SNES, two of them appears 100% identical (besides the titles) to levels in the Genesis/Megadrive version:
<snip>
Another three are very similar to levels in the Genesis version, except the Genesis version of the levels are shortened (to fit the reduced 512x160 playfield used in the Genesis version)
Hmm, interesting. I hadn't noticed that... guess I wasn't looking closely enough.

As a side note, and I know I'm being pedantic here, but those '100% identical' levels aren't quite 100%...
SNES Sunsoft 1 shortens the platforms between the spinning-blade traps, changes the arrangement of some of the steel, shifts the entrance, exit and crusher trap by a few pixels, and adds terrain piece 55 on the left-most decorative hill.
SNES Sunsoft 5 shifts the whole level down by four pixels (except for the upper section of one-way arrows) and adds three blocks off the left side.
Minor differences, but I just thought I'd point them out.

Quote from: ccexplore on May 21, 2007, 10:19:10 PMThis leaves "Ohayo Lemmings San" as the one and only level that's truly unique to the SNES version.
Heh, good thing I've already remade that one, then. :)

ccexplore

Quote from: WNivek on May 21, 2007, 11:45:50 PMAs a side note, and I know I'm being pedantic here, but those '100% identical' levels aren't quite 100%...<snip>

Hmm, good eye.  I guess all six SNES levels could use some extracting from the ROM then, since none of the Genesis levels are actually identical.

Did you remake "Ohayo..." as a special graphics level or using individual terrain pieces?  Because unless a level is remade with individual terrain pieces, they won't be as easily usable outside of Lemmini (eg. CustLemm, Lemmix, other ports of Lemmings that uses the LVL file format, etc.)  So I think there's still a use for a ROM extraction of the levels that you have already remade manually.

WNivek

Quote from: ccexplore on May 21, 2007, 11:51:20 PMDid you remake "Ohayo..." as a special graphics level or using individual terrain pieces?
I was indeed using individual terrain pieces. That's why I didn't get through Genesis Fun 16 - I found the Dirt style to be quite difficult to figure out. Incidentally, that hardship led to me adapting SNES Tricky 21.

I have been working in Lemmini's ini format (needing to enter a LOT of data by hand, a text editor is convenient) but it should be possible to port them to lvl format.

Quote from: ccexplore on May 21, 2007, 11:51:20 PMI think there's still a use for a ROM extraction of the levels that you have already remade manually.
I agree completely. I'm a bit of a perfectionist, and said extraction would be much more 'perfect' than any hand-made recreation could hope to be. Even if the clone manages to be pixel-accurate, there's always hidden factors like drawing order and the 'no overwrite' flag. ('is this ball being drawn before that bar, or is coming afterwards and just not overwriting?')