(Submitted by Wudpecker)


The CDF files are the "basic" or "default" files used by the game. The files inside CDF's can be uncompressed, modified and used separately. The new files will replace the CDF files if they are placed in the main game folder.
If there is an error in the new files, the EAW.exe will automatically revert to the CDF files.
A failure of the game to load the "right" files you have modified can probably be traced to this EAW feature

CDFRW.exe by Paulo Morais opens the CDF (Compressed Data Files) and extracts the contents. A CDF builder can compress a series of files back into the CDF. Available at Sandbagger's.
A tool to make a new CDF is also available. Warning This makes new files permanent as the basic or default EAW files.
All these tools can be found in this utilities box:(4 parts to download)
http://www.sandbagger.uk.com/RAFDum/ReadmeUtilities.zip
http://www.sandbagger.uk.com/RAFDum/Utilities001.zip
http://www.sandbagger.uk.com/RAFDum/Utilities002.zip
http://www.sandbagger.uk.com/RAFDum/Utilities003.zip

Tools to open the CDF without using DOS are available from Mr. Jelly. View his explanation here:
http://www.simhq.com/simhq3/sims/boards/bbs/ultimatebb.php?ubb=get_topic;f=143;t=000419
posted September 06, 2005 10:21 AM.
quote:
I had never used Paolo's cdf builder, so I downloaded it and tried it.
Being a DOS proggy it is not exactly user friendly, so I made a utility that uses it:
Mr Jelly's CDF tool pic.jpg
Get it Here: http://www.raf-roy.com/share/mrjelly/Pakkit.zip

I made a back-up copy of "3d.cdf", then I extracted the files from it and put them in the program folder. Then I ran it.
First I entered *.3dz;*.tpc in the file extension box.
Then I entered New3d.cdf as the name of the file to be saved.
I clicked the buttons 1,2 and 3.
That was it! It made the "New3d.cdf" file which was exactly the same filesize as the original "3d.cdf", I copied it and renamed the copy as "3d.cdf" replaced the "3d.cdf" in the EAW folder and ran EAW.
It ran perfectly.

Full background is available at SimHQ EAW Forum:
http://www.simhq.com/simhq3/sims/boards/bbs/ultimatebb.php?ubb=get_topic;f=143;t=000419

Structure of the CDF is explained below by NCRAWLER.
quote:
I heard your call CB. Sorry for the 'brief' absence, but work has been pretty hectic. For anyone that cares, here is header info for some of the data files in EAW:
1. CDF Headers
A. Type: General Archive
Each header entry is 34 bytes, broken down as follows:
Offset 00h - Long(length of header entry from base 0h, will always be a multiple of 22h unless the entry is the end of a node in which case the value is always FFFF-FFFFh)
Offset 04h - Long(this value has to do with the way that CDF's are organized into nodes. this value is still being researched and needs to be understood before a 'real' manager can be created. if the entry is the end of a node it will always be FFFF-FFFFh)
Offset 08h - String(Null terminated filename. Entry is always in 8.3 filename format + null terminator (00h) for a total of 13 bytes)
Offset 15h - Long(offset to data in the archive)
Offset 19h - Long(length of data stored in the archive)
Offset 1Dh - Integer(16-bit time value of the original file stored in the archive)
Offset 1Fh - Integer(16-bit date value of the original file stored in the archive)
Offset 21h - Byte(header entry terminator. this value, for some reason, will be either 00h or FFh)
2. SND/WSD Headers
A. Type: Sound
Each header entry is 28 bytes, broken down as follows:
Offset 00h - Long(8-bit flag, will always be 02h for 8-bit files and 00h for 16-bit files)
Offset 04h - Long(this is the internal id number taken from the number in the filename (not used in WSD files))
Offset 08h - Long(length of raw sound data)
Offset 0Ch - Long(sample rate of the sound)
Offset 10h - Long(bit depth of the sound)
Offset 14h - Long(number of channels (1=Mono, 2=Stereo) of the sound)
Offset 18h - Long(padding, will always be 00h)
Offset 1Ch - Data(raw sound data begins here)
3. WSP Headers
A. Type: Sprite Archive
Each header entry varies according to the number of sprites contained in the archive:
Offset 00h - Long(archive size (total data + header))
Offset 04h - Integer(image width in pixels)
Offset 06h - Integer(image height in pixels)
Offset 08h - Long(number of images in the archive)
Offset 0Ch - Long(offset to data in the archive (one long entry for every sprite in the archive))
I think that we should all pool our resources and figure out some of the values in the .cdf header. The 'node' entries, as I call them, being the most important. With these values figured out, a proper win32 cdf archive manager can be written.
NC
Edit: Just a quick not on my use of 'Long' and 'Integer' values. I am using VB terminology, so if you are a C programmer, substitute accordingly. I believe, 'unsigned short int' for 'Integer' and 'unsigned int' for 'Long'.