Firming the bedrock


Improve current base in preparation for EA.


  • Implemented additional pre processing
  • Implemented new fitness functions
  • Ongoing bug fixing


One of the core underlying issues had been the fitness function assessment. This was partially due to the placeholder nature of the initial implementation but also due to how the pathing data was handled; the use of the ‘optimum path’ score meant that the implemented modifiers for visibility were considered. In order to ensure paths avoided areas of visibility, extremely large modifiers were applied when paths included areas within varying sight tolerances.

This has been addressed with a new method that will give an approximation (node steps only – ie. the angled movement is just 1 instead of 1.4 times) as to how much of a path lies within a certain visibility threshold (passed as a parameter).


This is now incorporated into the SBF preprocessing stage; rather than allow any location with LOS to the enemy position, it will restrict candidate locations to those with less than X meters of the route through an area with less than Y visibility threshold. The previous preprocessing for SBF candidates is below.

3D view of terrain showing large areas highlighted indicating candidate FUP locations. Many areas are clearly unsound (eg. right on the enemy position)
Candidate FUP based on previous preprocessing

When the preprocessing is updated to consider the path as discussed above, it results in a much better SBF candidate list, as seen below.

3D terrain view showing areas for candidate SBF locations. Much better than previous as all are tactically reasonable options.
Candidate SBF locations based on updated pre processing

The no free lunch rule does apply here however. The preprocessing used in the first image took ~33 seconds whereas the time for the preprocessing stage now (giving the results in the second image) is ~ 2 minutes. The test above was done on a terrain sampling that would align to a 5km x 5km space sampled at 5m spacing. The obvious advantage here however is the significantly more optimised search space. Specifically the candidate SBFs have been reduced (in this example) from 3797 to 1542; more than 50% of generated plans then would be tactically unsound without this preprocessing.

Fitness function

The previous fitness functions were created on the fly and initially placeholders that were massaged to give reasonable results. Unfortunately they were not very effective and had a wide range of outputs without any coherent way to tune them (FUP fitness, SBF fitness and Plan fitness)

This has been updated with a more mathematical approach in an attempt to (generally) range a fitness of between 0 and 1 for each. Note this is not a hard cap but it does generally align well and allows more deliberate tweaking of parameters.

Fitness function algorithms are as follows:

  • FUP Score = 1 – (AssaultDistance/ 600)
  • SBF Score; If distance to enemy position is:
    • < 100mDistanceToEnemy / 1000    
      • Max score of 0.1
    • < 250m = (DistanceToEnemy – 100) * 0.005 + 0.1  
      • 0.1 @ 100m
      • 0.8 at 250m
    • < 400m =   1 – (AbsoluteValue(DistanceToEnemy– 325)) * .002  
      • Peaking at a value of 1 at 325m
      • Slow falloff to 0.85 at 250m and 400m
    • > 400m0.85 – (DistanceToEnemy – 400) * .0057
      • Falls off rapidly to 0 (capped at 0) at 550m
    • Further, once this value is calculated, a preference for higher terrain is applied:
      • SBF score is multiplied by 1/(1 + exp(-0.2(x-5)))
      • x = height difference, with positive values indicating SBF is higher than enemy position
  • Combination: Based off individual scores and angle. Angle converted to 0-90 degrees then normalised to values between 0 and 1, where 1 indicates an angle of 0 degrees and 0 indicates an angle of 90 degrees.
    • The FUP and SBF scores are summed then multiplied by
    • 1/(1 + exp(12(x-0.5)))
    • where x = normalised angle as above.

The equations in bold above are visualised below.

Graphs of fitness functions; both functions are S curve shapes between 0 and 1, increasing for SBF height, decreasing for combined plan (angle) modifier
Graphical view of SBF height preference modifier and plan combination (angle) modifiers (Graphs from

The result of today’s work is positive. One major error with the math helper class was it was considering angles only on magnitude; The example that highlighted this was where the axis of assault was ~30 mils and the fire support bearing was ~6020 mils, the function returned a bearing of 5990 mils which was then (blindly) used in the fitness function, resulting in a high score; in reality the angle of ~410 mils is VERY poor. This is now fixed, both in the math helper class AND in the fitness function.

Major areas that can be tinkered with:

  • Height preference of SBF; just how much influence height superiority has for SBF locations
  • Angle preference for plans. Appears quite reasonable currently

Overall though, a net win. Indeed in some tests the plan output seemed a bit off until I reoriented the camera to get a better ground appreciation of the terrain (‘walking it’); the plan developed was quite sound and took advantages of not immediately obvious terrain undulations. Promising!

Two example plans on different terrains:

3D representation of a plan indicating SBF and FUP locations
Plan developed on main test terrain with updated fitness function. SBF is the darker location to the right, FUP is in the dead ground to the upper left.
3D representation of a plan indicating SBF and FUP locations on a new test terrain with a central enemy position
Plan developed on new terrain with updated fitness function. SBF is the darker location in the middle. FUP is in behind the rise overlooking the enemy to the left.

Time Spent:

6 hours  (113 hours running total)


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s