ACMI compiler AKA don't wait to get to the debriefing
-
Ladies and Gentlemen, welcome to my first contribution to the BMS community!
Summary
This tool is compatible with any Falcon version starting from Freefalcon. So Falcon BMS 4.32, 4.33 are included
I made a tool that will make you able to record everything in your flight with the Avionic Recorder (AVTR) without having to wait for a VERY LONG AND FRUSTRATING time at the end of your mission.
Because the tool handle the compilation and prevent Falcon from doing it, you’ll never wait again when you exit the 3D environment, you’ll go directly to the debriefingYou’ll be able to compile the ACMI at any moment you want, and very quickly
Falcon BMS record a file on the fly (a .flt file) and then convert it to a .vhs file when you exit the 3D environment.
My program basically do the following:- Monitor the ACMI folder for any .flt file creation
- Rename the .flt file so Falcon don’t convert it when exiting the 3D world. (No more waiting to get to the briefing)
- Wait for your input to convert the .flt file into a .vhs file using all your computer ressources (Which means that you won’t have to wait 15 minutes to get a .vhs file)
- Compile faster than BMS 4.34
If you want to get an idea of the performances just look at that :
With the specs: Ryzen 7 3700X 8 cores / 16 Threads - 32 GB of DDR4 RAM / MX100 SSD
Motivation
I’m not the worst pilot in the world, but I’m certainly not the best and I try to get better. Because Falcon BMS is a simulator, it requires a lot of brain power to stay focused, and sometimes you lose some situational awareness.
You don’t have time to wonder why your bombs didn’t hit their target properly because you have a mig up your arse.
That’s why, to try be a better pilot, I’ve started (and so did my mates) using the ACMI recorder. Combined with Tacview (even just the free version) it’s a very good way to redo your flight and understand what you missed, whether it’s an enemy squadron passing right under you or where your JSAW went after the release.
However, if you have ever used the ACMI recorder during a campaign, you know that recording for more than a few minutes will lead to a VERY VERY long and annoying fixed screen at the end of the mission once you exit the 3D World.
I started complaining (default behavior if you’re French like me) but soon realized that, if I wanted to have a faster compilation time, I would have to do something myself.Creation (you can ignore this)
I’ll explain how I came up with the code and solved some problems, because I think it’s interesting and I spent 2 damn months programming this, so at least let me tell my story
- So first step, what’s going on, why is it so slow ?
If you have a double screen, or just are able to ALT+TAB your game, you’ll notice that before a .vhs exist, a .flt file is created and filled while you’re recording. Falcon will then be converting this .flt file (an “on the fly” recording of the data) to a .vhs file (a more structured file).
You’ll also notice that during the conversion process your CPU isn’t used a lot, only a single thread is doing something and not a its maximum potential (only 80% peaks) - Just look at the source code and fix this ?
Where is the source c… Oh… It’s not publicly accessible.
So I made a bold assumption: The code to compile / convert the .flt to .vhs is so slow and not optimized, that it probably hasn’t been touched for a very long time. - Let’s find and run some old falcon code
Thanks to this website : EDITED Link to Falcon leaked code and this PDF I was able to find 2 things :- Leaked code from Falcon 4 in 1999 and 2002 show that the ACMI compilation is similar
- Falcon 4 and FreeFalcon share a lot of similar code, and exactly the same ACMI compilation system
So I downloaded the FreeFalcon source code Edited link to FF source code and compiled it myself. After a very tedious setup (thank you VMware workstation snapshots) I was able to run the game and make it compile a .flt file.
After comparing the .vhs file created by FreeFalcon and by Falcon BMS 4.33, I found that they were the same!
- Alright, so how did I extract the compiler from FreeFalcon?
I ended up copying the subproject for the ACMI viewer of Falcon, into a modern version of Visual Studio and started cleaning up from here.
Basically, the code for the ACMI compiler in Falcon is inside a file alongside the code for the Falcon ACMI viewer. So I had to remove every bit of code for the ACMI viewer and fix the compile error.
And voila! A working compiler that uses a hardcoded path in a D:/ drive to do tests on. You can actually still see it, it’s in the “old-way” branch on the GitHub - So how are things looking doc’ ?
When I started looking at the code in-depth, I didn’t realize it was C++ right away. The code was 20 years old! (literally, the file was created around October 1997) the first major version was the C++ 98, that came the year after, so the code didn’t have a lot of C++ specific features.
I’m not gonna go into too much details as how the whole compiler works, just know that there are a lot of list and a lot of loops that iterate through those lists. The lists used to be double linked list that are slow to move through. They now are Vector, and I added multithread support to the loops to use all the CPU threads available.
TL; DR: Who knew that using C++13 and multiple threads was way more efficient than C++97 on a single thread eh ? - 3 years later and 2 new releases, why ?
So, if you’re not aware, I released a new version called 2.0 that now is faster than BMS 4.34 at compiling.
A few weeks ago, someone opened a bug on the github tracker asking me to fix an error. Which I did.
This pushed me back into the Falcon Lounge discord and saw that many people were still using this tool. Discussing a bit with people here, BibleClinger user pushed me to look at the way I optimized the code differently.
Rather than just looking at optimizing the speed of the actions, I should look at how to optimize the actions themselves.
A big issue with the code was that a good portion of it was slow due to nested loop (ie, for each iteration of the first loop, you go through the second loop entierly). This is extremely inefficient and is exponentially slow to work on as the size of the ACMI file grows.
The goal of those loop was to search for multiple elements with the same ID, and do actions on them. There are very powerful way to find element in an array in C++ but for that you need to have your array ordered. Turns out that ordering array is extremely fast in c++.
Now that our array is sorted, rather than looking through all of it to find the values, we can use a binary search to find the values and only the values we need.
That means that rather than doing : (size of the first loop * size of the second loop) operations we’re doing (size of the first loop + size of the second loop).
Download and Installation
- Go to the release page of the github and download the latest “acmi-compiler-v*.exe” release available
- Clear the ACMI folder of any .flt file
- Move the .exe to your ACMI folder (by default : C:\Falcon BMS 4.34\User\Acmi)
Usage
- Start the program by double clicking on it. You need to start the program before you start recording an ACMI. I would recommend starting it before launching falcon, minimizing it and not worrying about it after that.
- Let it run in the background while you fly
- Once you’ve finished your flight and recording just go back to the acmi-compiler window and follow the instructions.
Current version: v2.1 - 2020-07-10
Changelog :- Better handling of corrupted .flt files (if BMS crash) and compile them with as little missing data as possible
- Handles ACMI without any “feature” (like a dogfight above the ocean)
- Adds color for warning and errors
version: v2.0 - 2020-07-05
Changelog :- Highly optimized compilation code (10 times faster than BMS)
Status
Ongoing developmentBug / Issue ?
You have an Issue with the program / a bug ?
Open an issue and github and I’ll look at it
https://github.com/loitho/acmi-compiler/issues/newFAQ
Q: Where should I ask questions?
A: Right here in this thread.Q: My mom told me to not download programs from stranger
A: Mine too ! That’s one of the reason the program is completely open-source. You can click here for the github You can build it yourselfQ: Can I help you improving the code ?
A: Yes ! With pleasure, you can open issue on the github or create pull requests.Q: Why is your code so ugly ?
A: Oy ! Every code is beautiful ! If it displeases you that much, you can help me improve itQ: Technically, it’s not a compiler you know that, right ?
A: https://xkcd.com/1475/Have a nice day ! (if you see horrible English mistakes in my post, feel free to PM me correction, English isn’t my mother-tongue and holy hell that’s a long text )
Special thanks to BibleClinger, Johku.
I want to thanks everyone for their kind words as well -
Eager to try it. These compilation times, especially in MP, are not really a problem, but certainly a bit painful. The longest it lasts, the longest debrief is supposed to be, so it really starts to save time on bigger “events”.
And the English is perfect to me - as far as another Frenchman can say
-
amazing.
The compilation times in UOAF events is a major problem. We have stopped doing AARs in Balkans because it takes 45 minutes -2 hours (literally) to compile the ACMI.
-
This is huge. Acmi debriefings are back!
-
we just tried it…works absolutely awesome! Thanks Loitho!
-
VERY good initiative for 4.33 users!
-
Congrats!
-
**Sorry gents!
Believe it or not, ACMI import speed has been a big PITA for us devs as well, so we actually took care of it already for 4.34… and in fact, we backported it to 4.33, together with some other critical fixes that popped up over the last year, and we will release an 4.33 U4 within the next week(!) that will have those improvements.
(…and not to rain on your parade, but importing a 500mb flt will not even take 2min anymore)
I appreciate the effort taken here, but this is basically an unfortunate “crossing the streams” situation.**
-
This post is deleted! -
Making a dev announce an update one week before it’s released usually requires way more than two years of work. That’s where you really shine, loitho
-
Nice effort, very similar to Zipgun’s release a few weeks ago.
https://www.benchmarksims.org/forum/showthread.php?32049-ACMI-Mover
-
Good job loitho, the program works great and I will be using this until the 4.33.4 update, even if it is only for a week it will be well worth it.
Now just program your own version of 4.34 and maybe the Devs will release 4.34 by the end of the year
-
Hopefully the talent displayed here with this utility will go on to improve other areas maybe as a Dev. Thanks again Loitho.
-
I am glad to hear this, I look forward to it with impatience.
-
Nice! Added bonus if it is in a seperate thread so you can view the 2D immediately and maybe frag a scramble if needed.
Because that is one of the major PITAs when doing a persistent campaign, you might just come back from a mission but have to do a scramble immediately. Even waiting two minutes until you can frag your flight and scramble is a lot of time!
-
Sounds like Christmas is coming early
-
Nice! Added bonus if it is in a seperate thread so you can view the 2D immediately and maybe frag a scramble if needed.
Because that is one of the major PITAs when doing a persistent campaign, you might just come back from a mission but have to do a scramble immediately. Even waiting two minutes until you can frag your flight and scramble is a lot of time!
or show it realtime on another monitor or network pc….then we can have epic awacs
lol
-
or show it realtime on another monitor or network pc….then we can have epic awacs
lol
That sounds nice. But does it have all the needed info?
A major issue was the AI positions.Στάλθηκε από το MI 5 μου χρησιμοποιώντας Tapatalk
-
**Sorry gents!
Believe it or not, ACMI import speed has been a big PITA for us devs as well, so we actually took care of it already for 4.34… and in fact, we backported it to 4.33, together with some other critical fixed that popped up over the last year, and we will release an 4.33 U4 within the next week(!) that will have those improvements.
(…and not to rain on your parade, but importing a 500mb flt will not even take 2min anymore)
I appreciate the effort taken here, but this is basically an unfortunate “crossing the streams” situation.**
¯_(ツ)_/¯
In the end, this project was still very interesting to me, and I did it all by myself, so eh I’m not even mad ¯_(ツ)_/¯
However, I will add that my program should be compatible with any Falcon version, starting from FreeFalcon, so you can use it for BMS 4.32 if you still use that
Nice effort, very similar to Zipgun’s release a few weeks ago.
Ah, the moving part was already done. I didn’t see his mod sadly. Mine add the multithreadded compilation time though
Nice! Added bonus if it is in a seperate thread so you can view the 2D immediately and maybe frag a scramble if needed.
That’s actually the case, the program doesn’t compile anything for as long as you don’t ask him to do it. It’s just going to prevent Falcon BMS from compiling the files.
It wasn’t maybe clear in the post but you will directly go from 3D to 2D Without any compilation.
The compilation is after you have finished everything you needed to do on falcon, you can start compiling.
So there is 0 waiting time between the End of the mission in 3D and the 2D debriefing, you can actually fly again and record a second flight, the compiler will compile both files -
I don´t know when those .flt files are created…. hopefully everytime the file reaches the specific filesize… [EDIT]: I confirm it. I used 1Mb (minimun allowed) and it create anew file every minute (in my case… it may vary with other campaigns)
Then… maybe, it will be possible to create a near real time 3D extractor, based on those files, for many purposes: A new AWACS or C2 post could be the easiest to imagine… (I have many others in my weird brain). Still, a picture rate of 60 seconds seems not fast enough at all… We may ask the developers to allow lower ACMI sizes…
Anyway… I see this idea as the worst approach to a 3rd party AWACS/JSTARS software… (but a very simple one)…
In any case: THANKS A LOT one more time, and KEEP IT UP!!!