Vyrtuoz / Tacview

The Universal Flight Analysis Tool
http://tacview.net
GNU General Public License v3.0
58 stars 18 forks source link

[Bug] ACMI 1.8.2 script when live streaming data doesn't give lat and long offsets #5

Closed Aterfax closed 4 years ago

Aterfax commented 4 years ago

Span up a server, latest tacview script for DCS does not appear to be giving the lat and long reference offsets in the initial connection data.

What I got after handshaking:

FileType=text/acmi/tacview
FileVersion=2.2
0,ReferenceTime=2018-05-30T10:30:00Z
0,RecordingTime=2020-06-06T17:28:04.629Z
0,Title=Bankler's Case 1 Recovery Trainer_v05-20
0,DataRecorder=DCS2ACMI 1.8.2
0,DataSource=DCS 2.5.6.50321
0,Author=defaultNickname
0,Comments=Bankler's CASE 1 Recovery Trainer (v 5.2.0)\----------------------------------------------\Shameless plug: Check out 4 v 4 multiplayer air combat game "SKY KNIGHTS" on Steam! Made by me! :) https://store.steampowered.com/app/595430/Sky_Knights/ \Cheers! //Bankler\----------------------------------------------\\Use F10 radio menu to toggle between "Break Mode" and "Pattern Mode"\, as well as turning LSO comms on and off. There is also a function in that menu to re-enable the boat's TACAN and ICLS in case it goes down.\\Break Mode: Start each pass by overflying the trailing ship and go into the break\, flying the full pattern.\\Pattern Mode: After each pass\, fly straight at least 0.5 nm along BRC\, then turn downwind... 

I was expecting them to be present as said here:

https://www.tacview.net/documentation/realtime/en/ e.g.

0,ReferenceTime=2017-05-01T05:27:00Z␊
0,RecordingTime=2017-03-09T16:17:49Z␊
0,Title=test simple aircraft␊
0,DataRecorder=DCS2ACMI 1.6.0␊
0,DataSource=DCS 1.5.6.1938␊
0,Author=AuthorName␊
0,ReferenceLongitude=37␊
0,ReferenceLatitude=37␊
Aterfax commented 4 years ago

Incidentally, the offset appears to be 36 for Baltics.

And the below for Persian Gulf. case 0: msg.LatLongAlt.Long = parseFloat(tokens[i])+ 49; break; case 1: msg.LatLongAlt.Lat = parseFloat(tokens[i]) + 19; break;

RaiaSoftwareInc commented 4 years ago

Hi Aterfax,

This could happen if there are no exportable objects, not even Bullseye, in the entire map.

It could also happen if reference longitude / latitude is actually zero.

In any case, the data in the .acmi file should still be correct even if there is no reference longitude or latitude in the .acmi file for some reason. In that case each timestamp in the .acmi file will simply contain actual longitude and latitude.

If none of this helps, can you please share your .miz file and dcs.log and I will investigate further.

Aterfax commented 4 years ago

Interesting, I was using Bankler's Case 1 Recovery Trainer_v05-20 so I can confirm that there are plenty of objects present though I did not check for a bulleye.

Is tacview computing the offsets from the bullseye?

Just for clarity - this isn't an ACMI file, this is being pulled from tacview live from the server. When there are no reference lat or long it was providing truncate lat long data from the objects e.g.

Instead of 25.55 it would give 5.55 (but with one of the offsets I mentioned above.)

RaiaSoftwareInc commented 4 years ago

Reference latitude and longitude is 5 degrees to the west and 5 degrees south of the calculated center point of all the objects.

I have not yet been able to reproduce the issue. Could you send me a dcs.log file?

Aterfax commented 4 years ago

I'll see about getting a log / debugging this weekend.

Aterfax commented 4 years ago

I got a little busy .... but here is some further info for debugging - the Bankler training mission is running - https://status.slugsoc.co.uk/gcimap/

The above link will show a live track from the server (search for SLUGS in DCS server browser or direct connect 143.167.132.11)

The issue seems to be that for whatever reason tacview is not supplying the offset when I connect (from node red) and I do not know the methodology to compute the offset. (You mention the offset being a computed centre point - is this from the first message sent back?)

In terms of the flow - I open the socket and get the following back -

Msg 1:

XtraLib.Stream.0Tacview.RealTimeTelemetry.0PILOT_971833

