 |
Airfix DogFighter Programmer's Manual |
|
|
|
|
As mentioned in the Introduction, unraveling the game has been greatly helped
by the development of UPX, a program written in C++ by Jaystonian and others.
When run, it will extract most "ghost"-folders, and preserve their location in the folder tree.
Though it is a C++ -program, the best way to execute it is in the old MS-DOS prompt, these days called the Command Prompt, or
CMD.EXE.
NOTE: Before we begin, I need to explain one thing: In the old days, before Windows became such a dominant force,
the world of PC's was ruled by an Operating System called MS-DOS. Files and programs were stored in Directories and Subdirectories.
The first versions of Windows, right up to Windows 3.11, were just another "program" that could be invoked from MS-DOS.
When Windows 95 came along however, all changed: Win95 was still started from MS-DOS, but automatically, and took over control from the moment you started the PC.
In Windows, files and programs are stored in Folders and Sub-folders, but that is just a name: they essentially ARE the old
MS-DOS directories. So, don't be confused, the words Folder and Directory are used interchangeably, and refer to the same things!
|
|
Chapter 1: Using UPX
So how do we use the UPX program? The best way is to move or copy it in the same directory (folder)
as the resource.up-file is located.
By default, this would be: C:\Program Files\Paradox Entertainment\Airfix Dogfighter\
For those who have never worked in MS-DOS, here's some guidance:
1: Download the UPX-program from the forum downloadsite and copy it to the folder mentioned above.
2: Open the Command Prompt. In most Windows versions, this can be found in "Accessories."
If you can't find it there, select "run" from the Start-menu, and type: "C:\WINDOWS\system32\cmd.exe" and press "Enter"
A black screen should open up:
Before we can use UPX, we need to set the Command Prompt to the right directory (folder).
To do so, type: CD C:\program Files\Paradox Entertainment\Airfix Dogfighter
CD stands for Change Directory in old MS-DOS speak, and it will transfer Focus to the correct Windows Folder:

3: type in upx, and press "Enter". The result should look like this:

This tells you what the syntax (the command) for using the program is: if you type in:
upx resource.up then everything, the whole foldertree with all its files,
will be extracted to the Airfix Dogfighter root-directory/folder.
If you want to be careful and not rush into things, you might want to specify a foldername where you want the
directories to be extracted to. You can always move them later.So, let's specify an outpath as well:

If you press Enter at this stage, UPX will start extracting Resource.up
into a new (sub)directory called ResourceExtracts,
creating the subdirectories and writing the files. Depending on your system, this can take quite some time, and if you follow it on-screen, you will see that quite a lot is happening:

When done, you can close the Command Screen and have a look in Windows Explorer.
|
|
|
Chapter 2: Overview of the extracted Foldertree from Resource.up |
back to topxxxxx |
The picture on the right shows the foldertree after UPX has done its work on Resource.up:
If we compare this tree to the one that was created during the original Installation, then we notice that they differ:
After the original Installation, the Root folder ("Airfix Dogfighter")
had 3 subfolders: Game, User and Video.
After extracting Resource.up
with UPX, the Root-folder "ResourceExtracts" has 4 subfolders:
Game, Graphics, Sound and User.
As a reminder, here's the foldertree after the original installation:
2.1: Contents of the ResourceExtract sub-folders.
2.1.1: The Game-folder
Let's have a closer look at the Game-folder. After the initial installation,
it didn't contain any files itself, but had two subfolders: Modes and Types.
Modes contained the two game-mode interfaces, while Types contained about 7 files
describing different classes of special objects in the game.
Extracting Resource.up results in the Game-folder having 4 subfolders:
Layout, Missions, Objects and Worlds.
|

