SwingKid Posted April 29, 2008 Posted April 29, 2008 How can I move an airbase (like you did for the Merzifon mod)? At this time, relocating a Lock On airbase from one map location to another requires binary-file computer programming ability. Generally speaking, data for a Lock On airbase is stored in three files: (a) the ".scn" scene file, (b) the ".rn" runway file, and © the "Onlay_vpp.sup" file. The ".scn" file is by far the largest, and contains the positions of all map objects, including airbase buildings, trees, etc. The objects in this file are organized into a complex data tree structure of "visibility cubes" to help the Lock On graphics engine display them more efficiently. That is - when your view is looking in a certain direction, some regions of terrain will be visible, and others will not. Instead of checking each of the 800,000 objects in the scene file to see if it needs to be drawn or not, the objects are organized by their location so that the graphics engine can quickly skip through large numbers of them at a time. I call it a "data tree" because the "visibility cubes" contain smaller sub-cubes, which contain smaller sub-sub-cubes and so on, more than a dozen layers deep. When you move an object from one location to another, then, it's more than a matter of simply changing its coordinates - you need to update the structure of the entire data tree of visibility cubes - possibly adding new cubes and/or removing old ones. Doing this by hand is a nightmare of mathematics, keeping track of dozens, hundreds or more memory addresses that need to change consistently and accurately. Fortunately, a computer program now exists to automate most of this difficult work, and this is how many non-programmers have been able to add trees and other new map objects to the scene files. The program itself is not the easiest thing to use - the instructions are complex and it's easy to permanently over-write your 90 megabyte scenes files. It may also take eight hours or so for the file to be created, due to the huge data processing that must be done - and the output scene file is usually about 2x larger than it needs to be, since it uses a less efficient algorithm than whatever ED uses to make the original scene files. The ".rn" runway file contains the location of the airbase icon on the map. It also contains all the taxi routes used by AI aircraft at the base. It also contains a duplicate copy of all the airbase building object coordinates, because this file also controls things like opening shelter doors and runway lights when aircraft approach. The co-ordinates in the ".rn" file are not organized into very complex data structures, making this file the easiest of the three to hack. With a hex editor, you just find all the floating-point values that represent coordinates, and replace them with whatever you want. Note that there are hundreds, maybe thousands of them - all the airbase building coordinates, plus all the waypoints for AI taxi routes. So, you will really want a computer program to move all these coordinates together for you in one pass, and do it hundreds of times at all the right points in the file. Although this is a much easier programming task than trying to modify the scenes file, the difference is that I have NOT made a program to do it for you - and have no plans to do so at this time. I created one custom program to move Razdolnoe to Merzifon, and that's it. Any other airbase you want to move will require a new computer program to be created. The ".sup" onlay file is a bit more of a headache - and is actually the one you should probably work on first, if you're still serious about moving an airbase. This file contains data for the actual runway and taxiway "textures" that you see on the map and in the game, that allows your landed plane to touch down without sinking into the dirt and getting stuck. It also contains other airbase textures like grass, perimeter fences, etc. Like the .scn file described earlier, the .sup file organizes its data into complex structures, so that you can't just change a coordinate from one value to another to move an airbase. At least, the data structures in this file are a little less complex than in the .scn file: the Lock On map is simply divided into a checkerboard pattern, with squares about 20 km per side. Runway shapes are individually drawn within each square. To move a runway, you don't actually rewrite coordinates, so much as move the desired runway surface from one checkerboard "square" to another. Because of this, airbases can only be relocated efficiently in distance multiples of 20 km. This is one reason why it's really only practical to move airbases into the flat undetailed portions of the map where there is no relief terrain - when you can only move the airbase by 20 km increments, you don't have the precision necessary to be able to fit a relocated airbase into a sweet spot between some mountains. Since there aren't thousands of numbers to change, this is one file you could hack manually with a hex editor - there are only a few dozen pointers you need to move around and keep track of changes. That's what I did. Again, I have made no computer program to help others do this, and have no plans to do so at this time. Good luck!
Recommended Posts