Extracting levels from console versions

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

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ccexplore

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.  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.

Ok, here's a teaser of 5 levels I've extracted using the program I'm still developing:

http://www.geocities.com/guestlevels/lemmings/genesis_teaser.zip

One absolutely amazing thing I discovered from this is, the Genesis graphics sets actually do not use any additional terrain pieces!  That's right, things like the rings in Present 14, and the greenery in Sunsoft 20, are actually made entirely of standard terrain pieces!

Anyway, there's still a bunch of work left, mainly in fixing various errors with the conversions (you should be able to spot some in the levels included in the teaser).  So while you can feel free to start using the levels in the teaser, if you wait a few days I might be able to save you some of the work of fixing mistakes in the conversion.

Oh, one more thing:  remember that Genesis Lemmings can handle up to 100 lemmings in a level, but PC Lemmings can only do 80.  So if you're going to actually play one of the extracted levels using CustLemm or DOS Lemmings, be sure to adjust the number of lemmings out and to be saved accordingly.  The level should play fine w/o modification on Lemmix or Lemmini or Amiga Lemmings or anything that doesn't have the 80-lemming limitation.

Fleech

Excellent, ccexplore! :thumbsup:

Having not played most of these levels I'm really looking forward to when you're finished with this.

Mr. K

Windows Lemmings can also support up to 117 lemmings, so it will work fine there.

DragonsLover

I did test with 100 Lemmings under Lemmings95, but it causes a crash. How do you do that? And anyway, Lemmings95 sucks because of some bad differences from the Dos version.
I like dragons! They're the center of my life! I'll never forget them...

Mr. K

It's always worked fine for me until 117...

WNivek

With the aid of a hex-editor (can't get Lemmini to give me > 100 lemmings) I've been able to confirm that Ji Hoon is indeed correct - WinLemm works fine with 116 lemmings. Ask for 117, though, and it crashes the instant it tries to spawn that last one in the level.
Interesting.

Odd, then, that WinLemm's levels would still retain the 80-lemming cap from the Dos version...

ccexplore

Ok, this is still not finished, but since some people are probably dying to play the levels even if they're not perfect yet, here they are, all 180 Genesis levels extracted:

http://www.geocities.com/guestlevels/lemmings/genlvls_raw.zip

Enjoy! ;)

