format of dungeon.dat/db11/expool used by csbwin

Discuss Chaos Strikes Back for Windows and Linux, an unofficial port of Chaos Strikes Back to PC by Paul Stevens, as well as CSBuild, an associated dungeon editor.

Moderator: Zyx

Forum rules
Please read the Forum rules and policies before posting.
Post Reply
User avatar
greatstone
The data extractor
Posts: 57
Joined: Fri Feb 18, 2005 2:16 am
Location: Grenoble, France
Contact:

format of dungeon.dat/db11/expool used by csbwin

Post by greatstone »

Hello,

I would like to know if anybody (Paul?) can take some time to explain me a specific part of the internal structure of the dungeon.dat file used by csbwin, as I am currently trying to extract all the information for my sck tool (http://greatstone.free.fr/dm/index.html).
I try to understand the structure of the items list 11 (unused in DM/CSB), coded as DB11 class in csbwin source code, and called also "expool".
I understand that it contains the global game information (special location, extended cell flags, skins, database of variables and statictics) but the DB11 data structure is not clear.

Here is where I am:

Code: Select all

1 dungeon.dat, containing:
  ...
  number of DB11 items (to have x)
  ...
  x DB11 items, containing:
    for each DB11
       1 uint16 to store the RN link (2 bytes)
       1 uint16 to store the common size of each part of this item (2 bytes)
       252 bytes of data, containing:
          1 uint32 to store ????
          y global data part (which can be different data for the same DB11), containing:
             for each global data part
                1 uint32 to store the global data key
                size-2 uint32 to store the values themselves
                1 uint32 to store ????
          some others uint32 (sometimes empty, sometimes not) to store ????
So, I have 3 ???? parts and a unknown y value.
Maybe I have missed something but I don't know what...
Any help will be greatly appreciated.

Regards,
GreatStone.
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

You will have to study the code a bit
to figure this out. I can tell you:

1) It is a hash table.
2) Each block (DB11 item) contains records of only one size
3) Each record has a unique 32-bit identifier.
4) There is an index block at the front pointing
to the first block containing each hash code.
5) There is provision for a second level index.
6) Each block has a link to the next block of
data with the same hash-code.

I don't remember much more. I don't remember
if the empty records are linked or how we find
an empty record when an insert is processed.
It is designed to be quick to reference.
User avatar
greatstone
The data extractor
Posts: 57
Joined: Fri Feb 18, 2005 2:16 am
Location: Grenoble, France
Contact:

Post by greatstone »

Thanks a lot, Paul, for your quick answer.

OK. So it seems that some missing data are hash code.
I have already deeply digged into the code, allowing me to decode nearly all the csbgraphics and dungeon.dat.
I will go on the study to fully understand the DB11.

Paul,
Is it possible for you to publish on your own site the last source code of csbwin and csbuild? It will help me to understand better the last extra data like monster names or cursor filter.

GreatStone.
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

Sure...I just posted:

CSBuild291Sorurce.zip
CSBwin10_056Source.zip

Edit:
Fixed the name to be:
CSBuild291Source.zip
Last edited by Paul Stevens on Thu May 15, 2008 4:30 pm, edited 2 times in total.
User avatar
greatstone
The data extractor
Posts: 57
Joined: Fri Feb 18, 2005 2:16 am
Location: Grenoble, France
Contact:

Post by greatstone »

Thanks!
I will have a look and go on the work.

G.
Post Reply

Return to “Chaos Strikes Back for Windows & Linux (CSBWin) / CSBuild”