Jump to content

Capturing DCS UDP Output (Mi-8) / export.lua


Recommended Posts

Posted

I am looking to capture DCS UDP output via an .exe coded in c++. Specifically, I'm interested in capturing Mi-8 Doppler radar output. For now, all I want to do is display that output (in a human readable format). I have further plans for the data later.

 

I was not so familiar with networking and sending data around on PCs, but I've figured out how to send and receive data between different executables over UDP thanks to a nice tutorial: http://gafferongames.com/networking-for-game-programmers/sending-and-receiving-packets/

 

My understanding is DCS is able to output data to UDP.

 

To do this, I think I have to create an export.lua which controls what data is exported? It also sets up ports. I have to place this into my C:\Users\User\Saved Games\DCS\Scripts folder.

 

If I wanted to export Mi-8 Doppler radar output, how complicated is it? Ideally, I would also grab a little other data while I'm at it. Aircraft position in the game world, altimeter, speed etc..

 

There are a lot of links floating around the forums that link to different parts of this, but it's kinda hard to figure out exactly which advice I should be following.

 

References:

 

1. a) Designing a common Export.lua file (2015)

b) based on this thread (2015) -

This contains a list of the current software which use export.lua files.

c) This in turn results in this:

A common Export.lua file for DCS: World (updated 2015)

 

2. catching UDP packets from DCS (2015)

 

 

3. Example of output/input via TCP/UDP (2012)

 

4. Gadroc's post on his export.lua (2010)

 

5. Java TCP/IP resource (2012):

 

To start off, I would just like some kind of export.lua that sends something for my UDP program to hook into.

 

I would like for this post to help other people in similar situations.

 

Thanks,

 

Slazi(a)

Posted (edited)

Update:

Using DCS-BIOS, I can get updates to my program. I just needed to alter BiosConfig.lua:

 

I changed the following:

-- BIOS.protocol_io.UDPSender:create({ port = 7777, host = "192.168.1.177" }),

BIOS.protocol_io.UDPSender:create({ port = 7777}),

 

Now I'm getting around 100 - 160 bytes out per updates. My next step is decoding the messages.

 

The average message appears as "UUUU" and one other character (often a face, a star, the music character).

 

EDIT

 

The first four characters are UUUU. I guess I have to decode the remaining characters.

Edited by Slazi
Posted (edited)

The DCS-BIOS data format is described in the DCS-BIOS developer guide. It also describes how to connect with multicast UDP or TCP, which don't require editing BIOSConfig.lua.

 

As you are writing your program in C++, you may be interested in the ProtocolParser::processChar() method in the Arduino library, which implements the state machine to parse that data stream.

Edited by [FSF]Ian
Posted

My simple brain is having trouble understanding it all, but I'm slowly making a little progress. I may have a couple of more questions for you soon.

Posted

I'll try and work on this again on the weekend if I can. I still don't understand how the data is being encoded and sent.

I can decode the module name, e.g. Mi-8MT, but I haven't figured out how all the strings, ints, floats are wrapped or split up yet.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...