Fig 2: Resource.up Foldertree |
|
|
The Layout-folder is not very interesting: it contains data in the form of text-files about dialogboxes
that are displayed when starting, or choosing options in, the game.
The next folder however, the Missions-folder, is without doubt one of the
most crucial folders in modifying the game!
After extracting Resource.up, it does not only contain two subfolders
(Briefing and Levels), but also 41 files...
These follow the general naming convention of
SideMissionN.afs
and SideMissionN_setup.afs,
where Side is either Axis or Allies, and N denotes the Number of the Mission for that team.
Both are .afs-files, and one actually is destined to form part of the other, but that will be
explained in further detail on the Game Structure-page.
Anyone with a calculating mind will notice that 2 (teams) x 2 (.afs & Setup.afs) x10 (Missions) = 40, so what's number 41?
This last one is called "MultiPlayer.afs", a very short file, and is needed for Multiplayer mode.
The first subfolder in the Missions-folder is the Briefing-folder.
In this folder you would expect all the Briefing-files (.brf) to be placed.
But when you look in it, there are only two: Axis11.brf and Allied11.brf. So where are the other ones?
As explained above, all files containing language-specific text are extracted from {LANGUAGE}.up.
As will be explained below, an extra briefing file is needed after a player has completed a whole Campaign, hence nrs. 11.
As there are no Missions 11, these files don't contain any Language-text, so they are contained in Resource.up
while the other ones (nrs. 1 to 10 for each team) are contained in {LANGUAGE}.up.
See chapter 5 on this page for an explanation of the Briefing-mechanism.
Let's turn to the Levels-subfolder next.
As we shall see later (see the "Game structure" Page) for every Mission (and every Dogfight-map)
there will be a .Level-file present. This is the file where the rooms, the furniture
and the inert objects in that Mission or Dogfight-map are described in.
UPX extracts these to the .Level-folder in the general format
sideN.level, where side is either Axis or Allies,
and N is the number of the Mission. The structure and function of the .Level
-files will be explained in more details in the File Types Section.
The next Folder is the Objects Folder. Everything you can place in the Airfix Villa
(and outside) is considered an Object. This can be a chair, a painting, a vase, a tank, an aircraft, etc.
Basically consider everything you can place on a map in the House Editor an object.
Not all objects have the same properties: you can break a vase but not a chair, and neither of them can move whereas a Tank can.
That's why they are ordered into 4 categories, each in a subfolder of its own:
Static, Dynamic, Units and Aircrafts.
The structure and function of the .Object
-files will be explained in more details in the File Types Section.
The last subfolder in the Game-folder is the .Worlds-folder.
This contains 20 .world-files, one for each Mission,
and a Subfolder for the 9 Dogfight maps that come with the original game.
There is not much difference between the various files,
apart from the BCKD-block for the background-graphics all .world-files are identical...
ÿ p>
|
|
2.1.2: The Graphics-folder
The Graphics-folder contains a lot of subfolders:
A few footnotes about this:
In all these folders you will find either .gti (picture) or .ccf
(configuration)-files. The Fonts subfolder also contains a few .fnt (font)-files.
The folders Furniture, Models and Textures contain so many subfolders that it wasn't very
practical to unfold them here. By all means have a look at them yourself (if you have used the UPX-utility)
and you will find that in the Furniture-folder you will only find a .ccf-file
in each subfolder, for the Models each subfolder will also contain the Texture-files for
that Model (in further subfolders).
If we had extracted Resource.up not into a folder called ResourceExtracts, but into the Airfix Dogfighter folder, then the
two Foldertrees would have merged into one.
We will do that a bit later, but before we do, let's extract the other .up-file, the {Language}.up one.
Here, we will use English.up, but it should work the same for whatever language you use...
To do this, use the UPX program, following the instructions as given above, but with
English.up instead of Resource.up. Define the Outpath as EnglishExtract.
|
|
Chapter 3: Overview of the extracted Foldertree from English.up |
back to topxxxxx |
The picture on the right shows the foldertree after UPX has done its work on English.up. Once again
we see that the folders extracted are slightly different from those created after the original installation. If we compare the
Foldertree resulting from the UPX-extraction of English.up to
that of the one from Resource.up, we see that there are overlaps: Again we have a
Game-folder, with a Briefing Subfolder, but this time with a
Medal subfolder instead of the Level-subfolder.
The other main folder, Graphics, contains largely the same subfolders as the Resource.up
-tree, but the contents of the various subfolders is different. That was to be expected: all files extracted here contain
Language, whereas, as we saw earlier, all files extracted from Resource.up are
language-independent.
The Briefing-subfolder contains the 20 Briefing-files for all 20 original Missions,
but there is an extra one: AllAircrafts.brf.
Just like Allied11.brf and Axis11.brf it contains a list of Available Aircraft.
There are two differences however:
The Briefing-files are a bit of an oddity: when you select a Mission to play, you get the Briefing-information for that Mission,
but the Aircraft available to you depend on how many Missions you have completed....
|

