Skip to content
mayyxengPublic

About

A Moza Flight Stick FFB mod for Nuclear Option

Topics

Resources

Stars

6 stars

Watchers

1 watching

Forks

Repository files navigation

Zōrduzd: Nuclear Option Moza FFB Support

Zorduzd is a tiny mod to enable force feedback on Moza flight sticks in Nuclear Option.

Table of Contents

How to Use

Using Nuclear Option Mod Manager (NOMM)

If you have NOMM, then the setup process is quite easy, simply look for zorduzd in NOMM and install it.

zorduzd is on NOMM

This will install a bunch of files under the plugin directory managed by NOMM, e.g., it could be:

C:\Program Files (x86)\Steam\steamapps\common\Nuclear Option\BepInEx\plugins\Zorduzd

(of course, you might have a different path based on the game install location.) In this directory you shall find the following content:

 Zorduzd/
    ├── DCS World/bin/
    │   ├── DCS.exe
    │   └── zorduzd.cfg      # might not exist
    ├── zorduzd.dll
    ├── zorduzd.deps.json
    └── zorduzd.pdb

⚠️ IMPORTANT: You need to run DCS.exe at the same time the game is running to enable FFB. Basically, this program tries to make Moza Cockpit think that DCS is running. This way, by sending good telemetry data to Moza Cockpit, we can make it apply force feedback to your flight stick.

Configuring Moza Cockpit

If you have DCS installed on your system, and you've configured Moza Cockpit with it, then you are good to go. Otherwise, run DCS.exe from the mod (under Zorduzd\DCS World\bin\DCS.exe). This should open up an application that looks like this:

DCS UI

Here there are 4 status indicators:

Indicator Description Requires Manual Work
server whether the app was able to create a TCP server to listen on Moza Cockpit No
moza cockpit whether Moza Cockpit successfully connected to the app Yes, see configuring moza cockpit
nuclear option whether the game is running and connected to the app No
DCS whether you have a valid DCS setup with Moza Cockpit Yes, see configuring moza cockpit

If you're here, then DCS is probably indicated as offline, and a setup DCS button must be clickable. Click on it! This will create a DCS folder under %USERPROFILE%\Saved Games, e.g., that's C:\Users\John Doe\Saved Games. Now, open up Moza Cockpit and select DCS from the left panel:

DCS UI

The Game Installation Path must point to the DCS World directory installed by the mod, e.g., for me, that's

C:\Program Files (x86)\Steam\steamapps\common\Nuclear Option\BepInEx\plugins\Zorduzd\DCS World

The User Data Path must point to the directory created by the previous step, i.e., when you clicked on setup DCS in the fake DCS app. The Telemetry Port Number must also match the port number you saw earlier in the fake DCS app.

With all done, you should reopen DCS.exe and this time see:

DCS UI good state

Now if you run the game, nuclear option must also become online and you should get some force feedback.

To better adjust the force feedback, you have to play with Moza cockpit profiles.

Configuring the Ports

You should probably never need to do this, but you can change the ports over which the game and the fake DCS app communicate.

  1. Plugin: while in game press f1 (requires BepInEx configuration manager) and modify the port the game uses to stream its data.
  2. DCS.exe: before starting the program, modify zorduzd.cfg (if it does not exist, run DCS.exe once and quit) to set your desired ports. moza must match the port that Moza Cockpit sets for DCS and the game port must match the one from step 1.

Configuring the FFB Feel

To configure how the FFB feels, you must open Moza Cockpit and load or create your profile. By default, the mod makes Moza Cockpit believe that DCS is running and the user is flying an A-10C-II Warthog, but you can configure per-aircraft mapping via zorduzd.cfg. Additionally, Moza does not enable lots of cool FFB effects like wind turbulence, or even weapon discharge, so even with the default A-10C-II config, you might want to turn on and adjust more effects. E.g., here is what I have:

create some user profiles
enable extra effects

Aircraft Name Mapping via zorduzd.cfg

You can map Nuclear Option aircraft to DCS aircraft profiles in your config file. Moza Cockpit uses the aircraft name to select FFB profiles, so this lets you pick which DCS profile each NO aircraft uses.