[By the way, don't bother with Fun 22, Tricky 14, Taxing 15, Mayhem 22, and Sunsoft 18.  Those are the five special graphics levels in Genesis, and w/o the special graphics the LVLs alone are useless.]

----------------------------

(Below I explain in many words why it's not finished and what problems remain before it's fully finished.)

The big reason this is not finished is that, it turns out while the graphics sets used in Genesis Lemmings is almost identical to the PC/Amiga graphics sets, there are a few subtle differences here and there, and those differences need to be identified and adjusted for the level to be the same when played on the PC/Amiga versions.  For example, I discovered that in graphics set 0, the Genesis version switched the meaning of terrain id 42 and 43, so I had to fix that in my extraction program so that the correct terrain would be used when playing the level on PC/Amiga Lemmings.  As another example, there's some other not-yet-identified difference at play causing Present 27 ("Try Anything Once") to incorrectly have narrow gaps in certain places.  Etc.

To completely identify all these differences, I'd need to write another program that can insert specially crafted levels back into the Genesis ROM that displays all terrain pieces and objects in a well-arranged manner, so that I can fully identify all the differences manually.  This obviously will take some time, and since most levels are not affected by this issue, I figure I'd release the levels now in their slightly imperfect but mostly playable form.

Other differences that need to be taken care of:

- the Genesis version only has a 512x160 playfield while the PC/Amiga versions use 1600x160.  So when translating the Genesis levels into LVLs, I shifted the x by an amount such that the 512x160 Genesis playfield is centered horizontally within the 1600x1600 PC/Amiga playfield.  One effect of this is that graphics which are partially clipped on the Genesis version are not clipped when you play them on the PC/Amiga version.

While I can add eraser pieces to manually clip the unclipped portions, that might not always be the best thing to do aesthetically.  Thus ultimately these clipping differences will have to be manually reviewed on a case-by-case basis.

- similar to the clipping issues, sometimes a water object which would normally be at the edge of the Genesis playfield is now no longer at the edge on the PC/Amiga version, and so it'd look a little odd.  Again, the best aesthetical fix (generally, to add a terrain piece to cover the exposed left/right edge of the water object) is not something that can easily be determined by program, and therefore must be done manually.

- Genesis Lemming's viewport size is only 240x160, smaller than the 320x160 in PC/Amiga.  (By viewport size, I mean the size of the portion of playfield shown on the screen at any instant.)  Thus using the same starting-X position means that the initial starting screen will expose more stuff on the right side of the screen on PC/Amiga compared with Genesis Lemmings.  Depending on how the level looks and works, this may or may not be appropriate.  So again, each level's starting-X screen position will need to be manually re-adjusted on a case-by-case basis.

- Genesis Lemmings may have slightly different calculation for the positioning of an interactive object's trigger area.    Thus once in a while, in the levels I uploaded, you may find a trap or exit or some object that should be functional but isn't, even though the object's visual position is correct (meaning it matches its visual position in the level in Genesis Lemmings).  Please let me know if you discover such problems.  Because an object's (x,y) position must be aligned in certain ways, fixing the problem may in some cases require changing the terrain slightly, so again some instances of this problem will require manual effort to fix.

As you can see, to get the levels to perfection will take some work, and frankly I'm not sure I want to commit to doing all that.  I will certainly make sure all extracted levels have accurate terrain positioning and to fix serious gameplay issues like nonfunctioning traps and exits, but beyond that, the more aesthetic fixes I'll probably leave it to other people here to do.

Fleech

Huge thanks for all of this.

I've just started going through them now to test the traps/exits etc. (nice excuse not to do any real work :tongue:) and will post the results when I'm done. Regarding having to edit the appearance of some of the levels, I'd be happy to help out where I can.

EDIT: thought I'd update this as I going along. All objects listed do NOT work at present.

Fun21: Both laser traps
Fun26: Rope trap
Fun28: Both flame pits

All Tricky objects seem to be fine.

Taxing03: Both laser traps

Mayhem05: Both flame pits
Mayhem13: Rope trap

Present17: Both laser traps
Present24: Both laser traps
Present25: Spike trap
Present29: Laser trap

Sunsoft09: Laser trap

Think that's the lot. :)

Mr. K

Would it be possible to extract (or screenshot and convert) the special graphics for the Sunsoft 18?

Fleech

There's an option in Lemmix that allows you to create Extended Graphic levels. I've not used it before, but I guess if you were to screenshot the level and import it it should work? May need to alter the colour count though.


Fleech

I've now finished going through the levels so hopefully the list above is complete. I'll have a crack at the special levels later perhaps, need to be getting on with something more constructive now. :tongue:

WNivek

If anyone wants those PNGs of the Genesis special levels, with the entrances and exits carefully removed, here they are.

Also, Lemmini users can find playable versions in an earlier post of mine in this thread.

ccexplore

Quote from: ccexplore on May 23, 2007, 09:58:08 AMThe big reason this is not finished is that, it turns out while the graphics sets used in Genesis Lemmings is almost identical to the PC/Amiga graphics sets, there are a few subtle differences here and there, and those differences need to be identified and adjusted for the level to be the same when played on the PC/Amiga versions.<snip>To completely identify all these differences, I'd need to write another program that can insert specially crafted levels back into the Genesis ROM that displays all terrain pieces and objects in a well-arranged manner, so that I can fully identify all the differences manually.

Progress update:  I've written the program mentioned above, and with its help, I think I have now identified all the terrain differences between the DOS and Genesis graphics sets:

1) set #0:  terrain piece id #42 and #43 are switched
2) set #2:  terrain piece id #40:  Genesis version has one extra terrain pixel at (1, 1)
3) set #3:  terrain piece id #32:  Genesis version's graphics is wider by 2 columns of pixels

Difference 1 and 3 causes the majority of terrain problems but are very easy to fix automatically by my extraction program.  Difference 2 is harder to fix but probably makes little difference in actual levels.

Since the differences above are spotted by eye, I probably should at some point also make a program to do a full pixel-by-pixel comparison to make sure I didn't miss anything.  I also need to modify my program so it can create suitable levels for me to compare the object graphics.

[edit:  I browse through all Genesis levels using graphics set #2 and it looks like difference 2 is truly a non-issue.  Because in all levels that use the affected terrain piece, the ends of the terrain piece are never exposed.  There's still the slight possibility that some levels use that terrain piece as an eraser, in which case any differences would easily be missed in a visual inspection.  I'll re-check that possibility later]

ccexplore

Quote from: WNivek on May 23, 2007, 08:43:43 PM
If anyone wants those PNGs of the Genesis special levels, with the entrances and exits carefully removed, here they are.

You missed a pixel in the graphics for the Sunsoft special.  The orange pixel at (451,135) is part of the exit graphic and not terrain, and therefore should be removed.  You can verify that by comparing to a normal level using the Dirt exit, such as Sunsoft 17:

http://www.neolemmix.com/levelimg/extra/0317.png