Creating Helios profiles from scratch

using the Generic Interface

Part I


Miguel Ángel Carrillo (Capt Zeen) - Personal site www.miguelangelcarrillo.com
- Lead Artist at Mansion Games
- Art and Game Engine Teacher Centro docente EDIB
- Capt Zeen site www.captzeen.com

INTRODUCTION


        In 2013, I discover by chance the Helios tool, trying to setup a second monitor to check my Autopilots blue lights on the KA50, tired of crashing every time they misteriously disconnect. From that moment i discoverd a world of posibilities and i don't stoped to create profiles for diferent airplanes in DCS, learning in every steps new ways to improve the quality of them.
I must admit that it has been an enriching experience, and I spend more time working on Helios profiles than flying with the simulator

        During this time, many people have asked me how profiles could be made and what techniques I used to do it.
Well, the time has come for me to share with you all, how is the complete process of creating a profile, and maybe so, you can prepare your own profiles very soon.


ABOUT THIS COURSE


        First of all I have to say that the process of creating a profile, is arduous and complex, is not done in two days!, and requires a lot of attention and will. You don't really need to be programmers to be able to make the profile, but a solid base will help us a lot

        In the course duration, I will be developing the profile for the F-5E, as an example, and you will see all the processes I use to capture the simulator data, and present it in Helios, as well as how I develop the entire artistic part of the profile.
Of course you must adapt these techniques to the profile that you want develop.

        I divided the course in two parts:

        PART I - As an introduction to the process, it shows the basic knowledge you need to start working with Helios and other tools. You will lern how to extract data from DCS, and prepare the export file to comunicate with Helios. Then i will show you how to create your first instruments and switches, full working with DCS.

        PART II - Continuing with the development of the F-5E profile, i am going to show you, how to create more complex instruments and controls, and other techniques, so you can mastering the process of creating a complete Helios profile by your own.

        Accompanying these documents I am going to prepare a videotutorial series where you can follow the process while i am creating the profile. You can find this videos in my youtube channel when they are ready.