Msg:2

FileType=text/acmi/tacviewFileVersion=2.20,ReferenceTime=2018-05-30T10:30:00Z0,RecordingTime=2020-10-11T15:56:44.679Z0,Title=Bankler's Case 1 Recovery Trainer_v06-10_LegacyCarrier0,DataRecorder=DCS2ACMI 1.8.4.2000,DataSource=DCS 2.5.6.559600,Author=PILOT_9718330,Comments=Bankler's CASE 1 Recovery Trainer (v 6.1.0) - Legacy Carrier Version\----------------------------------------------\Shameless plug: Check out 4 v 4 multiplayer air combat game "SKY KNIGHTS" on Steam! Made by me! :) https://store.steampowered.com/app/595430/Sky_Knights/ \Cheers! //Bankler\----------------------------------------------\\Use F10 radio menu to toggle between "Break Mode" and "Pattern Mode"\, as well as turning LSO comms on and off. There is also a function in that menu to re-enable the boat's TACAN and ICLS in case it goes down.\\Break Mode: Start each pass by overflying the trailing ship and go into the break\, flying the full pattern.\\Pattern Mode: After each pass\, fly straight at lea...

It was this message I was expecting to have a reference lat and reference long to be included but it is missing.

Msg 3

#3661.68102,T=4.7516725|4.9070641||||4.9|543601.75|-329505.19|359.7,Type=Sea+Watercraft+AircraftCarrier,Name=Stennis,Pilot=CVN,Group=CVN,Color=Blue,Coalition=Enemies,Country=us103,T=4.7518971|4.9074747|20.89||-1.6|0.8|543616.25|-329457.84|355.6,Type=Air+FixedWing,Name=FA-18C_hornet,Pilot=Deathstar 1-1 | Aterfax,Group=Colt21 (Catapult),Color=Blue,Coalition=Enemies,Country=us202,T=4.7424587|4.8325075||||4.9|543588.81|-337860.5|359.7,Type=Sea+Watercraft+Warship,Name=PERRY,Pilot=Oliver Hazzard Perry,Group=CVN,Color=Blue,Coalition=Enemies,Country=us302,T=4.705129|4.8933392||||4.9|539875.69|-331380.72|359.7,Type=Sea+Watercraft+Warship,Name=TICONDEROG,Group=CVN,Color=Blue,Coalition=Enemies,Country=us402,T=4.7959278|4.8873633||||4.9|547476|-331359.63|359.7,Type=Sea+Watercraft+Warship,Name=TICONDEROG,Group=CVN,Color=Blue,Coalition=Enemies,Country=us502,T=4.752885|4.9180589||||4.9|543591.31|-328274.13|359.6,Type=Sea+Watercraft+Warship,Name=speedboat,Pilot=PatternModeBoat,Group=CVN,Color=Bl...

I think the issue is due to some form of truncation in that second message as when I look at the recorded server ACMI file:

