Search the archive:
YaBB - Yet another Bulletin Board
 
   
 
Page Index Toggle Pages: 1
Send Topic Print
Missions and Airfields data (Read 241 times)
Jul 28th, 2006 at 2:40am

piersyf   Offline
Colonel
Tasmania, Australia

Gender: male
Posts: 76
*****
 
Hi guys. Talked about this before, but now starting to do something about it. Recently tried to install several campaigns but can't fly any of them because of duplicate airfield data. Some campaign designers even allocate numbers to the basic set of 50 installed with the game to different airfields!
Anyway, started working on a database so I can at least sort out the mess in my installs and get to actually play these campaigns.
In doing so I started with a new 'clean' install of CFS2 and got the airfields.dat file and used that as the basis of the database. I then loaded a campaign (In Defence of Australia). No new airfields installed. I went through the missions and found one (mission 5) which has an airfield number of 8051. The stock list ends at 8050, yet the game had no problems with this, the mission flew normally. The location is Port Moresby (which has the in game id of 8043). Both these numbers are used in the mission file, listed as separate airfields, presumably for the different aircraft (different start points).
OK, so somewhat confused I went to the install I already had and checked the airfield.dat file there. Airfield 8051 in that list is Lord Howe Island, yet when I run the mission, it plays fine. The other aircraft appear at Moresby.
Can anybody offer insights into the workings of this as it may help me develop the database into a generally useful form (although actual coding of a utility or macro I'd leave to someone who knows what they're doing, I'm happy to do this basic 'grunt' work)?

Piers
 
IP Logged
 
Reply #1 - Jul 28th, 2006 at 1:51pm

Cody_Coyote   Offline
Colonel

Posts: 92
*****
 
In my experience the real problem with differing ID numbers in addon missions and campaigns does not come with the basic flying of the mission but when you attempt to go to Advanced Info.  Here are some things to consider.

As you know, when you open any mission where you takeoff or land and you will see a runway entry that looks similar to the ones in your airbases.dat file.  The biggest difference is that the runway numbers in the mission file start at “0” and run consecutively.  So in a mission that uses Henderson the runway number may be “0” while Henderson might me runway number “103” in your airbases.dat file.  That difference doesn’t matter. The key thing to remember about these runway entries in the mission file is that they are not copies of what’s in your airbases.dat file, rather they are copies of what’s in the author’s airbases.dat file.  That’s a key distinction.  Also, you need to know that the game and the Mission Buider (MB) treat this information somewhat differently.

In the game, your starting position and waypoints are determined by the longitude and latitude that’s entered in the mission file.  The runway ID numbers (the 4-digit numbers) don’t necessarily come into play.  You don’t have to have the same scenery installed in your game to fly a mission that I wrote in my game.  That’s a good thing.  I could send you a mission I wrote that takes place in Borneo and even if you don’t have any of the same airbases or scenery in your game you could still fly it.  You might take off and land in an empty field but as long as you have the same aircraft (folder names) in your game and any infrastructure that I added such as ships, buildings, etc. the mission will work.  This also explains why your Lord Howe mission works fine even though the ID numbers are different from yours.  However, as soon as you hit Advanced Info the game may CTD. 

When you click on Advanced Info you are creating a link between the game and MB.  The map you see in Advanced Info is the map from MB.  In MB airbases are identified by what is entered in the airbases.dat file and not what is entered in the mission itself.  In my example above, since you don’t have the Borneo airbases entered in your airbases.dat file when the game (MB) tries to find those ID numbers in the airbases.dat file so that it can display them on the map they aren’t there.  Result – Crash to Desktop.

Unfortunately it is much more complex than that.  As you've found, there isn’t one standard list for ID numbers for every runway in the world, designers can add their own.  Sometimes add-on scenery has an airbases.dat entry that includes an ID number and sometimes they don’t.  As a result, except for the stock runways, we probably all have different runway ID numbers assigned to different bases in our airbases.dat file.  Even if you and I have the same add-on scenery in our games, if my ID number for the runway is different than yours it can result in a CTD. 

There are many different combinations that can cause problems.  For example: none of the ID’s or geographic locations (longitude and latitude) in the mission match your airbases.dat file, some of the ID’s/geo’s match and some don’t, the ID’s match but the geographic locations don’t (the designer and you numbered the bases the same but used different longitude and latitude for the same bases), the ID numbers don’t match but the geographic locations do (the mission starts at Darwin and ends at Lord Howe and both of you have the same scenery but you gave different ID’s to those bases),etc., etc.  In some cases the mission and Advanced Info will work if the takeoff data is correct even if the landing airbase information is different.

Suffice it to say that these conflicts between the ID numbers and runway locations in missions and what's in your airbases.dat file can cause:
1)      no problem
2)      a mission failed to load error message
3)      a CTD when you start the mission; or
4)      a CTD when you hit Advanced Info.

The bottom line is that any time you encounter a CTD when hitting the Advanced Info or starting a mission, especially if you are flying an add-on mission, always open the mission file and check the airbase info first.  To fix the problem you need to make sure that the ID numbers in the mission don’t match any that you have in your airbases.dat file. If you find a match, change the mission ID number to one that you aren’t using. 

You can also get a CTD on your own missions when you have duplicate runway ID’s in your airbases.dat file.  That can happen easily as you add airbases.  Always do a search of the file for the ID number you are entering when adding a base before you save the file.  It might save you grief later.

Hopefully some of this will help you on your quest to solve the runway ID issue.
 
IP Logged
 
Reply #2 - Jul 28th, 2006 at 7:50pm

piersyf   Offline
Colonel
Tasmania, Australia

Gender: male
Posts: 76
*****
 
Hey Cody, thanks! Kinda what I suspected, but you rounded it out a lot more.
Let's see if I'm getting this; a mission file that has a take off and landing airfield id number that matches the airfield.dat file in my game will work (so long as other infrastructure is there).

In the case where the player take off or landing id is different between the mission file and the airfield.dat file, the mission may CDT or else (as has happened) the planes may try to warp from Port Moresby to somewhere in Manchuria and crash on the way or run out of fuel.

In the 'In Defence of Australia' mission I described, the 'odd' number was assigned to AI aircraft (A24's that the player escorts), the player airfield numbers are take off/landing and target. So this would mean that the advanced info won't cause a crash (which it doesn't) unless the AI were flyable and had a human pilot who wanted to access advanced info?

I thought for a bit that the airfield number in the mission related to player; like airfield "0" is where the mission starts for the player, but not so. In that same mission (and several others) airfield "0" is the target (Lae) and airfield "1" is Port Moresby, the start and finish point.

The reason I'm setting up a database (actually a spreadsheet) is to 'rationalise' the airfield and mission files. With this new install as I put in a new campaign I update the airfield.dat file first allocating new numbers as instructed. I then load the missions but open each one and check the airfield data. One of the annoyances is that in the mission file you only get a reference number (although it will match the original airfield data that shipped with the campaign) and a lat/lon. With the spreadsheet I can 'control-f' the lat/lon and see if the airfield already exists in my airfield.dat then just change the airfield id number in the mission. I've also got into the habit of including the airfield name in the mission file as a back-up.

OK, if none of this is glaringly wrong I think what I'm doing will work. Thanks!

Piers
 
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print