sim-museum / esports-for-engineers

Providing linux scripts, documentation and bug fixes to revitalize classic engineering simulation games. The games are organized into a week-long eSports & mindsports decathlon.
81 stars 3 forks source link

Mig Alley replay not viewable in Tacview #3

Open sim-museum opened 5 years ago

sim-museum commented 5 years ago

Saving replay output to the Tacview universal standard telemetry format would solve this problem.
Here is an example of a csv file:

Time,Latitude,Longitude,Altitude,Roll (deg),Pitch (deg),Yaw (deg) 2019-02-01T20:20:30Z,30,60,34,-0.11536,-0.14832,295.76

This format is very simple, however Tacview supports only one aircraft per file for now.

That's why I strongly recommend using the acmi file format which is much more powerful and almost as easy to use. The same data would look like the following:

FileType=text/acmi/tacview FileVersion=2.1 0,ReferenceTime=2019-02-01T20:20:30Z

0.0

100,T=60|30|34|-0.11536|-0.14832|295.76,Name=MiG-15

The dedicated documentation gives more examples https://www.tacview.net/documentation/acmi/

Looking at the Mig Alley code on github,

https://github.com/gondur/mig_src

I was able to find some functions that are involved in writing the Mig Alley replay (.cam) file. This is a first step to understanding the .cam file format. If I can understand the format, I may be able to write a utility that converts .cam to .acmi. Looking at the Mig Alley source code,

the function at SRC/COMMS/WINMOVE.cpp:329 seems to be called every 10 somethings (frames?) and has some checks for whether replays are currently being taken

SRC/COMMS/REPLAY.cpp has a lot of replay-related code

SRC/H/WINMOVE.h has a _basic_packet which is alias for REPLAYPACKET which is the object REPLAY.cpp writes (in binary format) in StoreDeltas() (which calls ReplayWrite() which calls WriteFile)

(The same tacview limitation applies to Battle Of Britain, which uses the same Rowan Software game engine as Mig Alley. Both sims produce produce replay files with the suffix ".cam", suggesting that the output format is similar or identical).