Skip to content

7.6 Simulation Philosophy and Engine Internals

7.6.1 Deterministic vs. stochastic execution: Chess or chaos?

"The man who said 'I'd rather be lucky than good' saw deeply into life. People are afraid to face how great a part of life is dependent on luck. It's scary to think so much is out of one's control. There are moments in a match when the ball hits the top of the net, and for a split second, it can either go forward or fall back. With a little luck, it goes forward, and you win. Or maybe it doesn't, and you lose." - Intro to "Match Point" by Woody Allen

There is a question that is being frequently asked about Command: Is the execution deterministic? Is it random? If the latter, can it be configured to run in a deterministic mode instead?

Deterministic and stochastic models are approaches in various fields, including machine learning, simulation and decision support. Understanding the differences between these models is crucial for making informed decisions and analysis.

Deterministic models are based on precise inputs and produce the same output for a given set of inputs. These models assume that the future can be predicted with certainty based on the current state. Chess is a classic example of a fully-deterministic complex system.

On the other hand, stochastic models incorporate randomness and uncertainty into the modeling process. They consider the probability of different outcomes and provide various possible results.

Deterministic models assume that all variables are known and can be accurately measured. They rely on precise inputs and produce deterministic outputs. Stochastic models, on the other hand, consider uncertainty and randomness. They incorporate probabilistic inputs and have a range of possible outputs, allowing decision-makers to assess the likelihood of different outcomes.

A fully-deterministic simulation certainly has its uses. For example, when performing a small-scale test (e.g. a single missile attacks a single aircraft), it is desirable to set all variables of non-interest to fixed, static values so that the variable of interest (e.g. the successful seduction rate of a decoy against the threat missile) can be tweaked, and the result of the change evaluated.

COMMAND can indeed be configured to provide a small-scale "controlled environment" such as this: The weapon impact mechanics and other sim-events (sensor detections, AI decisions etc.) can be extended and/or overridden through a number of ways, in order to provide a control baseline for the experiment or analysis at hand.

Where full determinism begins to run into issues of real-life relevance is as the simulation scale increases, from the small-scale, low-level technical/engineering to the tactical and operational levels - i.e. where COMMAND really shines. Any complex system, and particularly one with human involvement, is virtually guaranteed to display variance in the execution of events, in the combination order of these events and even in the individual probability of any single of these events happening.

Even low-level technical/engineering events, nominally the playground of full-determinism, can in fact suffer from uncertainty. As an example, on June 18, 2017, a USN F/A-18E operating over Syria engaged a SyAAF Su-22M4 tail-on with an AIM-9X missile. The missile was successfully decoyed by flares. A strict engineering analysis would have shown this to be practically impossible; the AIM-9X was expressly designed to reject these very old, primitive Soviet-era flares. In reality, the Syrian pilot was just very lucky that day (for a short while; he was subsequently shot down by an AMRAAM missile fired by that same USN aircraft). In a fully-deterministic simulation this outcome either never happens at all, or always invariably happens. In a stochastic simulation, what happened was very unlikely, but feasible.

Command is expressly designed to reflect this "sea of uncertainty" in its modeling of real-world military operations - while concurrently respecting the mostly immutable nature of the physics foundations its simulation engine rests on. Historical accounts of real-life operations are full of "dirty" details like "...and number #4 in the flight had to divert to the nearest airfield because he had maneuvered off the group to avoid a SAM, this took him right over an unsuspected AAA site which punctured his fuel tank and he was leaking fuel like a sieve". A fully-deterministic simulation has little room for such "imperfections" of both man and machine; whereas they are constant occurrences in Command.

Command achieves this effect by combining multiple execution paradigms within its sim engine: Aspects such as physics (e.g. movement, weather etc.), sensor detections, fuel consumption, cargo transfer, crew proficiency, mission tasking, doctrine & rules of engagement (ROE), and basic crew AI decision trees are addressed in a deterministic fashion. Other aspects, such as weapon impact, damage inflicted and subsequent damage control are more fuzzy and handled stochastically: There is a "control" baseline, but things can go either way to an extent. Finally, the structure of the sim engine itself (multi-actor simulation with multithreaded execution, each actor running his "story" within the sim timeslice in parallel to others) creates built-in race conditions and thus a chaotic environment of interaction - just like real-life.

In addition, Command has the ability to record the simulation execution and afterwards go back into any of the saved snapshots and resume execution from that point. This provides an additional way of ensuring a consistent state up to a certain point in the timeline before spawning off to a new what-if branch.

7.6.2 General sim-engine flow: What happens on each pulse

Command's simulation loop can be set to run at three different timeslice settings; 0.1-sec pulse (aka "fine-grained"), 1-sec pulse (aka "coarse" or "flame") or 5-sec pulse (aka "very coarse" or "double-flame")

When using 1-1 (real-time), 2x, 5x and 15x acceleration, the fine-grained setting is used. In "flame" acceleration the coarse setting is used. In double-flame acceleration the 5-sec setting is used.

Other sim designs choose to use even larger slice values for their coarse setting (e.g. 15-sec pulse) in order to boost performance, but in a detailed tactical simulation this can create problems (e.g. a missile is ahead of a target on pulse X, then afterwards well beyond a target on pulse X+1, and the impact that should happen is never evaluated). So, 5-sec pulses are as coarse as we'll go, and we gain good performance by other measures.

Most of the non-kinematic operations in a simulation pipeline, for example most AI calculations, happen at 1-sec (or more) intervals. So, it does not make a difference if the sim runs at hi-fi or coarse setting, as e.g. a targeting evaluation may happen every 4 seconds in both cases. What will change is that the trajectory of e.g. a turn curve will be smoother in hi-fi mode.

On the other hand, weapon impacts and other time-critical events are evaluated on each pulse, so there will be a slight difference in precise timestamp between the two modes (e.g. a weapon impact may register at 07:46:02.300 at hi-fi mode (3 tenths of the next second), but at 07:46:03 in coarse mode (as all events are checked on a second-by-second basis, so all times are rounded-up to the next second).

Command uses a combination of deterministic models (e.g. for movement, intra-base air/boat operations, effects of weather, sensor checks etc.) and stochastic elements (weapon impact & damage evaluation, order of AI calculations between multiple units etc.). So indeed, the engagement results are not perfectly reproducible at the microscopic level, but in a repeated series of running the same scenario the probabilistic trends gradually manifest themselves. For example, in an engagement between a Eurofighter and a MiG-23, all other things equal/neutral, the MiG may well get some lucky breaks here and there, but statistically the EF should dominate.