Supporting native Tacview in BMS 4.36.1
-
Hi folks! As many of you noticed, native Tacview recordings in BMS 4.36.1 default to KTO coordinates, which produces very odd results in other theaters. Let’s fix that!
The problem:
BMS currently generates Lat/Long by taking a coordinate for the southwest corner of the theater, then dividing the distance from that point by the circumference of the planet. Suffice to say, those values can be very inaccurate.
Tacview solves this problem by storing all edges of the theater (west, east, south, and north), then interpolating between them using a simple formula. Unfortunately, there’s no way to automatically calculate these edges from existing data - the Tacview author hand-fit theaters to the globe in Google Earth, and stores the results in
Falcon4Theaters.xml
. We considered parsing this file to get theater coordinates, but it seemed like a bad idea for a couple of reasons:- It would mean that BMS would rely on third-party software. (Granted, if you have Tacview recordings enabled, you probably have a copy installed!)
- Theater installers would have to edit Tacview’s files, or direct users to do so.
The solution:
Instead, BMS now tries to read an optional section at the end of each theater’s
Theater.map
file, containing those edges (west, east, south, north, in that order) as little-endian, 64-bit doubles, i.e.,struct TacviewTheaterBounds { double west; double east; double south; double north; };
Theaters which extend their
Theater.map
file with this data should see correct coordinates in Tacview recordings. Very good values for several popular theaters can be found in Tacview’sFalcon4Theaters.xml
, as previously mentioned.I’ll try to make some simple tools to help theater creators do this, or maybe talk to Falcas about building support into MissionCommander.
-
mrkline
-
How to apply the solution to your theater:
As explained previously, to write the coordinates in the .acmi correctly, BMS code needs to know the N/S lat and W/E lon of the 4 theater “sides”.
It was decided to let BMS read those values out of anAdd-On [theatername]\Terrdata[theatername]\terrain\Theater.map
file, since it’s a binary file, you will need a hex editor (I used HxD) to add the values.- open the Tacview file holding theater data, located in
C:\Programs\Tacview\Data\Xml\Data-Falcon4Theaters.xml
, this will provide a quick reference for theater border coordinates that should already provide a proper alignment in Tacview (for most 64 tile theaters), for this example we’ll use the ITO values;
<West>30</West> <East>40</East> <South>25</South> <North>35</North>
-
open your
Theater.map
with a hex editor like HxD (might be better to make a backup of the file first), make sure you select “little endian” as Byte Order below the Data Inspector;
-
In HxD, “Edit>Insert Bytes”, set bytecount to 4 to insert 32 new bits, they will be highlighted in red. Mark them and use the Data Inspector to overwrite them with a new float (32 bit) value “20000”, this is some “max altitude” metadata that needs to be present;
-
Insert 8 new bytes (64 bits) like in step 3, select them and use the Data Inspector to overwrite them with a new 64 bit float, repeat this step a total of 4 times to write the WEST, EAST, SOUTH, NORTH border coordinates in order;
-
In total you should have added: “20000” as a 32bit (4 hex-value pairs or bytes) float and the WEST, EAST, SOUTH, NORTH border coordinates as 4 consecutive 64bit (8 hex-value pairs or bytes) floats, all totaling to 36 new bytes written since you started editing. Save the file and check alignment by creating an acmi using the new native export;
- open the Tacview file holding theater data, located in
-
MaxWaldorf
-
Many thanks,
@RUSHER0600 I followed along and did a ‘do it yourself update’ for Balkans. (until the official …BMS436\Data\Add-On Balkans\Terrdata\Balkans\terrain\Theater.map file is updated). Worked a treat !If it helps anyone in the meantime download from HERE
(backup the original first). -
Quasi_Stellar
-
JUmpstart5179