Emperor Moloch

Digital Combat Simulator - Helicopter Racetrack

Started playing DCS in 2022. Well, playing is a big word. I just wanted to learn enough to fly a helicopter and maybe finish one campaign. DCS is unlike any other game in a couple of aspects:

The actual gameplay (by that I mean taking off, landing and actually killing stuff) is really, really simplistic. I mean like 2006 simple. If you had arcade controls it would feel like a 20 year old game.

The magic is that all this is hidden behind arcane controls and a really tough flight model. (I’m not sure about realistic…outside of getting an actual pilot’s opinion, for me there’s no way to tell. As far as flight models go they could swap the Mi-8 with the Hind and I’d be none the wiser.)

Missions are also just like…fly from A to B. And take 40 minutes to complete.

My fun is in the learning. And looking at real life flight manuals and discovering stuff mentioned in them is modelled in the game.

Racetrack

Here it is, it even has a positive comment: https://www.digitalcombatsimulator.com/en/files/3336791/

Rough idea

Long story short I trialled the SA432 Gazelle module, and noticed there’s a racetrack mission where you need to fly very low, take turns around huge inflatable air race cones. At the same time I was learning to use rudder pedals for the first time so learning was pretty challenging, But it was FUN. For the first time in DCS I was having actual arcade fun. Not the kind of slow-burning satisfaction from mastering an aircraft. Just pure fun.

So I needed to investigate further! What makes this cool little scenario tick?

Initial scenario

Original racetrack scenario comes from the Gazelle module and by default was something like this:

DCS Editor Overview

Blue squares are the airshow cones. There’s a set of waypoints and an end zone. As far as I can tell you don’t even really need to follow the waypoints? Before editing in many places there was only one airshow cone so it wasn’t 100% clear where exactly are you supposed to fly. Left side of the cone? Right side? Fortunately the cones don’t have collision models.

Rules

Essentially there were only two rules originally:

  • If you land in the endzone and stayed below altitude the you win the scenario
  • If you go above 20m radar altitude you lose

Implementation

The two rules are implemented with triggers: (This is from my finished scenario, that’s why there are way more triggers. But you get the gist)

DCS Trigger Editor

Triggers govern how a scenario works. They have three parts: the type ( most often single or continuous), the conditions, and the actions to execute when the conditions are met.

So, for example the finish event is a one-time event, when the Player unit is inside the Finish zone and has altitude and speed close to zero (implying that it has landed).

It’s a really simple system, so I wondered if I can make the race more interesting…

Upgrading the scenario

I really just wanted to fix a couple of things that bothered me:

  • There was no altitude warning, if you exceeded the maximum altitude the scenario just sort of ended.
  • There was no confirmation that you passed all checkpoints correctly
  • The scenario did not end if the helicopter suffered damage and was unable to complete the course.
  • Make sure all checkpoints have two cones, so there’s no ambiguity where to fly.
  • Change the part where you fly through a forest, because only the Gazelle is small enough to fit there. That way the course could be completed with other helicopters.

And as a bonus, at least while testing, I wanted the scenario to actually end when the mission fails, so I could restart faster.

Now let’s see how to implement these:

Altitude warning and failure state

First, I downloaded a lovely .mp3 of the F-16’s altitude warning.

Trigger - Altitude Warning

All this to set up a “Repetitive action” (still not sure how often these are checked, but often enough for this module) that plays the F-16 altitude warning when your radar altitude is between 18 and 21 meters (the failure state starts at 22 meters)

Interestingly enough radar altitude is not a universal parameter. Some modules had a different name for it and it was quite hard to figure out. Quite a bit of digging and asking on forums.

Damage failure state

Trigger - Damage

I set this up as a repetitive action so I had to add checks that failure state hasn’t already been achieved. Actually, not sure if this needs to be a repetitive action, but it works. It prevented awkward scenarios where you damaged your helicopter badly enough not to finish a race, but did not count as a crash.

Checkpoint confirmation

There’s a default “objective achieved” type of sound that I extracted from the Mi-8MTV Spring Tension campaign. Trigger - Waypoint

  • There is a flag set up that starts at 1 and increases by 1 when each check point is reached
  • Each checkpoint checks if the flag value is correct, plays the sound and adds 1 to the flag.
  • There is also an additional boolean flag that represents failure states. In case of a failure state checkpoints are not counted.

Finalizing

With all these triggers in place - it just worked. The biggest timesink were the checkpoint checks, but I feel they were really worth it. Though there must be a more efficient way to do this. DCS has some sort of scripting language and the editor is just a visual means to write scripts. But learning that for one scenario felt like overkill. So yeah, it works :) If you’re into DCS give it a download, leave a comment on the DCS site, have fun!