Author Topic: Looking for file format information  (Read 10942 times)

0 Members and 1 Guest are viewing this topic.

zennehoy

  • Guest
Looking for file format information
« on: February 03, 2008, 03:31:47 PM »
First off hello all fellow Lemmings fans!
I'm in the process of writing a version of Lemmings for the PocketPC, and am hoping to support the original DOS lemmings data files, as well as any custom level packs made with lemmix or lemedit. While the Lemmings file archive has information on the file formats of the .lvl and main.dat files, I haven't had any such luck for the groundXo/vgagrX files. Since there are community tools (e.g. Lemmix) that apparently use those files, I'm sure information on the file format must be available somewhere. Could anyone help me out by providing a file format description? Even very general information on what is stored in these files would help greatly!
Thanks!
Zen

Offline Mindless

  • Posts: 719
  • Inactive - may respond to PM.
    • View Profile
Re: Looking for file format information
« Reply #1 on: February 03, 2008, 06:27:09 PM »
I've got ccexplore's docs that he has allowed me give to others... I'll ask him if I can just put them up with the rest.

zennehoy

  • Guest
Re: Looking for file format information
« Reply #2 on: February 03, 2008, 10:10:41 PM »
That would be perfect, thanks!
Zen

Offline Mindless

  • Posts: 719
  • Inactive - may respond to PM.
    • View Profile
Re: Looking for file format information
« Reply #3 on: February 04, 2008, 06:09:05 AM »
as I expected, ccexplore has given me permission to publish the docs, so they're all there :)

zennehoy

  • Guest
Re: Looking for file format information
« Reply #4 on: February 04, 2008, 08:47:50 AM »
Awesome, thanks! Now all I need to figure out is how planar paletted bitmaps are stored.
I'll keep you posted on my progress,
cheers!
Zen

Offline EricLang

  • Posts: 464
    • View Profile
Re: Looking for file format information
« Reply #5 on: February 04, 2008, 11:30:07 PM »
If you need help with that planar bitmaps, just ask....

zennehoy

  • Guest
Re: Looking for file format information
« Reply #6 on: February 05, 2008, 07:57:25 AM »
Nope, I got it, thanks though. I'm just used to seeing planar bitmaps with the colors separated, not the individual bits of a palette index...
My Lemmings are now loading and animating from MAIN.DAT rather than a bitmap resource.
Yipee!
Zen

zennehoy

  • Guest
Re: Looking for file format information
« Reply #7 on: February 16, 2008, 05:19:12 PM »
Things are coming along nicely, thanks for all your help so far!
One thing that has been bugging me is that there doesn't seem to be any order to the levels in the LEVEL000.DAT to LEVEL009.DAT files, and since I assume that the level order is not hard coded, I must either be missing something or this data is stored in one of the remaining DAT files.
Does anyone know where to find this information? Maybe in one of the following files: ADLIB.DAT, ODDTABLE.DAT, RUSSELL.DAT, TANDYSND.DAT? The last one I assume has to do with sound, but I'm not sure what the others are for.
Any ideas?
Thanks!
Zen

zennehoy

  • Guest
Re: Looking for file format information
« Reply #8 on: February 16, 2008, 06:15:51 PM »
So I just noticed that lemmix also has lemmings clones for the three original DOS games... Are these actual clones in the sense that the source code is available in the community? I always thought lemmix was solely a level editor, so I started writing my PowerPC clone from scratch, but if there's a way to get at existing code... doesn't make sense to implement everything twice after all.
Too bad I notice these things only after I'm halfway done :o What's your stance on providing source code Eric?
Cheers,
Zen

Offline EricLang

  • Posts: 464
    • View Profile
Re: Looking for file format information
« Reply #9 on: February 16, 2008, 06:43:05 PM »
The sourcecode for the Lemmix editor is available at the lemmings archive.
The sourcecode for the game-clones is not. The clones are written from scratch, after I wrote the editor.
I could provide the complete sourcecode for the clones too. If you need that, post it here please, then I can gather all the files (and there are a lot!). Do not expect too much documentation etc. :)
But the source is free, as is the program. As long as no one is going to earn money with my code :)

