nebriv / VTOLVR-TacviewLogger

A VTOL VR Mod to export data readable by Tacview
https://vtolvr-mods.com
22 stars 9 forks source link

Dedupe ACMI strings #20

Open nebriv opened 3 years ago

nebriv commented 3 years ago

Originally used ACMIStringOld function to diff the old string and new string to identify changed data. This was incredibly expensive. We need to find a cheaper alternative so we can avoid processing and writing unnecessary data.

TytanRock commented 3 years ago

This is primarily for stationary actors, correct? I think assigning every actor an ACMIDataEntry object that can be flagged as having changed position since last ACMIString call would be a relatively easy method to manage this. Then we can even increase performance by merely updating every actor's ACMIDataEntry instead of creating a whole new one.

nebriv commented 3 years ago

@TytanRock

Thats a start yeah. But essentially any unchanged data sent to Tacview once, doesn't need to be sent again. Originally I had a function that compared ACMI strings through reflection, it would great, but it was insanely expensive. I think theres a couple a solutions that should/could be implemented. If the actor is unchanged (hasn't moved/etc) we don't want to collect data for it at all. If the actor has moved, we STILL don't need to send data like IAS/TAS/AOA/AGL if it hasn't changed.

I don't know if its just faster to write the data out regardless. Obviously comparing each would be impactful - but is it cheaper than handling/writing out unnecessary data?

I think assigning the ACMIDataEntry object to the actor would probably be a way smarter way of going about this. It'd definitely require a bit of a rewrite though. (This mod could use a rewrite though, thats for sure...) Thats essentially how the MP mod works. HOWEVER by attaching ourselves directly to the game object - we might lose some flexibility with interacting with mods? Example MP mod deletes game objects, etc. If we work on a layer above that and work from each frame as a point in time we don't have to worry about it existing across frames...