Jump to content
Sign In to follow this  
hjanfield

DBPF format

12 posts in this topic Last Reply

Highlighted Posts

Posted:
Last Online:  
 

I've been reading up on the SC4 filetypes, but the information I can find on the DBPF format seems to have some holes. I'm wondering if any of these have been figured out or updated. The only good post I can find on Simtropolis is from 2003, and the only detailed web site is from 2004.

Is there any other information that may help me, like a list of known Type IDs?

Share this post


Link to post
Share on other sites
Posted:
Last Online:  
 

Hi,

here's a short describtion.

Header:

4 Bytes Identifier > must be "DBPF"

4 Bytes Version Major (1 in SC4/Ts2 Dats)

4 Bytes Version Minor (0 in sc4 dats, 1 in most TS2 packages)

12 Bytes not used

4 Bytes Date Created (in seconds from 1970-1-1)

4 Bytes Date Modified (in seconds from 1970-1-1)

4 Bytes Index Type Version > must be 7

4 Bytes IndexCount

4 Bytes FirstIndexPosition

4 Bytes SizeOfIndex

4 Bytes NumberOfHoleEntries

4 Bytes LocationOfHoleRecord

4 Bytes SizeOfHoleRecord

4 Bytes IndexVersion if 2 then Size Of Index = 24 else Size Of Index = 20

32 Bytes not used

Indexes:

4 Bytes Type

4 Bytes Group

4 Bytes Instance

If Header.SizeOfIndex = 24 4 Bytes RessourceID

4 Bytes Location

4 Bytes Size

Known Type ID's (extract from SC4Tool's "SC4Files.xml", feel free to use it:

Hope this helps.

Share this post


Link to post
Share on other sites
Posted:
Last Online:  
 

Oh , sorry the xml format is not supported for posts....

Here it is as text, but sc4Types.xml has more informations:

Exemplar TypeID=6534284A

LD TypeID=6BE74C60

PNG TypeID=856DDBAC

Dir TypeID=E86B1EEF

LText TypeID=2026960B

FSH TypeID=7AB50E44

UI/INI/AB/AE TypeID=00000000

XML TypeID=88777601

XML TypeID=88777602

JFIF TypeID=74807101

JFIF TypeID=74807102

JFIF TypeID=856DDBAC

BMP TypeID=66778001

BMP TypeID=66778002

S3D TypeID=5AD0E817

SC4Path TypeID=296678F7

ATC TypeID=29A5D1EC

AVP TypeID=09ADCD75

Effect Dir TypeID=EA5118B0

LUA TypeID=CA63E2A3

CURSOR TypeID=AA5C3144

KEYCFG TypeID=A2E3D533

RUL TypeID=0A5BCF4B

Cohort TypeID=05342861

Share this post


Link to post
Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    Thanks for the info and links. Would The R&D forum be the best place for me to post any future questions on the files? Also, are there any known oddities with dealing with the assorted SC4 files?

    Also, SimCity 4 checks *every* file in the Plugins directory for DBPF formats, not only the .SC4* and .dat extensions, correct?

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    Yep, this would be the place.

    As opposed to other places, this forum is technically for discussion of the formats and ways of dealing with them. (As well as large scale projects) 4.gif

    I will say I've had problems with it reading formats not .dat before, but I can't say it tries to read all of them. Not sure.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    Originally posted by: Andreas Roth To my knowledge, SC4 tries to read all files, and it will use the content if it encounters a DPBF file, no matter what file extension it has.quote>

    Just wanna confirm that. I once made a test, changing the extension of one single custom content landmark. Whichever extension I gave the file, it was still loaded at startup and available/functional in game. I even tested such extensions as .EXE and .DLL

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    Just wanted to confirm...

    The Sims2Wiki link, as well as a post here on the forums, say compressed files consist of a 9-byte header: DWord Compressed Size, Word Compression Type, and 3-byte Uncompressed Size? Is this correct? Is there anything special about the number, or do I just cast it to a typical UInt32?

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    The data I've found shows that DIR files have a Type of E86B1EEF, and that is all that is specified. But I've noticed that Directory files created by the Reader always seem to have a TGI of E86B1EEF:E86B1EEF:286B1F03. Is there a reason for this specific group and instance?

    Also, I would presume that only one DIR file should be found in each .dat.. even the SC4 .dat files have only one each. What should be done if multiple DIR files are found, or if the user tries to insert extra DIR files? Can the game handle multiple DIR files?

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    There is nothing special about the numbers, their byte order is little endian.

    Concerning the directory files: Im not quiet sure, but afaik only the file TGI:E86B1EEF-E86B1EEF-286B1F03 is interpreted as directory.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    Directories are hardcoded really. They're essentially the same idea as the index, except they're an index stored as an entry. Therefore since there can only be one index, there can only be one directory (index of compression)

    Can it handle more than one? No, because only that TGI is loaded as a dir, as specified by the DBPF specs. Anything else would be interpreted as a normal file.

    Share this post


    Link to post
    Share on other sites

    Sign In or register to comment...

    To comment in reply, you must be a community member

    Sign In  

    Already have an account? Sign in here.

    Sign In Now

    Create an Account  

    Sign up to join our friendly community. It's easy!  

    Register a New Account

    Sign In to follow this  

    • Recently Browsing   0 members

      No registered users viewing this page.

    ×

    Thank You for the Continued Support!

    Simtropolis depends on donations to fund site maintenance costs.
    Without your support, we just would not be in our 24th year online!  You really help make this a great community. *:thumb:

    But we still need your support to stay online. If you're able to, please consider a donation to help us stay up and running. This helps sustain a platform where we can share our community creations for years to come.

    Make a Donation, Get a Gift!

    Expand your city with the best from the Simtropolis Exchange.
    Make a Donation and get one or all three discs today!

    STEX Collections

    By way of a "Thank You" gift, we'd like to send you our STEX Collector's DVD. It's some of the best buildings, lots, maps and mods collected for you over the years. Check out the STEX Collections for more info.

    Each donation helps keep Simtropolis online, open and free!

    Thank you for reading and enjoy the site!

    More About STEX Collections