Offline Mr. K

  • Posts: 793
  • Former admin, always Lemmings fan
    • View Profile
    • Wafflenet
Re: Looking for file format information
« Reply #10 on: February 16, 2008, 06:55:52 PM »
Things are coming along nicely, thanks for all your help so far!
One thing that has been bugging me is that there doesn't seem to be any order to the levels in the LEVEL000.DAT to LEVEL009.DAT files, and since I assume that the level order is not hard coded, I must either be missing something or this data is stored in one of the remaining DAT files.
Does anyone know where to find this information? Maybe in one of the following files: ADLIB.DAT, ODDTABLE.DAT, RUSSELL.DAT, TANDYSND.DAT? The last one I assume has to do with sound, but I'm not sure what the others are for.
Any ideas?
Thanks!
Zen
I believe the level order is in the Lemmings EXE.  ccexplore released a modified one a loooong time ago that made it read them from LEVEL000 to LEVEL009 in order.

Also, as it seems related, ODDTABLE.DAT contains the information for the "clone" levels (aka, the ones that have the same levels but different skill sets).  The clones aren't in the LEVELxxx.DAT files but instead use ODDTABLE to figure out which levels to load and then it replaces the level name and skills with the new set for the clone level.

(At least I'm pretty sure that's how it works. I'm not one of the Lemmhackers, I just spectate)

And, as you asked about the other files: ADLIB.DAT and TANDYSND.DAT are both audio-related, the former containing the normal Adlib music, and I believe the other's exclusively for Tandy computers.  RUSSELL.DAT has to do with the lame "copy protection" they used with Lemmings.

EDIT: Forgot to mention, I'm quite interested in this Pocket PC port!  I might be obtaining a slightly old one from my friend so I can stay organized, but I'll always need games alongside :P  PPCs are perfect for Lemmings.

zennehoy

  • Guest
Re: Looking for file format information
« Reply #11 on: February 16, 2008, 07:11:44 PM »
If you could post the source for the lemmix game-clones that would be awesome! I've been writing my clone with DirectDraw mobile and vanilla C/C++, and haven't used Delphi before, but all programming languages are at least somewhat similar. The question now is whether I continue with my clone, or just try to compile your lemmix clones for windows mobile - after all, my original goal was simply to find a true-to-the-original version of lemmings for my PDA...
Thanks also Mr. K for the file info. Guess I'll have to hard-code it then. I wonder why they chose that strange order...
TC,
Zen

p.s. As to the source of the lemmix editor, are you sure that's already in the archive?

zennehoy

  • Guest
Re: Looking for file format information
« Reply #12 on: February 16, 2008, 07:33:41 PM »
I hope it's not too old! DirectDraw mobile requires a Windows Mobile 5 device or above... Otherwise a touchscreen with 320x240 (QVGA) resolution and you're good to go.

Offline EricLang

  • Posts: 464
    • View Profile
Re: Looking for file format information
« Reply #13 on: February 16, 2008, 07:57:59 PM »
Ok I will gather the files this week and upload them somewhere. The graphics are just plain Windows GDI calls. I hope it will be useful. But have some patience. It is a bit of work...

zennehoy

  • Guest
Re: Looking for file format information
« Reply #14 on: February 16, 2008, 08:07:05 PM »
No problem, guess I'll actually have to do something other than coding lemmings all weekend then :P
Thanks!
Zen

Offline EricLang

  • Posts: 464
    • View Profile
Re: Looking for file format information
« Reply #15 on: February 17, 2008, 09:38:31 AM »
Ok. It's about a few days work. And I will make some notes about the structure. I'll post a message here when it's uploaded (probably the lemmingarchive of mindless)

zennehoy

  • Guest
Re: Looking for file format information
« Reply #16 on: February 22, 2008, 08:15:24 AM »
Left to do: Miner, Basher, Exploder, GUI... and trigger offsets. That last one is driving me nuts, my Lemmings keep walking just under or just over certain triggers, depending on the y coordinate of the trigger object, the type of trigger object, the Lemming's current action, etc. Most susceptible are the pillar squishing traps in the squasher graphics set, but I can't seem to get the y position of my blockers to be 100% accurate either.

Does anyone know what coordinate offset the lemmings use to index the "trigger field" (i.e. the 4x4 pixel resolution field used to store trigger information?) How about the offsets written by blockers? Finally, is the "top=trigger_top * 4 - 4" equation in ccexplore's GROUND file format description accurate?

Actually, I know that at least one person here knows ;)
Thanks!
Zen