FileType=text/acmi/tacview
FileVersion=2.2
0,ReferenceTime=2018-05-30T10:30:00Z
0,RecordingTime=2020-10-11T14:55:43.013Z
0,Title=Bankler's Case 1 Recovery Trainer_v06-10_LegacyCarrier
0,DataRecorder=DCS2ACMI 1.8.4.200
0,DataSource=DCS 2.5.6.55960
0,Author=PILOT_971833
0,Comments=Bankler's CASE 1 Recovery Trainer (v 6.1.0) - Legacy Carrier Version\
----------------------------------------------\
Shameless plug: Check out 4 v 4 multiplayer air combat game "SKY KNIGHTS" on Steam! Made by me! :) https://store.steampowered.com/app/595430/Sky_Knights/ \
Cheers! //Bankler\
----------------------------------------------\
\
Use F10 radio menu to toggle between "Break Mode" and "Pattern Mode"\, as well as turning LSO comms on and off. There is also a function in that menu to re-enable the boat's TACAN and ICLS in case it goes down.\
\
Break Mode: Start each pass by overflying the trailing ship and go into the break\, flying the full pattern.\
\
Pattern Mode: After each pass\, fly straight at least 0.5 nm along BRC\, then turn downwind straight into the pattern.\
\
CVN-74 John C. Stennis - TCN 74X\, Ch 2 (264.00AM)\
BRC 353 (MAG HDG)\
ICLS: Channel 1\
\
Tanker overhead at Angels 8. TCN 37X. Ch 19 (253.00AM)\
Divert airfield Batumi. TCN 16X (430.00AM)\
\
This mission is intended for practicing the CASE 1 Recovery break and pattern.\
\
Approach the carrier from the south (WP 1) and perform a CASE 1 Recovery. You'll get feedback during the landing pattern\, as well as a summary after the trap.\
\
Score is based on how close you are to perfect altitudes in the different parts of the pattern\, as well as staying on speed (i.e around 8.1 degrees AOA for F/A-18C or 15 units for F-14B) during the downwind and the final.\
\
You'll get some score deduction if you stray too far south in the downwind\, before turning final. You'll get extra score depending on which wire you catch.\
\
Max score is 75 points.\
\
- Multiplayer is supported!\
- After a pass (trap or bolter)\, you can return to the Oliver Hazzard Perry trailing ship to restart the break entry. Fly straight aft from the carrier to find it. Don't go into the pattern directly after a bolter or takeoff. Instead always start a new break.\
- The mission keeps a list of all your passes and the total score\, so you can compete with friends.\
- In SP (and for the host in MP)\, the cockpit is automatically setup. However\, you'll need to lower the hook and set radar altimeter settings manually\, as you require.\
- The carrier will turn south (BRC 173) after around 4 hours.\
\
Jabbers’ excellent video covering the basics: https://www.youtube.com/watch?v=lm-M3VUy-_I\
Lex's more in-depth video explaining the pattern: https://youtu.be/LvGQS-3AzMc\
\
Fly by the numbers:\
\
- Break entry (hook down\, 350-400 kts\, 800 ft)\, fly just to the right of the carrier.\
- Break 1:st half (Airbrake as needed\, level 800 ft turn\, G = speed/100)\
- Break 2:nd half (800 ft\, retract airbrake\, extend gear\, full flaps)\
- Downwind (work your way down to 600 ft\, trim for on-speed)\
- Abeam (600 ft\, 1.2nm from carrier\, start ~25-30 degree final turn now\, stay on-speed)\
- At the "90" (450-500 ft\, on-speed)\
- Crossing the wake (370 ft\, on-speed)\
- Groove (intercept 3.5 degree glideslope at around 300 ft\, on-speed\, wings level\, on centerline\, fly the ball\, groove time should be 15-18 seconds)\
- Trap (Aim for 3-wire\, full power on touchdown until you confirm that you're no longer moving\, then power idle)\
- Stay still until the summary is displayed.\
\
Created by Hampus Bankler\
hampus.bankler@gmail.com\
http://www.discord.gg/skyknights\
\
If this mission helped you improving your skills around the boat\, please let me know! I'd love to hear from you! :)\
\
Voice acting by Lex.\
\
Many thanks to FlightControl and FunkyFranky (Moose crew)\, Lex\, Gregory Brett\, Matt Geders and everybody who has helped out with testing!
0,ReferenceLongitude=36
0,ReferenceLatitude=37

For now have put in an offset below which isn't quite right (but is close so I assume this is due to the carrier movement and a slight lag in game position to tacview/ the map.)

 case 0:  msg.LatLongAlt.Long = parseFloat(tokens[i]) + 36;  break;
 case 1:  msg.LatLongAlt.Lat = parseFloat(tokens[i])+ 37;  break;

An snapshot comparison here:

image

Aterfax commented 4 years ago

Just checked on a mission with no comment - the reference lat and long are passed on when the comment is gone / not very long.

I do not think node-red is truncating this during the buffer to string conversion but I will investigate further if I get the time.

Aterfax commented 4 years ago

Having now had some time to look into the issue - Node-Red is indeed not truncating the buffer, however the front end IDE is truncating the string converted output display (making it look like it is) due to the debug node having this set as a hard limit in the nodered settings.js via:

// The maximum length, in characters, of any message sent to the debug sidebar tab
    debugMaxLength: 1000,

So in short - no-one's code was doing anything weird - node-red was simply truncating the displayed output (not the actual buffer.)

I will close this issue as there's nothing wrong with Tacview.

I appreciate the time you've spent both on the ticket and the software - Tacview is a cracking product, well done!

I will just add some keywords in case anyone searches and has a similar problem - node red, truncating, buffer, string, debug, 1000 characters, max, max length, maximum, character limit.