Database Editing by ranger822
Database Editing is perhaps one of the most interesting and rewarding parts of Falcon development. This is the place where new models, skins, weapons, etc get integrated into the database for use in Falcon. There is nothing quite as satisfying and taking a brand new model with a brand new skin set and being able to take this new aircraft for a test flight. While, there is a lot more this this simple act than simply adding a few things, and database is more than just aircraft, it include, all vehicle types, units, weapons, flight models, parent, models, CTs, radar, and much more. Unfortunately, because Falcon is such a demanding woman - your performance as a database editor must be nearly flawless or things go horribly wrong. While PMC is dedicated to providing support for different Falcon.exe, and the requirements for different executables is slightly different I will only be addressing the specific edits as they apply to FF Cobra.exe and RV.exe. I have limited experience with other Falcon.exe and therefore don't want to provide inaccurate info for those folks choosing to use other Falcon.exe. Perhaps other database developers will be willing to contact me and I will include supplementary instructions as they apply for different exe. In general most of the principles that I layout here should apply almost universally for the other exe's. Also, is should be said that the two most important tools for database editing are LOD Editor (Fred Balding) and F4Browser (Julian Onions). With the advent of RV I would also include DXEdit.exe and DXDBTools.exe, and LODConvert.exe all three of which I will also discuss in some detail.
Lets first discuss the various parts of what you see in the database, what it represents, how it all fits together, how to add, delete, and modify and of course troubleshooting problems.
When opening F4Browser the first thing that I would advise is to ensure that you always, always establish for yourself a Falcon4 folder where you do all your DB edits. Thru the use of Windows folder renaming function you can rename a Falcon4 folder whatever you like such as Falcon4 DB Edit. Second I recommend that you keep a second Falcon install which contains a working Falcon installation which you can use as your test-bed for all edit. These two install folders should then be kept separate; perhaps partitioning a hard-drive for such a thing would be a great idea, but it entirely up to you. In any case, what I have found is by keeping a folder specifically for DB editing and another for testing helps to avoid corrupted databases for other installations. For those not familiar with DB editing I would also recommend you do one other thing - always make sure that you do all your DB editing in the Falcon4/terrdata/objects folder, even if you are working on some other theater besides Korea. The reason is I have found that sometimes the registry can get messed up with changning theaters and source locations for editing. The safest thing to do is to make sure you always have your registry set for Korea theater and you always do your edits in the Korea objects folder. If you do this you can avoid corrupting your database when your save edits go someplace you didn't intend and therefore ruining some other install and now making your job of redoing what you just did to your existing DB edit process. So, just replace all the old Korea object files with your theater files. When you are ready to test - copy the entire objects folder to your test install objects<theater> folder and run your test. Now with that said, lets discuss the different parts of the DB as seen in F4Browse.exe.
Perhaps the most significant entry in the database is the CT. CT stands for Class Table and it is the key element that is responsible for how Falcon communicates or links the objects in the database with the objectives in the campaign engine files and terrain. In most cases Falcon assigns a Falcon ID number of some sort or another for CTs. This is usually some offset of CT # +100. This Falcon ID number is then used to relate things together. CTs are used for all sorts of objects in the database. Objects include, vehicles, objectives that are a collection of instructions to build/render features, taxi points, etc for a given location on the terrain map and (not to be confused with objectives, per se in a campaign file which are actual locations on a map), features (buildings, runways, bridges, etc, weapons (missiles, bombs, etc). All these objects need to have an assigned CT in order to exist in Falcon. CT's beginning at 0 and are sequential. In order to add a new aircraft, for example, you will need to add a new CT for the vehicle entity. Further, in order for the aircraft to show up in game you will also need to add a CT for the unit flight and a CT for the unit squadron entities. The way to go about this is to add the CT using the add/copy function in the Browser. Besides the CT there are a lot of other parts to the database. For most people, the aircraft tend to dominate their thoughts about the database, i.e. Falcon is a flight sim, right? Well yes and no. Falcon is a lot more than just a flight sim. It is actually a rather complex campaign/war simulation which happens to include a very detailed flight section in it. What sets Falcon apart from other flight sims is the ground and sea sections of the war. Tanks, troops, ships all move around and actively engage in combat where rules are applied to the engagements and decisions made based on some probabilistic algorithm and players and pieces referred to as game entities are killed, destroyed, repaired, moved, etc. In order to get aircraft to fly a whole set of data must be input on various aspects about the aircraft; models, functions of how the model behaves in the 3d world, the quantity of the aircraft, what sort of weapons it carries, where it carries those weapons, the quantity of those weapons, the effectiveness of those weapons, etc. Because Falcon is supposed to focus on the air battle, the database is pretty well developed in that area. Rather than explain all the different sections of the database - I solicit the kind reader to open any objects folder up and simply browse thru the data fields presented in either LOD Editor (LE) or F4Browse. You can also open the help file in F4Browse for a rather detailed explanation of the various data elements.
A short word regarding LE and F4Browse. LE has been used primarily for editing models, although painful, it has proven an effective tool once understood. I have used it mostly to texmap LOD format models, check skin I have made, modify existing models, add parent records, and add features to objectives using the Objective Editor tool inside LE. F4Browse is the workhorse of DB editing - it basically does everything else. The two tools use in concert with each other provide most of what you will need for the bulk of your DB editing.
When using F4Browse, you will find your work easiest by using add/copy and selecting a CT that is most similar to the entity type you are trying to add. So, if you want to add a fighter with a sub-type of 6 pick a CT for a vehicle-fighter that has the same subtype. Similarly, if you choose to copy the CT for the vehicle, cross reference the CT's unit flight an unit squadron CTs and add/copy those as well. Now you should have a complete set of CTs from which you will need to change the specific values of the CT in order to “add” a new record and not conflict with any of the existing records. The best way to do this is to go the the CT records in F4Browse and sort the CTs by type or subtype - - this will then group things together in a way to allow you to see the type, subtype and specific values already in use. The task is merely one of finding a set of specific values that will not conflict. This is something that the Maddog tutorial doesn't cover as well. To better illustrate all this lets take a look at Maddogs's tutorial and then review it and then pick up where he left of and finish out the rest of the tutorial to include all the rest of the database entries necessary to get an aircraft to actually fly in TE.
Maddog's Tutorial Revised by Ranger - - - (without permission since I can't seem to communicate with Maddog very often)
-Fire up LODEditor (LE), browse to your terrdata/objects folder for the KoreaObj.HDR file
-File → Open Model File…
Browser to your finished model and open it.
You will see this screen below next, play special attention to the detail highlighted in the red block. It is a good idea to write this info down on a separate piece of paper or in Notepad/Wordpad. This is basically telling you what the last known numbers in the database are and it makes it easier to locate your new entry later as you go along.
Now, click on th Edit LOD button and you will see a screen similar to the one below. Under Utilities choose Model/Texture SetUp
The next screen you see you need to follow these simple steps:
- Choose Append/Select a Parent
- Then in the Enter Data panel that pops up, just click OK (it defaults to -1 which mean we want to add/append a new model to the DB.
- Then click on OK
Now do the same for the Append/Select LOD the menu will ask you to locate the LOD file of your model on your hard drive and after that some distance view information. I am not sure what these numbers really mean so I follow Maddog's advice and type in the number 10000 and click OK
The distance data can be changed after wards anyway, so don't worry too much about that for now.
Now click on Update Parent Record
Next click on Add/Replace Texture(s) and another browser screen will pop up which allow you to add whatever textures you have made for this model (CTRL + click to select multiple textures). One of the things about some later editions of LOD Editor is if you try to open a model that doesn't have textures loaded into the KO.tex file you may find some odd things going on with your model. Also, if you attempt to change textures in the root directory of a model (the texture list) and the textures are not present in the database already you wont be able to update your model. Typically, I prefer to add all my textures to the KO.tex BEFORE I append a model. The same applies if you have multiple skin sets. It is probably better planning to append a model once instead of populating your KO.lod file with lots of models that will need to be remove later. I suggest appending a model a few times as possible and therefore minimizing having to update the parent record and compacting your database multiple times. I will talk about compacting the database further along in this tutorial.
That basically comprises the first step in the process. BUT BEFORE you click on Close make sure you write down the new Parent ID and LOD Number assigned to your model. These are circled in blue on the screen below.
You can now close LOD Editor and open F4Browse (as a note I have not found a way to have both programs opened at the same time using the same Objects folder files.)
In F4Browse go down to Vehicle folder and click on it to open the sub folders and then click on Aircraft. Now find and existing aircraft that best matches the new aircraft you want to add. In Maddog's example he selected a Mirage -IIIE as his template because he was adding a Mirage IIIR2Z which is quite similar. The selection should try to match up an existing aircraft that is closes in role, performance, etc since it is entirely likely that parts of a/c data entries can be used with less modification. So, Right click on the list listing and choose Add Copy
The new entry will be copied to the bottom of the a/c list. So, scroll down to the bottom and locate your copied template
- Double click on the entry and change the name, this will help you identify this item, to the name of the a/c you want.
- Next write down the new Vehicle Ref number (Vcl No), in the example it is 657
- Also write down the CT ref No of the template you used (in this example CT Recd 2500)
- Click on Update
- Click on Class Table on the left, sort the list by No, then locate the CT Ref No of the template that you copied, in this example it is entry 2500.
- Right click and Add Copy.
- You new entry will be added, as always to the bottom of the Class Table list so scroll down and locate it
- Double click to edit your new CT entry
- Write down the new CT Ref No (in this example 3508)
- In the File Offset box enter the new Vehicle Ref Numbers (Vcl No) (in this case is was number 657) that wrote down earlier as explained above.
- Leave the rest for now and click on UPDATE
- Go back to the Vehicles tab »» Aircraft using the folder tree in the left panel of the Browser
- Locate your new model and double click to edit it again.
- In the CT Recd box enter the CT Ref No you just created in the step before (in this example is was 3508).
- Click on Update and that concludes Part 2. You can now close F4Browse for now and reopen LOD Editor again.
In LODEditor, browse the Vehicles list and you will now be able to see your new model in the list.
- Under the Parent section on the right (see pic below) next to the Normal button, change the Parent ID (in this case the old Parent ID is 2132)
- Change that parent to the new parent ID (which is 3800 in this example)
- Click on Update
- This is where those who did not write things down will panic. In Part 1 of this tutorial, when you added the new LOD you needed write down the new LOD number and Parent ID number. Remember the screen see pic below.
In the screen below we have changed the template Parent ID to my new Parent ID (3800_ which contains the reference to the actual LOD model.
If you click on the Normal button in the Parent Box (screen above) you will see it takes you to your LOD file you added in Part 1 (in this example it is 6433). You should not have to change anything here.
That is basically it for adding a model to the database. If you click on the 3d Viewer you should be able to view your model. Now that you have added the model to the database lets move to Part 4 which will discuss how to get your model to actually fly.
Now that we have gone thru Maddog's tutorial in adding the model and CT lets discuss the two other critical parts of the total package when trying to add an aircraft. Maddog's tutorial basically allows you to add the model and the required CT for the vehicle. However, to get the aircraft to actually show up you will need to add a CT for the unit-flight and the unit-squadron.
First fire up F4Browse again - - Click on the CT Tree and scroll down to the Vehicles »»Aircraft tab again. Locate Maddog's Mirage IIIE which he used for his example. Open the Mirage IIIE record and you will notice the Units with this box on the right side of the Vehicle Data Details window. You will see two Units identified as Fighter 501 and Fighter 500. These are the unit flight and unit squadron
- Double Click on each of these Units in turn. When you do you will notice it will bring up the Unit View window. In the upper left corner you will see the CT Index (CT Ind) and then a window with a number. This is the CT Index for the unit. Write this number down (in this example the Fighter 501 = CT2668, and Fighter 500 = CT2667).
- Now close the Unit View Window and go to the CT Tree view and click on the top of the tree Class Table, when you do it will sort the CT list numerically from lowest to highest.
- Scroll thru the list to CT2667, you will see that in the Type column this is a Flight Unit CT and CT2668 is a Squadron Unit CT.
- Now what you want to do is Add Copy both of these CTs. These will be added to the bottom of the CT list.
- Next take note of the CT number that was added for each unit. - Now in a similar manner to the way you added the vehicle CT, you will need to do the same thing for both unit records. So, lets return to the Units »»> Aircraft tab and find the flight and squadron unit records 500 and 501. Now Add Copy both of these to your Units tab. Scroll to the bottom and you will find two newly appended unit record with will contain data identical to your copied records. The new unit records will have a new number (No) (second column). These are the new Unit record numbers. However, you should notice right away that the data values for the CT and record number will conflict with the record from which you copied the data. The old CT number is referenced. This will need to be changed to your new unit CT number. Remember that when you Add Copy any item - it reproduces the old record exactly. So, you will need to go to the new record and edit this so that it isn't in conflict with the record you used as a template to copy from. Also, you need to use the Class Table and locate your recently added CTs and enter in the new unit record numbers. In addition you will need to sort the CT table in various sorting modes to deconflict and determine what values to use for your new unit CT records “Specific” value. How is this done? Easy, simply click on the top row on whatever item you want to sort by - - so if you want to sort the CT's by Class - click the class header,
If you want to sort by the Sub-Type - click on the Sub-Type header
Since I don't have Maddog's database with the MirageIIIR example lets use the ITO database as an example to walk thru the step of adding the unit data. First lets return to the Units »»> Aircraft tab. Go to the end of the database. If you had just Add Copy the flight and squadron units from the Mirage IIIE - the last two entries in list will be the Add Copy items. What needs to occur now is to have previously identified the CT numbers for the unit and vehicle CTs as well as the new unit and vehicle record numbers.
Now replace the values so that your new CTs point to the new unit and vehicle records. Once this is done you will then need to rebuild the two unit records. In the case of a/c squadrons you need to delete all the a/c entries that reference the vehicle record for the Mirage IIIE and then replace those with your new vehicle record. Next, you then need to add your new vehicle record to the the two unit records. There are different ways to accomplish this. If you use the original Falcon method, the Flight generally consists of adding the vehicle record to just the first two lines of the unit flight record. In the quantity box you can specify either 1 or 2 a/c. This will determine how many aircraft with be generated for the actual fight. So, if you want a wing man use a quantity of 2 (two) if you want to fly solo use a quantity of 1 (one).
And then taking and randomly adding either 2, 1, or no vehicle record references to the unit squadron record. In most cases I simply repeat whatever the original CT had and it seems to work just fine. Different squadrons may vary - you can have smaller numbers but I haven't tried to add more than whatever the unit originally had. When you have added your vehicles to the unit record you should then see the unit record populated with the new named vehicle. However, you are not nearly done yet. Now it is time to begin updating the rest of the data in the unit records which for the most part will be the same for the Flight and Squadron. Prior to adding your new aircraft, you should have collected up info on your aircraft in order to replace existing data in the unit record's data fields. You will need the to know weights, speed, estimate the radar cross-signature, etc. Some data you will need to make an educated guess on. For example, the radar cross-signature of a B-747 is going to be pretty close to a KC-10 so if you look up what was used for the KC-10, then you should be able to use that value and be in the ball-park. Again, if it just a matter of adding data that is reasonable when you are not sure of the correct values. Another area which requires some guesswork is the area of setting the flags for a vehicle. There is a lot of inconsistency in flags across the data. In general click on the Flag button and then select those items that seem appropriate. The really important data field which you will need to have exact data/info on is the Squadron Stores Data (SSD). When you copy the unit CTs you will be copying the old SSD value. This means that your aircraft will only have access to whatever munitions are allowed by the old SSD value. You will need to change this in order to load the proper munitions. The best thing to do is to perform an Add-Copy of the SSD used by a similar aircraft and then go thru and delete all the munitions in the new SSD record. Save this for later, we will return back to this once we have added the slots to the vehicle record and decided what is going to be carried on the racks/slots.
Now that we have successfully added a new vehicle entity and the two required unit entities lets dig into the the other parts of database editing that will now make the new vehicle entity perform uniquely. You might recall that when you did your add/copy of the vehicle and unit CTs - you also copied all the data that goes with the CT's you copied. Unfortunately, a lot of the data loaded into any given CT is going to need to be adjusted in some way. Further, we will need to take a detailed look at the vehicle data entry and discuss each of the database entry points, what it does, and how it relates to other parts of the database. Just as a side note, parts of the Falcon database are shared across different CTs and records - you must be aware of changes that you make because if you make a change in a record - you must ensure that it doesn't affect other records that might share the data record. This also requires the DB editor (you) to thoroughly review a record prior to editing and identify all the users, if any, of the data record. We will talk a little bit more in depth about this when we talk about squadron stores, radars and flags.