wdf files - Structure & analysis

This forum is for outdated or irrelevant Modding Information that may or may not be 3 months old.

Moderator: thunderchero

Post Reply
User avatar
Tethys
Past Administrator
Past Administrator
Posts: 2075
Joined: Fri Jul 18, 2008 2:00 am
Location: Your mom's bed ;)
Contact:

wdf files - Structure & analysis

Post by Tethys »

I know this has been covered several times, but it's always been vague to me what everything means when reading. Here I will try to explain to you the way I have found wdf files to work.

Here are some things you should know before diving in -

Labels:

Each function is represented by a label, in the form of simply one byte which starts your function and designates what it will do in the wdf file. First, the ones that are well known:

Code: Select all

0C	Represents a menu (ship list etc)
0D	Represents an Image file (background image or non-interactive image (see below))
0E	Represents text
And these, which I have experimented around with and have found to control certain functions:

Code: Select all

02	Represents clickable buttons (links to other wdf files, or moves text up/down)
07	Represents allocatable sliders (orbital batteries, population allocation, intel)
08	Represents vertical? dragable sliders AND its buttons (ship list, building list, etc)
09	Represents ?transparency? (changing image such as ship image or race pic?)
This is all I have found yet, others are still being analyzed.

More to come.
Last edited by Tethys on Wed Jul 14, 2010 12:03 am, edited 2 times in total.
Not for the weak of heart...
Image
GALM <--- GALM/Galaxies Mod
User avatar
Tethys
Past Administrator
Past Administrator
Posts: 2075
Joined: Fri Jul 18, 2008 2:00 am
Location: Your mom's bed ;)
Contact:

Post by Tethys »

First, load your wdf file and set it to read 25 bytes; now I know this isnt the 'perfect' setting, but it is by far the easiest to navigate (unless you have a ginormous screen, then go ahead and set it to 101, 82 or 41, it depends which part of which wdf file you are editing). I will be using the k_sysmap.wdf file for this instructional, as it is small and contains both graphics and text. This wdf file controls all the text and graphics for the solar system view at the bottom of the main screen and system screen.

And now we begin.

The first 8 bytes should read 02 00 00 00 01 00 00 00 - this is the same for every wdf file i opened up so far. Unknown what function these serve, so we will leave them be.

(This next paragraph is speculatory)
The next 4 bytes I believe to be used for 'extra space' in wdf file, such as if the file is scrollable, like in *solcur.wdf, *summary.wdf, and *techosh.wdf (there are more Im sure, but dont know which ones atm). I am confident these must be changed if you are allowing a scroll bar to be usable in your screen (such as energy screen project). The 8 following bytes might have a similar function, however this has eluded me.

Ok, jump ahead to offset 0x14, here you will see the width that the wdf file covers (it may also be the width of the specified tga file, this has not yet been determined by me as it was not necessary for my experiment)

Now, 0x18 is the height the wdf file covers (or it is the height of the specified tga, again, not necessary for the experiment)

At 0x29 seems to me to be either the total number of instances of groups of items the file contains, or the number of times 02, 07, 08, 0D and 0E are found within the file. This might be important to change if adding another button set, such as a slider and buttons, to the file (energy screem project, could also have a trek.exe reference).
Not for the weak of heart...
Image
GALM <--- GALM/Galaxies Mod
User avatar
Tethys
Past Administrator
Past Administrator
Posts: 2075
Joined: Fri Jul 18, 2008 2:00 am
Location: Your mom's bed ;)
Contact:

Re: wdf files - Structure & analysis

Post by Tethys »

r_sysmap.wdf - 25 bytes per row

Offset 0x069-0x091
First entry for image beginning with hex 0D

Offset 0X071
This moves solar system animations right or left depending on value used. 228 pixels is the default value or E4 00 in hex. Higher number moves to the right. (see below)

Offset 0x079
This ALSO moves solar system animations right or left depending on what value is used. 528 pixels is default value or 10 02 in hex. Higher number moves to the right. (I believe this value increases the 'window size' that the planet/star animations occupy)

Offset 0x092-0x0F6
First entry for text beginning with 0E

Offset 0x09A
This moves SYSTEM (System Name) text left or right depending on value used. 228 pixels is default value or E4 00 in hex. Higher number moves to the right.

Offset 0x09E
This moves SYSTEM (System Name) up and down depending on value used. 7 pixels is the default value or 07 00 in hex. Lower number moves text up.

Offset 0x0F7-0x15B
Second entry for text beginning with 0E

Offset 0x0FF
This moves Resident Race text left or right depending on value. 569 pixels is default value or 39 02 in hex. Higher number moves text to the right.

Offset 0x103
This moves Resident Race text up and down depending on value used. 7 pixels is the default value or 07 00 in hex. Lower number moves text up.

Offset 0x15C-0x1C0
Third entry for text beginning with 0E

Offset 0x164
This moves first part of system information (see screenshot below) left or right depending on value used. 52 pixels is default value or 34 00 in hex. LOWER number moves to the LEFT.



^text here (^not here) _____________________________________________ Animation moved all the way over here (edge of screen) ^

Offset 0x168
This moves first part of system information (seen above) up and down depending on value used. 52 pixels is the default value or 34 00 in hex. Higher number moves text DOWN and OFF the screen (when value of 100 pixels or 64 00 in hex is used)

Offset 0x1C1-0x225 (end)
Fourth entry for text beginning with 0E

Offset 0x1C9
This moves the second part of system information left and right depending on value used. 132 pixels is the default value or 84 00 in hex. Lower numbers move the text to the left.

Offset 0x1CD
This moves the second part of system information up and down depending on value used. 52 pixels is the default value or 34 00 in hex. Higher numbers move the text down and off the screen.

Next:

Finish hex locations and default values, then get to modding ;-)
Not for the weak of heart...
Image
GALM <--- GALM/Galaxies Mod
User avatar
Tethys
Past Administrator
Past Administrator
Posts: 2075
Joined: Fri Jul 18, 2008 2:00 am
Location: Your mom's bed ;)
Contact:

Re: wdf files - Structure & analysis

Post by Tethys »

My theory is that we are dealing with text/image boxes similar to when you open up Paint and make a new text box, then drag the side to make it larger. I could be wrong, I usually am ;)
Not for the weak of heart...
Image
GALM <--- GALM/Galaxies Mod
Post Reply

Return to “Modding Information Archive”