Skip to content

musurca/SANDMAN

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SANDMAN

Fatigue modeling for Command: Modern Operations

What is SANDMAN?

SANDMAN models the current fatigue level of your pilots using a realistic model based on their sustained activity, sleep debt, and circadian rhythms, then degrades their proficiency accordingly. With SANDMAN, you may also see exhausted pilots taking short, dangerous "micronaps" in which their plane goes out of comms, and becomes vulnerable to enemy action. Extremely exhausted pilots may even begin to bolter/go-around on landings, or even (under very rare conditions) crash.

Using the Fatigue Avoidance Scheduling Tool (available from the Special Actions menu), you can monitor the effectiveness of your pilots, and attempt to stand down particularly exhausted pilots for rest.

How do I add it to my scenario?

  1. Download the latest release.
  2. Open your scenario in the Scenario Editor.
  3. Go to Editor -> Lua Script Console
  4. Paste the contents of the file sandman_min.lua into the white box, then click Run.
  5. Complete the SANDMAN wizard and voila! You now have sleepy pilots.

If I want to tweak the model, how do I build it from source?

You'll need the following installed on your system:

Quick prerequisite install instructions on Windows 10

Assuming you've installed the WSL and Ubuntu, run the following commands from the shell:

sudo apt-get install python3 npm
sudo npm install -g luamin

How to compile

Release
./build.sh

The compiled, minified Lua code will be placed in release/sandman_min.lua. This is suitable for converting scenarios by pasting it into the Lua Code Editor and clicking RUN as the final step in the scenario creation process.

Debug

./build.sh debug

This will produce compiled but unminified Lua code in debug/sandman_debug.lua. Do not use this in a released scenario. This is mostly useful while debugging your code.

Why is the build process so complicated?

SANDMAN works by injecting its own code into a CMO LuaScript event action which is executed upon every scenario load. The build process converts the SANDMAN source into a minified, escaped string which is then re-embedded into its own code.

Version History

v0.2.2 (?????):

  • fixed: compatibility with IKE

v0.2.1 (3/8/2022):

  • fixed: much higher than intended crash incidence

v0.2.0 (3/6/2022):

  • added: reserve crews
  • added: reserve display and replacement thresholds
  • added: global timezones
  • added: multicrew model
  • added: crews of planes under maintenance/reserve placed in reserve
  • changed: FAST shows peak awareness time for pilot
  • changed: FAST shows actual proficiency based on effectiveness
  • changed: FAST shows pilots in selected bases
  • changed: proficiency drop now an absolute delta
  • changed: UAVs will never micronap
  • changed: UAVs get 2x reserve crews
  • changed: enable fatigue tracking by side in wizard
  • changed: set model values by side in wizard
  • changed: calling Enable/Disable() adds & removes special actions
  • changed: update called on prime number intervals
  • changed: circadian term cached
  • changed: API functions match CMO standard
  • fixed: implemented custom PRNG to replace math.random()
  • fixed: array table storage

v0.1.1 (2/10/2022):

  • added: API functions for scenario authors
  • changed: increased micronap risk
  • fixed: reinstalling SANDMAN resets proficiencies

v0.1.0 (2/9/2022):

  • Initial release.