PART I Sumary


  • Tools, Programs and templates we need

    A introduction to the Tools and templates we need to create the profiles.
  • DCS export basic concepts

    How DCS export data to other applications like Helios
  • The Generic Interface
    What is the Generic Interface, and his properties.

  • Let's work! First steps
    We are ready to start, Let's do it!

  • Getting the airplane data
    Techniques to get the data from the DCS airplane.

  • Sending and receiving data from DCS and Helios
    How to communicate between the two programs.

  • Creating our first instrument
    Preparing the art and the beheviour of our first AOA instrument.

  • Creating our first Controls
    Knob and switches in action.

  • TOOLS AND PROGRAMS WE NEED




    Here you got a list of the tools and programs we can need to create our own profiles


  • FREE TOOLS:

    Helios Virtual Cockpit         Latest release - Here we made and run the profiles!
    Notepad++         https://notepad-plus-plus.org/ - A text editor
    IrfanView         https://www.irfanview.com/ - A good image viewer compatible with DDS files
    WitchCraft         https://github.com/jboecker/dcs-witchcraft - Tool to control DCS arguments in real time

  • PROGRAMS:

    DCS World         
    DCS ModelViewer         
    Photoshop or any other paint program (DDS format compatible)         
    Intel® Texture Works Plugin for Photoshop         https://software.intel.com/en-us/articles/intel-texture-works-plugin
  • USEFULL ALREADY DONE TEMPLATES




    Here you got a list of the scripts and templates I prepared to make the process faster


  • SCRIPTS:


    Helios_NewAirplane.lua
    - This is a template of the Mod script you need to create. With it, everything is more easy!.

  • PROFILE:


    Generic profile
    - This profile contains all the switches, lamps, buttons, axis, etc... already prepared for copy to your profile !
  • DCS export basic concepts



  • DCS World uses a special script file called export.lua to comunicate with external applications, like Helios, SimpleRadio, TacView, etc.,.

  • This script is located in savedgames/DCS World/scripts, and is called by DCS everytime we start a mision.

  • Helios use the properties of this script to communicate with DCS

  • When you create a Helios profile, or install a existing one, and you press DCS Setup button in the editor, Helios creates the needed drivers to implement the airplane code to export and import the relevant data.

  • At the same time, Helios insert a line in the export.lua to call heliosexport16.lua

  • This file establish the communication between DCS and the driver created by Helios for that airplane

  • But, only airplanes with existing Helios interface can be created using this method. And here is where the big problem exist, because not all the airplanes got a interface ready in Helios, at the moment.

  • Well, at this point... what is a Helios interface?



  • WHAT HELIOS INTERFACES ARE


  • Interfaces are part of the internal code of Helios.

  • Each interface contains all definitions of the values for the instruments, switches, lamps, etc, and the needed functions to export and import all this data from an specific DCS airplane.

  • Other Interfaces can control the definitions of other devices, like the keyboard, Warthog, Monitor setup, etc. Or even Falcon BMS!

  • To create a Helios profile for an airplane, you need the interface prepared for that specific Airplane.

  • When you "DCS Setup" in the editor, Helios take all the info of this interface and create a Driver, ready for interchange data across the export.lua about the expecific airplane you choose

  • Right now, we have only several available Helios interfaces: A10C, KA50, FC, F18C, AV8B, MIG21 and M2000. Other interfaces can be created in the future.

  • But create a interface for an airplane is a complex task, and need to be compiled and published with Helios, so not everyone can do that

  • Let's assume you want to create a profile for the F-5E, but the interface for that DCS airplane do not exist. Unless you are a good programmer and want to create a new interface, looks like you need to wait to someone create a F-5E interface, compile it and publish it in a new Helios version.

  • Well, there is another posibility... to use the DCS Generic Interface!



  • WHAT IS THE DCS GENERIC INTERFACE


  • The DCS Generic Interface, in other hand, is a special interface, I implemented in Helios some time ago, with the idea to have a multipurpose interface. It's not prepared for a specific airplane, so... with the correct conversion, can be used for any airplane you want!

  • The Generic Interface is a collection of near 2000 definitions, contains a lot of networkvalues, switches, lamps, axis, etc. And all this values can be conected with your specific airplane using the apropiate Helios mod export file, creating the conversion between them.

  • This is the list of actual definitions in the DCS Generic Interface. The list can be extended in the future if needed


  • Capt Zeen Module (version 1)




  • As a convenient alternative to create profiles for airplanes that don't have an interface, we are going to use the Generic interface, and a export mod, helios compatible, to export the data. (Thanks to Crivi and Derammo that help me on the new system!)

  • Now our code act as a bridge between the Helios DCS Generic Interface (or other interface, too) and our airplane profile

  • Our job is create this export mod, using the technics we are going to learn in this course.

  • This export mod is a lua script and don’t need to be compiled to work, so you can make all the changes you want, save it, and run again to test it.

  • As every airplane got his own export mod, we can create as many airplanes profiles we want

  • When we finish our job, the code of the export mod, is going to be embebed in the profile, so the new Helios 1.6 can manage it and prepare all the export files for the final users, in a easy process





  • FIRST STEPS I

    Getting the DCS internal airplane name

    OK, Let's works...the first you need to know the internal name of the airplane in DCS, so follow the next steps:

    1- Run DCS and enter in a mission flying the airplane you need the internal name. In that example the F-5E

    2- Press pause and then open SavedGames/DCS/Logs/dcs.log with a text editor. On the final lines you can find the Helios export message about the airplane flying in that moment:



    In this case the name is "F-5E-3"



    FIRST STEPS II

    Preparing the export mod file


    Time to create the new airplane export file in the extructure of helios export mods files. You can download a template script file that help you on this task, if you didn't do it before Helios_NewAirplane.lua


    - Download and copy Helios_NewAirplane.lua file in SavedGames/DCS/Scripts/Helios/mods

    - Rename it using the name of your airplane, for example "Helios_F5E.lua"

    - Asign the internal airplane name to the variable in the file, in our example "F-5E-3"

    - Replace all the sentences "Helios_NewAirplane" with the name of your airplane, for example "Helios_F5E". Important, do not use "-" here

    - Save the export mod file. Here you can see how it looks after the changes

    - Now, open SavedGames/DCS/Scripts/Helios/HeliosExport16.lua and add the new airplane internal name and export file name to the helios_module_names array, so... add a "," in the last line of the array definitions and add the new airplane, in our example ["F-5E-3"] = "Helios_F5E"

    - Save HeliosExport16.lua. Here you can see how it looks after the changes


    IMPORTANT NOTICE - If you setup a downloaded Helios profile, HeliosExport16.lua can be overwriten so... probably you'll need to add the line again for your airplane


    - Thats all! We are ready to create our profile so, Let's go to the Helios Profile Editor...

    FIRST STEPS III

    Preparing your Helios profile

    Time to go to the Helios Profile Editor:

    1- Open the Helios Profile Editor and, in a new profile, add the DCS Generic interface using upper menu Profile/add Interface option

    2- In the DCS Generic panel, change the module format to "Capt Zeen Module (version1) for Generic interface"

    3- Select the DCS Vehicle from the list

    4- DO NOT FILL the module file for the moment

    5- Save your profile



    IMPORTANT NOTICE - When you fill the Module file, Helios take the file and embebed it in the profile, so is ready to other users to setup their system with your export module. In our case, the module is not still finished, and if we insert it right now, a empty version of the module will be inserted on the profile. Thas not bad at the moment, but if you setup this profile by error, the embebed module is going to replace your working version on DCS/scripts/Helios/mods and you can lost your work !!
    As a good habit, make backup copies of your working module and your profile so often, just in case!


    - Thats all! We are ready to start our profile so, Let's Identify the data for some of the cockpit instruments, using mainpanel_init.lua or the modelviewer tool


    GETTING THE DATA FROM THE COCKPIT




    Before we can start, we need to find the cockpit data from the airplane we want to replicate in Helios. There are three main ways to get the data:


    1 - Usually you can get the data from the DCS cockpit scripts: mainpanel_init.lua, devices.lua, and clickabledata.lua, located in DCS World/Mods/aircraft/the name of the airplane/Cockpit/Scripts
    Sometimes another files can be necesary to get all the data, every airplane is diferent so, searching can be a surprise!



    2 - The DCS Model Viewer is another tool that we can use to get values and behaviours of the diferent instruments and switches.



    3 - Whith more difficult switches and buttons we can use WitchCraft, a tool that permits us to access the DCS switches in real time, and using direct lua script, send and receive data from DCS.

    WHAT WE LOOKING FOR




  • One direction data (Input values): Instruments, Lamps, Indicators...

  • This is only input data. DCS send the value of a instrument or lamp for example, but don't need a return data. Usually you can find this data in mainpanel_init.lua


    For those values we need to find the argument number ID.
    And sometimes, we need to know the scale values for those in case they use it.




  • Two direction data (Input and Output values): Switches, buttons, levers, potentiometers, rotators, etc.

  • This is a two way data. DCS send the value of a switch, but is ready to listen output data in case we change the state of the switch. Usually you can find this data in clickabledata.lua


    For those we need the switch type, argument ID, Device ID, the Command Button Number and the values to send back to DCS





    ONE DIRECTION DATA EXAMPLE



    Let's extract the data for the AOA instrument on the F-5E         

    Looking at DCS/mods/aircfraft/F-5E/cockpit/scripts/mainpanel_init.lua


    The AOA_Units uses the argument ID 7, and the AOA_poweroff_flag uses the argument ID 704

    This is one of the easy examples, they don't need scale values as other instruments have.
    We can take a look to more complicated ones later, when you feel more confortable getting data.





    TWO DIRECTION DATA EXAMPLE

    Let's extract the data for the external lights switches on the F-5E

    Looking at DCS/mods/aircfraft/F-5E/cockpit/scripts/clickabledata.lua :


    we got two axis and two switches, with the IDs: 227, 228, 229 and 353 The device numbers and the button command numbers are defined as variables, so we need to look for the numbers...

    Taking a look to the devices.lua :


    The device EXTLIGHTS_SYSTEM is the number 11

    Taking a look to the command_defs.lua :


    The buttons numbers are 3001, 3002, 3003, and 3004. We got all the data we need ! Let's work with it.


    SENDING INPUT DATA FROM DCS TO HELIOS FUNCTIONS



  • Once we got the data we can start to fill the information on our airplane export file using the two main functions for that: HighImportance() and LowImportance()




  • In the HighImportance function we can put everything we need with a fast refresh, like instruments and lamps

  • The LowImportance function is used to send switches, buttons, etc, where a lower refresh rate its no so important

  • To send the data we use the Helios_Udp.Send function with the correct arguments: the Generic interface target ID, the format of the data, and the argument ID from the airplane we want to send.

  • FILLING THE INPUT DATA IN THE EXPORT MOD FILE


    So.. let's fill the functions with the correct lines, inside each function, in the export mod file we created before

    Here you got how it looks in the code:


    - Note how i placed the instruments data in the HigImportance function, and the switch and knob data in the LowImportance function

    - I used the Generic interface definition table, to assign the correct IDs values to the Networkvalues (starting at 1), switches (starting at 3001) and axis (starting at 6001)

    - For your convenience, you got that table at the begining of the export mod file.


    SENDING OUTPUT DATA FROM HELIOS TO DCS FUNCTIONS



  • To send the switches and buttons actions (helios outputs) from Helios to DCS we use the ProcessInput() function

  • This function uses the ExportArguments array to get the data, and here is where we are going to make our conversion between the DCS airplane output data and the Generic interface



  • This is the format of the conversion: we need the device and the button number of the Generic Interface we want to use and the ones of the DCS airplane




  • *The final value is multiplied by this number before send it to DCS. If the multiplier is 100 or bigger then a special conversion operation is executed instead. The defaul value is 1, so no modifications to the value we send.


  • FILLING THE OUTPUT DATA IN THE EXPORT MOD FILE



    Now.. let's fill the ExportArguments array with the conversion between the Generic interface and our airplane, in the export mod file we created before

    Here you got how it looks in the code:



    - I used the Generic interface definition table, to assign the correct Device values and button numbers for each switch (device 2) and knob axis (device 4).

    - For your convenience, you got that table at the begining of the export mod file.

    - The final multiplier stays at 1, we don't need to make any value conversion in thoses cases.


    CREATING OUR FIRST INSTRUMENT I


  • OK, we got our first code already implemented, now lets work on the visuals.

  • Getting the Instrument textures:

  • - Find the DCS Cockpit textures archive, in our example: C:\Program Files\Eagle Dynamics\DCS World\Mods\aircraft\F-5E\Cockpit\Textures

    - Decompress the texture files in a folder for an easy use

    - Using Irfant viewer, look for the instruments images, in our example is F5E-CPT-INSTR-02.dds

    - Using Photoshop or a paint program (DDS format compatible), cut the instruments images and save it in .png format

    - In this case i make a hole for the Off Flag over the instrument plate

    - We are going to need a empty space image too. You can get it from any of muy published profiles, search for empty_space.png and copy it in your images folder


    CREATING OUR FIRST INSTRUMENT II




  • Working in Helios Profile editor:

  • - Open your previos created Profile.

    - As this instrument has two elements, we can create a panel to include those elements and be organized.

    - Drop a Generic Bezel to your canvas and uncheck the border box. You can rename the panel as AOA instrument.

    - Double click on top of the panel to enter inside it

    - Now, drop a Custon Gauge to your panel and set the image background. You can rename the gauge as AOA

    - Adjust the size, position and max and min values for the needle like in the following image

    - As you can notice this instrument moves counter clockwise, is not usual, but some instruments do. That the reason I reversed the initial and final positions of the needle and the values (Min=1 and Max=0).

    - In the input section of the gauge, drag "NetworkValue_1_changed" to "set value", so the gauge knows what DCS value to use

    - Save the profile

    - Run DCS, Helios Control Center and... Test it ! The needle need to move like in the cockpit instrument.

    CREATING OUR FIRST INSTRUMENT III




  • Let's work on the off_flag:

  • - Drop another custom gauge inside the AOA instrument panel, on top of the AOA gauge

    - Now, set the needle image and choose the flag image we saved before. As Background image, use the empty_space.png. You can rename the Gauge as off_flag

    - Adjust the size, position and max and min values for the needle like in the following image

    - As you can notice this instrument moves counter clockwise, is not usual, but some instruments do. That the reason I reversed the initial and final positions of the flag and the values (Min=1 and Max=0).

    - Notice how i changed the pivot point position to be on the bottom right corner, so the flag can move better.

    - In the input section of the gauge, drag "NetworkValue_2_changed" to "set value", so the gauge knows what DCS value to use

    - you can change the order of the gauges in the panel using the "move up" and "move down" icons. Move the off_flag gauge down, so only the flag is visible by the hole

    - Save the profile

    - Run DCS, Helios Control Center and... Test it ! The flag need to move like in the cockpit instrument.

    - Nice! you got your first custom instrument!

    CREATING OUR FIRST CONTROLS




  • Time to work on the knobs and switches of the F-5E external lights:

  • - For the moment lets use the default controls we got in Helios, we can prepare the art later.

    - We need two potentiometers for the knobs, and two toggle switches for the switches

    - looks for them in the toolbox and drop them to the main monitor (not inside the AOA panel)

    - In the input section of each control, drag the correspoding binding to "set value", in our case "Axis_A_1 changed" to the first potentiometer and "Axis_A_2 changed" to the second potentiometer

    - for the switches we use "TSwitch_1 changed" to the first one and "TSwitch_2 changed" for the second switch. This time we drag over "set position"

    - Now In the Ouput section of the potentiometers, drag the correspoding binding to "value changed", in our case "Set Axis_A_1" to the first potentiometer and "Set Axis_A_2" to the second potentiometer

    - For the switches we use "Set TSwitch_1" to the first one and "Set TSwitch_2" for the second switch. This time we drag over "position changed"

    - Save the profile

    - Well, everyting is ready to test, run DCS, Helios Control Center and... Test it ! the knobs and switches need to move like in the cockpit.

    CONGRATULATIONS




  • If you reach this page and everything work correct, Congatulations! you just created a custom input/output profile!

  • - Yes, i know there is too much work still waiting for us till we finish the profile, but i tell you from the beginning, this is a hard job and time consuming.

    - But you can work step by step, work on the main dashboard panel first, and then move to the other panels you want to impement in your profile.

    - Take your time, don't stress your self. Make the easy things first, then the more complicated ones

    - I am going to continue publishing videos showing how i work on the F-5E profile, from the begining till the end, so you can see how i complete the more complicated elements

    - Of course, you can find me on my discord channel, so in case you don't know how to create a control or instrument, i can help you there.





    Thanks for watching!

    Miguel Ángel Carrillo aka Capt Zeen