Offline EricLang

  • Posts: 464
    • View Profile
Re: Looking for file format information
« Reply #17 on: February 29, 2008, 08:53:15 AM »
Give me one more week. I almost got all info.

zennehoy

  • Guest
Re: Looking for file format information
« Reply #18 on: February 29, 2008, 02:00:08 PM »
Np, I'll just keep hacking away at it. Of course that means I may not even look at your code in the end... ;)
As for a status update: the main menu GUI (including DHTML Lemmings-like level selection) is almost complete, miners, bashers and exploders are still missing though.

Btw I figured out the trigger field offset: ccexplore's format description (top=trigger_top*4-4) is correct, but lemmings actually check the trigger point one pixel below their current position, i.e. (x,y+1).
Blockers insert two columns of three pixels each, (x-1,y-1), (x-1,y), (x-1,y+1) and (x+1,...), the first indicating for lemmings to turn left, the other to turn right. Just as a note for anyone else who's interested. (At least that's how I think it works, please correct me if I'm wrong.)

On a different note, how many people here actually have a PDA with WM5.0 or above that could help me beta test? Should I try to compile a regular windows executable as well?
Cheers,
Zen

Offline EricLang

  • Posts: 464
    • View Profile
Re: Looking for file format information
« Reply #19 on: March 05, 2008, 11:19:42 AM »
Do not despair...
I have all files now (i hope) to make a complete recompilation. Now I need a few days to write a readme.txt. So I guess I will upload all source code of the lemming-clones in the weekend.

zennehoy

  • Guest
Re: Looking for file format information
« Reply #20 on: March 05, 2008, 04:18:50 PM »
Awesome, thank you for all your work!
Zen


zennehoy

  • Guest
Re: Looking for file format information
« Reply #22 on: March 14, 2008, 08:38:45 PM »
Great, thank you! Finally no more staring at pixels to figure out if lemmings can drop by 65 or 66 without splatting! I hope so at least, I'll have to see if I can understand your code first :)

On a completely different note: are the "We all fall down" levels truly trivial? Or is it a bug that affects only the DOS version?
Thanks again!
Zen

zennehoy

  • Guest
Re: Looking for file format information
« Reply #23 on: March 14, 2008, 09:04:25 PM »
*weeps at the sight of the "Mechanics" subdirectory*
So sorry to make you go through all the trouble of posting your code when it turns out that that one directory is all that I'll likely be using. Oh how I wish I'd known about this beforehand! Still, open-sourcing something is imho always a good step to take, and I'm sure your code will be useful as well.
Now to see how close my own approximations of lemming movement rules are...
Zen

Offline EricLang

  • Posts: 464
    • View Profile
Re: Looking for file format information
« Reply #24 on: March 15, 2008, 10:28:40 AM »
No problem. I was planning to make it open source anyway, so this was a good opportunity.
Have fun with it.

zennehoy

  • Guest
Re: Looking for file format information
« Reply #25 on: March 19, 2008, 08:35:50 PM »
Does anyone have a list of what levels correspond to what DAT file and index within that DAT file? How about the indexes of ODDTABLE.DAT? I'm just adding the ODDTABLE levels to Pocket Lemmings, and it's a lot of busy work...
Thanks!
Zen

Offline EricLang

  • Posts: 464
    • View Profile
Re: Looking for file format information
« Reply #26 on: March 20, 2008, 10:14:33 AM »
There is some info in my LemDosStyle.pas. And also a thread on this or an older forum.
Unfortunately no time coming days to help you further.