Airfix Dogfighter

Editing the game

Limited editing

Thanks to the work of Jaystonian and Jim Rowley it is possible to edit the in game missions and multiplayer maps using special scripts.

File Extraction

In order to edit the game, you must first use a program to extract all the game data into separate files from a large file resource file.
The program in question is called UpExtract written by Jaystonian. The latest version is available here. It is a DOS program and takes two parameters which you must specify.

To use the program, type the following in a DOS window in Windows:
UPEXTRACT c:\progra~1\parado~1\airfix~1\resource.up EXTRACTEDFILES

Level editing

If you happen to make a mistake in your script, dogfighter has a terrible debug interface. It does 1 of 3 things when an error occurs. For instance, say inside your server-side script you have some variable that gets checked every second (the wait(1) is required to allow the game to do other stuff.. wait(x), where x cannot equal zero, is legitimate. I do not know if x must be an integer.) When an if statement is supposed to fire, and never seems to, it could be because you forgot to instantiate a variable, or you have some other error in that block. By a block I mean "event SetupServer { ..... } ". That entire event will be ignored if an error is present.. or one of the other two results mentioned above.

This is how I create a map: I go to the df editor, load a map, and add the furniture, etc.. I set the start positions (no more than 16!!! heh). I'll add very few AI (since they lag the server tremendously). Any routes I want them to follow, I'll do it using the EXTRA code. This creates a variable for you and it gets instantiated with a coord3d. Using these route/path points, I can add them later to an AI's route. It can be tough to remember which ones they are, so give a good name, and keep them grouped (ie, pathKitchen01a, 01b.. etc).

There are so many quirks with the editor its tough to get into.. Experience with the editor is what you need to understand how to get stuff working right. For instance, using the EXTRA keyword will inadvertently convert all SpawnPickup's to a CreatePickup, which has no respawn value.. So all pickup-able items will never come back. No worries, just edit it later.

One more thing to add.. Never ever ever go back to the DF editor AFTER you've modified the code to contain new routines and stuff.. It will revert. Do it by hand! Use the editor in the beginning to get it the way you want. When you use the EXTRA keyword, and are finished with all extra stuff, save it, exit, and go back in. You can still use the FREEROTATE code and add more furniture if you wish.. as long as you think it won't interfere with any routes you've defined.

Single player missions

Jim Rowley has produced a single player level for download using UpExtract. The mission replaces Allied Mission 1 when installed, and includes a batch file to restore the original mission.

UpExtract details

The most important file, the one with all the code, is the 'Upextract.cpp'. This was written in console-based win32 C++. The functions which appear above the main() block do most of the work. I tried to keep it self-explanatory (self-describing code with minimal comments), and it should be relatively straight-forward. The document included (.doc) in the source code is a page about what I know about the table data containing the files in the resource.up file. Basically each table entry is 6 32bit variables.. It reads the header, then it stores the table data for the files, then the folders. Then it reads the names for each one, storing it inside its own array structure. Then it iterates through the array and writes the files one at a time. The executable is command-line based.. If you just enter the executable name and run it, it will say you need a couple parameters.. the first one is the location and name of the 'up' file, and the second parameter is the folder to be created which will hold all this data. The folder structure extracted will match the airfix subdirectory where dogfighter is actually stored (ie. the user/save/levels, etc..) All that will be built. You don't even need to re-construct the resource file if you want to change something. Just put the file in the correct folder under dogfighter (ie. c:\progra~1\parado~1\airfix~1\...) and when you load the game, that file will replace the one inside the resource file. For example, if you put "Trench_Wars.afs" in your "user/save/levels", that version will be used and not the original one.

UpExtract updates

Jay has made the program open source so it is open to modiciation by any C++ programmer The UpExtract program was modified by Jim Rowley on the 22/1/02 to extract the files into proper folders. Modifications were made to the data extract portion of code as well (file lengths were not being retained). Jim also says "There may be a few files that don't work properly, but I've found that at least 95% of it is extracted exactly the way it was created."

UpExtract downloads

The future of game editing

Jay and Jim have given everyone the tool to be able to edit maps, but the next step would be to edit in-game objects like planes and furniture. If new objects could be created the life of the game could be extended.

New in game objects

According to the main programmer of the game, Mattias Olsson, the files that make up the aircraft and many objects in the game are in a format which he cannot release. He gave a brief explanation of how to add new planes; "You would need to export a model from some 3d package to our format, which I can not release, and add a DLL type which has the code and parameters for the aircraft.
He says the file type is an internal format used at UDS and he cannot tell me how to open the files which is a real pain.
If it a custom format the only way I can think of having any clue as to the file structure is to hex edit the files like what was done with the extract program.
A thread on this subject on the forum:

New Game modes

You may have noticed the Game mode option when playing multiplayer. According to Mattias "Game modes are different types of rules for the multiplayer games, such as "deathmatch" or "capture the flag". All code for the gamemodes are located in the "\game\modes\*.mode" folder. They are DLL files which are loaded dynamically at startup of a multiplayer session. It would be possible to plugin new gamemodes without any larger problems if you knew the DLL interface and some API functions in the engine." Unfortunately there is only one game mode at the moment - "Dogfight". But if this could be extended to Capture the Flag for example the game would take on a new level. Mattias told me that he spoke to his manager and was told not to release any more details of the game due to legal problems with Paradox Entertainment. He can't give any details about it, but in his opinion Paradox have been acting badly and deserve to be dragged to court.

Parts of this page was created using this forum post by Jay made on 28/8/2001 at the old website of PlanetDogfighter.

Last modified: September 13 2016 11:57

©Matt Fletcher 2001-2005
©KamikazFu 2005-2015
©Rayvtirx 2016