A problem

Started by DrLemmingsham, April 16, 2007, 11:34:46 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

geoo

Quote from: Mindless on April 17, 2007, 04:13:19 AM
on this forum we've got all the talent we need to put together a Lemmings 2 level editor (and Lemmings 3 level editor for that matter)... we're just too lazy/busy :(
Just wondering, is the level/gfx format known? Assuming that there's a level converter Amiga->DOS out there I guess it is. In case it weren't, I'd give it a shot.
Is it known to anybody here?

DrLemmingsham

I think I've figured out hw to run the Amiga one! All I need is an Amiga Emulator that doesn't need Kickstart Roms. I'm too cheap to buy them. (Yeah, I admit it :spam: )

Mindless

Quote from: geoo89 on April 30, 2007, 02:11:42 PMJust wondering, is the level/gfx format known?
Yes, the graphics format is partially.

After decompression, the STYLE/*.dat files are IFF files:
4 bytes -> file identifier
big-endian double-word -> file size (excluding 8 bytes so far)
4 bytes -> file type

4 bytes -> section 1 type
big-endian double-word -> section 1 size (excluding 8 bytes so far)
<section 1 size> bytes -> section 1 data

...

4 bytes -> section n type
big-endian double-word -> section n size (excluding 8 bytes so far)
<section n size> bytes -> section n data


Each data section contains a different type of data.
The L2CL section is the palette (2 bytes of garbage followed by 128 3-byte RGB sets).
The L2BL section is the tile set (2 bytes of garbage followed by an arbitrary number of 128-byte, encoded tiles).
The other sections I have not analyzed.

I really cannot explain algorithms aside from using code :(
do
  p = 0
  for v = 0 to 3
    for y = 0 to 7
      for x = 0 to 3
        pset ((x * 4) + v, y), d[p]
        p += 1
      next
    next
  next
  d += 128
loop

(d is a byte pointer to the current tile, pset is a pixel setting function)

I might be wrong about the garbage bytes.

DragonsLover

On Lemmings Universe, there's a "Lemmings II Level Encoder/Decoder". However, the link of the file is dead. Where could I get it?
I like dragons! They're the center of my life! I'll never forget them...

geoo

As it is called lemzip, I guess that's the programme to compress/decompress the .dat files.
You can get it from Mindless' page: http://it.travisbsd.org/lemmings/tools.php
I guess it is better to use Mindless' lem2zip as according to the readme:
QuoteLEM2ZIP differs from LEMZIP (coded by Hermann Schinagl), because
LEM2ZIP is always successful when compressing.

Ah ok, that's nice (and I guess the best way to decribe an algorithm is code ;)). Then I'll take a look at the level format first.
(the save.dat format is really simple)

geoo

Despite my utter lack of programming skill, I managed to write a program to display the lemmings 2 graphics from the L2BL section of the respective styles as Mindless described. I saved the graphics in .png format: http://207.58.177.175/~geoo89/lemmings/l2gfx.zip
The colorful line on top is the palette, each sprite is 16*8px.

As for the level format, I figured it out apart from a few bytes: http://207.58.177.175/~geoo89/lemmings/l2level.txt
@Mindless: just in case you want to add this description to your site, feel free to edit it as it might require some clean-up in that case.

DrLemmingsham

O......kay..... How do I use them?

geoo

Well, as for the graphics, they are for your viewing pleasure...and if you want to edit levels manually (using a hex-editor), the order represents the terrain piece ID, i.e. the n-th piece has the ID n.

As for the level format documentation, it could help you if you want to edit levels manually or write an editor.

EDIT: Uhh, I'm Egyptian lemming now. :shocked: I quite like the tribe, but I prefered the green though, Outdoor is my favourite tribe.

DrLemmingsham

Quote from: geoo89 on May 12, 2007, 08:52:55 PM
Well, as for the graphics, they are for your viewing pleasure...and if you want to edit levels manually (using a hex-editor), the order represents the terrain piece ID, i.e. the n-th piece has the ID n.

As for the level format documentation, it could help you if you want to edit levels manually or write an editor.

EDIT: Uhh, I'm Egyptian lemming now. :shocked: I quite like the tribe, but I prefered the green though, Outdoor is my favourite tribe.
:huh: And what on earth is a hex editor?
EDIT: I've got one, but I have no clue how to get it into the editor. I have no programming/coding/hex editing skill at all. I don't even know any programmers! HELP!!!

DragonsLover

Wow!

An hex editor is an hexadecimal editor. It's a tool that can edit bytes of anything. You just need to open your hex program, open a file, and edit by yourself.

Ok, first, you'll surely see a lot of numbers everywhere. These are called bytes (quite evident, no?)

Now, look at "l2level.txt", you'll see the coordinates where are stocked the infos of the uncompressed levels. For example: from byte 0 to byte 3, there's "FORM". From byte 4 to byte 7, it's the file size. And so on... In your hex editor, you should see the coordinates of the bytes somewhere.

In hexadecimal, values are from 00 (0) to FF (255) and can even use multiple bytes like 00 00 (0) to FF FF (65535) or FF FF FF (16 777 215).
I like dragons! They're the center of my life! I'll never forget them...

DrLemmingsham

WHAT!?!? I jsut want to make levels! I don't understand all that stuff! ARRGGHHH!!!!  :spam: :spam: :spam:

ccexplore

Look, just give it a rest and wait until someone creates a level editor for Lemmings 2.  Or stick with Lemmings-1-style levels and create them with LemEdit or Lemmix or Cheapo.

DrLemmingsham

When can someone make one? :huh:

Mr. K

If you're that worried about it, learn the hex editing stuff. It's not that complicated after a while.

ccexplore

Yeah, but no one would want to edit levels with a hex editor (except maybe to change the skill distribution or the title or something minor); you can't see how your changes work out w/o having to bring up the game.

Anyway, looking at my old e-mails, Lemmix (one of the most recent level editors in existence) took about one and a half month from project start to the first public alpha.  But that's from someone's who's dedicated and enthusiastic.  Right now it doesn't look like anyone (who has the ability) is itching to write a level editor for Lemming 2, so if we double the time (which is still rather conservative), I'd say 3 months from now.