Flt2vhs: A BMS Replay Converter
-
Will test it on the server but seems to be working so far!
Cheers
-
Thanks! Will test this also. processor: E8600 C2D
Cheers Obi1
-
I must add to the hotlist
-
Startup error is fixed. Thanks!
Cheers Obi1
-
Tired of running acmi-compiler or flt-mover in the background to keep BMS from (slowly) converting FLT files to VHS? Wouldn’t it be nice if BMS just… didn’t do that?
I’m happy to announce the latest version of, flt2vhs 0.7, with a major improvement! Instead of running something in the background, flt2vhs ships with a tool (patch-bms-novhs) that disables BMS’s (slow) replay conversion. Just:
- Run the shiny new patch-bms-novhs.exe once, and behold! BMS will proceed directly from 3D to the debrief screen. No background programs required!
- Convert FLT files to VHS at your convenience with convert-all-flts.exe or by dragging and dropping them onto flt2vhs.exe
Grab it here: https://github.com/mrkline/flt2vhs/releases/tag/v0.7
-
Tired of running acmi-compiler or flt-mover in the background to keep BMS from (slowly) converting FLT files to VHS? Wouldn’t it be nice if BMS just… didn’t do that?
I’m happy to announce the latest version of, flt2vhs 0.7, with a major improvement! Instead of running something in the background, flt2vhs ships with a tool (patch-bms-novhs) that disables BMS’s (slow) replay conversion. Just:
- Run the shiny new patch-bms-novhs.exe once, and behold! BMS will proceed directly from 3D to the debrief screen. No background programs required!
- Convert FLT files to VHS at your convenience with convert-all-flts.exe or by dragging and dropping them onto flt2vhs.exe
Grab it here: https://github.com/mrkline/flt2vhs/releases/tag/v0.7
Does it change BMS original files, and if so, what back up is there to be made?
-
Does it change BMS original files, and if so, what back up is there to be made?
It modifies Falcon BMS.exe by replacing the two calls to ACMI_ImportFile(), the FLT -> VHS conversion function, with an instruction that does nothing.
You can revert the changes any time you would like with
patch-bms-novhs –restore
, but backups are never a bad idea. -
It modifies Falcon BMS.exe by replacing the two calls to …
If you accomplished that without source code … just debug symbols and disassembly? (incl. cleaning up the stack properly, zeroing return register, etc and verifying there’s no other side-effects within scope of that conversion function or downstream from the call site) … hmm, I can’t find an emoji for the nod of deep respect that I want to convey.
Nice work!
-
If you accomplished that without source code … just debug symbols and disassembly? (incl. cleaning up the stack properly, zeroing return register, etc and verifying there’s no other side-effects within scope of that conversion function or downstream from the call site) … hmm, I can’t find an emoji for the nod of deep respect that I want to convey.
Nice work!
It’s easier than it sounds (though this doesn’t diminish mrkline’s accomplishments :D). According to the Win x64 ABI, it’s the callee’s job to restore the stack and non-parameter registers. I think the only thing you’d need to worry about is if the caller expects the function to return something or relies on some side effect of the function call. Luckily in this case neither of those apply. So all you need to do is replace the relevant
call
instructions withnop
instructions. -
Wait a minute, so this patching does actually change the exe itself?
Would it work with older versions of BMS? Or could this have unwanted results?Cheers Obi1
-
The change is specific to 4.35U1 and will not work with older versions, which is why the patching tool checks that it’s looking at the right version before doing anything.
-
thanks for this excellent tool, mrkline!! Will it also work in those cases when flt files are left over in the acmi dir if BMS crashes during exit from 3d or during a mission?
All the best,
Uwe
-
Win x64 ABI
Sounds basically like what used to be ‘__fastcall’ calling convention in 32-bit code.
So nice to see how x64 simplified and clarified things, in that regard. I had the displeasure of debugging IA64 code back ca. early 2000s and I still feel mildly traumatized from the experience…
The two of you have given me courage to run BMS under WinDbg, going forward…
[consider] doing a ‘XOR rax,rax’ among the NOPs, just to be safe.
-
version 0.7 crashes again on startup. latest working was 0.5. Probably again CPU related?
Cheers Obi1
-
The two of you have given me courage to run BMS under WinDbg, going forward…
Do it! Abelian and I have had good luck using it to debug crashes that don’t generate dumps. (Most of them seem to be heap corruption related.)
[consider] doing a ‘XOR rax,rax’ among the NOPs, just to be safe.
x64 has no-ops for every occasion!
+---------+---------------------------------------------+------------------------------+ | LENGTH | ASSEMBLY | BYTE SEQUENCE | +---------+---------------------------------------------+------------------------------+ | | | | | 2 bytes | 66 NOP | 66 90H | | | | | | 3 bytes | NOP DWORD ptr [EAX] | 0F 1F 00H | | | | | | 4 bytes | NOP DWORD ptr [EAX + 00H] | 0F 1F 40 00H | | | | | | 5 bytes | NOP DWORD ptr [EAX + EAX*1 + 00H] | 0F 1F 44 00 00H | | | | | | 6 bytes | 66 NOP DWORD ptr [EAX + EAX*1 + 00H] | 66 0F 1F 44 00 00H | | | | | | 7 bytes | NOP DWORD ptr [EAX + 00000000H] | 0F 1F 80 00 00 00 00H | | | | | | 8 bytes | NOP DWORD ptr [EAX + EAX*1 + 00000000H] | 0F 1F 84 00 00 00 00 00H | | | | | | 9 bytes | 66 NOP DWORD ptr [EAX + EAX*1 + 00000000H] | 66 0F 1F 84 00 00 00 00 00H | +---------+---------------------------------------------+------------------------------+
version 0.7 crashes again on startup. latest working was 0.5. Probably again CPU related?
Crap! It’s the same issue as before - I had fixed the bad build config on one machine but not the other. Apologies - I’ll fix the build later today.
-
https://github.com/mrkline/flt2vhs/releases/tag/v0.7 should now contain binaries without those pesky AVX instructions. Apologies again!
-
These are working again, thanks!
-
Announcing a new flt2vhs release, 0.9. Release notes:
- Experimental feature: flt2vhs now merges adjacent FLT files!
Tacview sometimes struggles to merge files, leaving “ghost” planes hanging in the air where one file ended and the next began. flt2vhs now takes a crack at merging files itself.
The merge algorithm is simplistic - find the closest object in the next file that’s the same type as the object in the previous one - but it works well in initial tests. - convert-all-flts now calls flt2vhs on all FLT files at once and exits.
It no longer waits for files BMS is writing - use patch-bms-novhs to disable BMS’s slow conversion. - Reduce VHS output size by changing object IDs to make the callsign table as dense as possible.
- VHS files are now memory-mapped and written in parallel.
Speedup depends heavily on disk performance, but saving is now about 30% faster (several seconds for a 1+ GB replay) on my SSD setup, or about twice as fast as ACMI-Compiler - Performance improvement: Use a faster hash function for all lookups.
Download link: https://github.com/mrkline/flt2vhs/releases/download/v0.9/flt2vhs-0.9.7z
- Experimental feature: flt2vhs now merges adjacent FLT files!
-
Tired of staring at a black screen for minutes while BMS writes out your flight recording after a mission? I’m happy to announce a beta of flt2vhs, a replay converter that does the job in seconds.
Those familiar with Loitho’s ACMI Compiler will wonder how this tool differs:
Nothing to run in the background: Instead of running a background program to steal FLT files from BMS, flt2vhs ships with a tool that just disables BMS’s slow conversion.
It merges flight files: BMS chunks recordings into multiple files if they were larger than 1 GB, and Tacview (as of 1.8.6) sometimes has trouble merging these, leaving “ghost” planes hanging in the air where one file ended and the next began. flt2vhs can merge consecutive FLT files into a single VHS. This feature is still in the experimental stage but seems to work well so far, even in 20+ player events with hundreds of units moving around.
It’s even faster: about twice as fast according to rough benchmarks. By organizing data more efficiently and handling files directly through your operating system’s page cache, flt2vhs minimizes the time you wait to start your debrief.
Just:
- Extract the 7zip archive into BMS/User/Acmi.
- Run patch-bms-novhs.exe to disable BMS’s (slow) FLT to VHS conversion. You only need to do this once.
- Record BMS flights normally with the AVTR switch in the cockpit, or by running BMS with -acmi. BMS should no longer pause to convert recordings when you exit 3D.
- Run convert-all-flts.exe to convert all FLT files to VHS, with names based on the times they were created. Or drag a FLT file file onto flt2vhs.exe to convert one at a time.
Special thanks to Loitho for making this project possible with the power of open source! Their code was instrumental to my understanding of both file formats, as were their many kind answers to my many silly questions. Thanks also to Streak for testing out an earlier build.
Download here: https://github.com/mrkline/flt2vhs/releases/latest
Project and README here: https://github.com/mrkline/flt2vhs#readmeFeel free to post any issues you have here, or create a ticket on the project: https://github.com/mrkline/flt2vhs/issues/new
Should be intergrated into the sim if possible. Great Stuff solving an ancient problem.
-
I’m not sure if I’m reapplying it wrongly, or if it doesn’t work anymore. EXE doesn’t get a new modification date either.