Fig 3: English.up Foldertree |
|
|
Chapter 4: the Briefing-Mechanism. |
back to topxxxxx |
Every Mission starts with a preamble describing the background and the objectives of that Mission,
and these are described in the Briefing-file.
However, if we have a look in this folder after extracting resource.up, we find only 2 .brf-files:
Allied11.brf and Axis11.brf.
Even though there are only 10 Missions for each team... Why?
The reason is rather simple: Every Briefingfile for Missions 1-10 (both sides) contains text,
and therefore can't be extracted from Resource.up which is Language-independent as we saw a bit earlier.
For a full description of the Briefing-file see the Filetypes-page,
but suffice for now to say that, apart from the briefingtext, the .brf-file also contains a list of
aircraft available for the Mission in Question.
The way the Briefing-mechanism works is as follows: When a new Pilot is enlisted, a new Rosterfile is
created for that Pilot in the Rosters-folder. For a full description of this file see the
Filetypes-page, but suffice to say here that this file keeps a record of how many Missions (for
each side) the Pilot in Question has completed(!).
If it is a new Pilot, he will not have completed any,
and can only fly Mission 1. Therefore, Briefingfile Side1.brf will be presented, and the list of aircraft
available to that Pilot for that Mission will be taken from Briefingfile 1, in the case of
AlliedMission1 that means only the Hawker Hurricane will be available to that pilot.
Once the Pilot has completed AlliedMission1, he is ready for AlliedMission2 and on selecting that Mission
he will be presented with Allied2.brf. In AlliedMission1 he has gained the
Hawker Typhoon, so AlliedMission2 can be flown with either the
Hurricane or the Typhoon.
But, and herein lies the crux of the mechanism!!, if at this stage the Pilot decides to fly
AlliedMission1 again, he can do so with either the Hawker Hurricane OR the
Hawker Typhoon, as he has gained the latter aircraft on completing
AlliedMission1.
The conclusion is clear: when a pilot flies a Mission, the Text of the Briefingfile for that Mission will be displayed, but
the list of Aircraft Available (the AIRS-block) will be taken from the
Briefingfile for the Mission that this pilot yet has to complete.
In other words, if you have completed AxisMission8 and want to fly
AxisMission3 again , you will be presented with the text from Axis3.brf,
But with the AIRS-list from Axis9.brf.
For some reason, probably only known to the original programmers, you are rewarded an extra aircraft after you have
finished a Campaign: the Hellcat for the Allies, the Komet for the Axis Team.
As these are not available in Side10.brf, they have to be included in Side11.brf, even though there is no
11th Mission in either campaign. Side11.brf therefore has no text and can
therefore be extracted from Resource.up.....
This mechanism has one unwanted side-effect: The whole Briefing-scheme is developed for a Campaign , in other words,
10 related Missions that follow each other. If you create a new, single Mission for that Campaign you can add any aircraft in the
AIRS-list, the list of Available Aircraft but if you do that only for the briefing-file
for that Mission, those aircraft might not be available if you have already flown a higher-ranked Mission....
|
|
Chapter 5: To UPX or not to UPX?. |
back to topxxxxx |
So, do you need/want to do the extractions, and if so, where to?
The most straightforward answers would appear to be yes, and in the
"Airfix Dogfighter" root-directory.
But on the other hand, if hacking the game is not your thing but you just want to download what
others on the forum have created, then most of the files you don't need to change,
indeed it would be unwise to do so. The only thing you need to know is the correct folder to copy the downloaded files in.
Figure 4 on the right gives the complete Foldertree after extraction of Resource.up and
English.up into the "Airfix Dogfighter" rootfolder.
This should give you a clear picture of the paths of these folders.
The most common files to be changed are for new Maps and/or Missions,
and the relevant files are all placed in the Game folder and its subfolders.
Apart from new Missions, alternative Textures have been created for various objects and
parts of the interior of the house, and for that you will need access to the
Graphics-folder and its subfolders.
As mentioned, pulling the game apart is still ongoing, so there might be other files that will be adapted.
A recent example are the .world-files and .ccf-files for the
HunterMissions Allied 6 and 8, where the waterlevels have been adapted.
So, what to do? My advice would be to extract both Resource.up and
{Language}.up to a separate folder, and copy any file or folder from
there to the correct location in the "Airfix Dogfighter" Foldertree on a " Need to"-basis.....
 Fig 5: Foldertree with separate editing folders |
Fig. 5 shows a workable structure: both *.up-folders are extracted into a separate "Editing"-folder that can serve as
"Knowledge Base", but won't interfere with the running of the game.
The structure of the filepaths in the "Airfix DogFighter"-folder is copied from the structures in the "Editing"-folder.
|
|

Fig 4: Complete ADF Foldertree
|
|
|
|
|