bbosen - 2020-06-29

Writing a new mission for LAC eventually gets to the point where you need robust, online testing by multiple, simultaneous players. Until your mission becomes well-established in the LAC community, it is very difficult to recruit players for this testing.

The most complex of these issues requires verification of expected behavior as damage is inflicted upon hostile (and even upon friendly) airfields and similar strategic resources.

To help with this, LAC version 8.23 includes four new functions that new Mission Developers can use, at any time during their testing as missions are developed. Each inflicts heavy damage upon a designated mission airfield, exactly as if a hostile aircraft had dropped several bombs on it. Those new functions are named "TestDamageMissionObjectHqBlue()", "TestDamageMissionObjectHqRed()", "TestDamageMissionObjectAirfieldBlue2()", and "TestDamageMissionObjectAirfieldRed2()".

Here is some sample code showing how I used one of those new functions, as a temporary step in development, as I was working on MissionNetworkBattle06.cpp:

BEFORE invoking any of these new tools, THIS little code snippet defined state "22" of that mission:

if (MissionStateNetworkBattle == 22 && (timer > PriorStateEndTimer +10000))
   { //  Only get here once, 10000 ms after MissionStateNetworkBattle
   //  advances to "22":
   //
   if (! (NetworkMode & 16))
      {
      popen ("espeak -p 10 -s 140 \"Mission State = 22.\"", "r");
      }
   MissionStateNetworkBattle = 23;
   PriorStateEndTimer = timer;
   }

In its pristeen state as coded above, state "22" commences exactly 10000 milliseconds after state "21" ends. It doesn't do anything fancy yet (but Mission Developers can easily insert additional code to do more). If the free, well-known "espeak" text-to-voice application has been installed and configured for use by LAC, it vocalizes "Mission State equals 22." through the user's headset or speaker, and then it sets up some timers in preparation for the next mission state.

AFTER improving that mission state with one of these new tools, that little code snippet grew to look like this:

if (MissionStateNetworkBattle == 22 && (timer > PriorStateEndTimer +10000))
   { //  Only get here once, 10000 ms after MissionStateNetworkBattle
   //  advances to "22":
   //
   if (! (NetworkMode & 16))
      {
      popen ("espeak -p 10 -s 140 \"Mission State = 22.\"", "r");
      }
   MissionStateNetworkBattle = 23;
   PriorStateEndTimer = timer;
   TestDamageMissionObjectHqBlue();
   }

As you can see, the only difference between the "BEFORE" and "AFTER" code is insertion of this single new line at the bottom of "AFTER":

TestDamageMissionObjectHqBlue();

As a consequence of that one-line code insertion, mission State 22 will now inflict heavy damage upon the Blue HQ airfield, in addition to any vocalization of "Mission State equals 22", as if a hostile bomber had hit that Blue HQ airfield with several bombs about 3 minutes into the mission (according to the accumulated time allocated to all of the prior Mission States).

I used this technique to debug the underlying logic that LAC uses to inflict, repair, and report airfield damage, to propogate knowledge of that damage across the network to other participating players, and to degrade or disable the player's RADAR and IFF instruments if all of his airfields are so heavily damaged that no RADAR service can be expected. As a consequence of my work along these lines, new Mission Developers need not worry about any of these details: LAC handles all of that for you.

As a new LAC Mission Developer, I hope you will find these little functions to be useful to your efforts as you exercise and test your own creative ideas and to see how they are affected by airfield damage, etc.

At the time of this writing in July of 2020, all of our new, sample missions (all clearly labeled "TEST" in the menus) use these functions at least a few times, so players will always witness airfield damage at timed intervals. New Mission Designers will want to de-activate and re-activate that testing code from time to time as they improve and perfect their work.

I expect to make more little functions like these available soon so you will be able to test heavy damage situations versus battleships, aircraft carriers, naval destroyers, artillery batteries, and perhaps some other strategic mission resources. Stay tuned.....

 

Last edit: bbosen 2020-07-14