On first launch, zorduzd.cfg is generated with an [aircraft_mapping] section containing sensible defaults and a full list of available DCS target names. To customize it, open zorduzd.cfg and edit the mappings:

[aircraft_mapping]
# NO aircraft name = DCS telemetry name
"CI-22 Cricket" = "P-51D"
"A-19 Brawler" = "A-10C_2"
"FS-12 Revoker" = "F-16C_50"
"SAH-46 Chicane" = "AH-64D_BLK_II"

Defining Custom Aircraft

Moza cockpit installation contains a bunch of json files that define the available aircraft. By default, you'll find them in:

C:\Program Files (x86)\MOZA Cockpit\bin\aircraft_database\

This repository contains a set of new aircraft definitions for NO under moza_aircraft_database, so that you will not need to override your DCS profiles. You can copy them to Moza's expected directory (make sure to restart Moza afterwards) and then create new profiles for NO-specific aircraft. Additionally, you must update your zorduzd.cfg to use these newly defined aircraft, for instance:

[aircraft_mapping]
# left side  = exact aircraftParameters.aircraftName (lowercase) from the NO debug window
# right side = aircraft_uid from the corresponding JSON file in moza_aircraft_database/
"ci-22 cricket"    = "NO_CI22_Cricket"
"t/a-30 compass"   = "NO_TA30_Compass"
"a-19 brawler"     = "NO_A19_Brawler"

Manual Download

  1. Install BepInEx 5 into your Nuclear Option game directory. You should optionally install BepInEx configuration manager too.
  2. Download the latest release.
  3. Copy the extracted release files into BepInEx/plugins/.
  4. Follow configuring moza cockpit
  5. Run the game and enjoy
  6. Fine adjust your experience by following configuring the FFB feel

The Moza Cockpit software will connect to DCS.exe on port 3476 and start applying force feedback effects. The plugin streams telemetry to DCS.exe on port 3480.

How it works

A BepInEx plugin

The C# component (zorduzd.dll) is a BepInEx 5 plugin that hooks into the Unity runtime of Nuclear Option. On every physics tick it reads telemetry from the player's aircraft: acceleration, G-force, airspeed, angle of attack, engine RPM, gear state, control surface inputs, countermeasures, and more. It serializes this data as semicolon-separated key-value pairs and sends it over a local TCP connection (default port 3480).

A DCS "Faker"

The Rust component (DCS.exe) is a GUI proxy that sits between the game plugin and the Moza Cockpit software. It:

  1. Listens on the Moza Cockpit's expected DCS port (3476) and waits for Moza Cockpit to connect.
  2. Connects to the BepInEx plugin's TCP stream (3480) to receive telemetry from Nuclear Option.
  3. Translates the telemetry into the same key-value format that DCS World's MOZA.lua export script produces.
  4. Forwards the translated data to Moza Cockpit, which treats it exactly as if DCS World were running.

The name DCS.exe is intentional: Moza Cockpit auto-detects running processes by name to enable its FFB profiles.

Building

Requirements

  • Rust toolchain (edition 2024)
  • .NET SDK (targeting netstandard2.1)
  • Assembly-CSharp.dll and Mirage.dll from your Nuclear Option install

Build

cargo build

The build.rs script handles everything:

  • Copies Assembly-CSharp.dll and Mirage.dll from the default Steam path into ext/ if they aren't there already. Set the NUCLEAR_OPTION_PATH environment variable to override the lookup path.
  • Runs dotnet build for the BepInEx plugin.
  • Places zorduzd.dll next to DCS.exe in target/debug/ (or target/release/).

Inspiration & Credit

This a program that basically makes the Moza Cockpit think "DCS" is running and providing telemetry data. I was inspired by this trick to make Zorduzd without having to deal with calculating effects myself.

This a force feedback mod for Nuclear Option that (at the time of writing) uses direct input, so it should work for any controller. I made my own mod after stumbling upon NOFFB. This was quite helpful for me to learn about the BepInEx plugin system for Unity.

Zōrduzd means "Force Stealer" in Persian (زوردزد).
Licensed under MIT license.

Zōrduzd (zwldwct') in book Pahlavi

About

A Moza Flight Stick FFB mod for Nuclear Option

Topics

Resources

Stars

6 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages