How does the engine determine first object on a tile? (DM)

Use this forum to discuss dungeon editors and other tools, like DMute (by George Gilbert, also working for RTC dungeons), DM Builder (by Sphenx), and ADGE by `rain. Includes DM editing tips and tricks.
Forum rules
Please read the Forum rules and policies before posting.
Post Reply
LupusArgentum
Neophyte
Posts: 8
Joined: Mon Jul 25, 2005 12:18 pm

How does the engine determine first object on a tile? (DM)

Post by LupusArgentum »

I've been trying to learn the dungeon.dat format and I'm good so far, except I don't quite know how the engine determines the first object on a tile. the "Hall of Heroes" is 18x19, 342 bytes, but according to the map offsets in the header its data block is only 357, and it isn't compressed either. This REALLY has me stumped, excluding text pads and switches there are 7 items on the floor, but there are all the hero text pads and mirrors, plus a few alcoves and wall texts, a pressure pad, and two doors besides. Now, actually while writing this I guess I DID just remember something... when I decoded the object index I kinda noticed that checking down each column on Level 0, from left to right, the objects stored in the index coincided with doors, actuators, items, etc. The map data has a bit that tells the engine if there's a list of objects on a tile or not. Is it really as simple as the engine counting down the column you're on, using the "running count of columns with items" as an offset into the object index list? I mean, I really have NO experience whatsoever in this kind of thing, the only thing I've hacked to any extent are save and state files, so this is both boggling and REALLY impressive as I start to understand how it all works. Ok I'm done now. =P

-Argent

PS- Even so, that doesn't quite explain what's in those extra 15 bytes. Or is it the various TYPES of creatures, wall objects, pads, and ornates tacked on to the end of the file? So far I had thought it meant on each tile, which was confusing because all of those things are treated as objects and should be linked to from the index.
User avatar
ChristopheF
Encyclopedist
Posts: 1537
Joined: Sun Oct 24, 1999 2:36 pm
Location: France
Contact:

Post by ChristopheF »

I think your understanding is good to find the first object on each tile.

And yes, the 15 bytes at the end are the list of creatures and decorations on the level

Explained here: http://dmweb.free.fr/FFDungeon.htm
LupusArgentum
Neophyte
Posts: 8
Joined: Mon Jul 25, 2005 12:18 pm

Post by LupusArgentum »

I was actually referencing that page while writing the program to decode this stuff. (In QBasic, not C. :P) Obviously it was crucial, I would have been completely blind without it. Thank you though, it helps to know I'm not way off.

-Argent
Post Reply

Return to “Editors and Tools (DMute, DM Builder, ADGE, etc.)”