Jump to content

Early days, but maybe reach out to Buddeye for AI?


Recommended Posts

I honestly don't know if he is still interested but his AI coding was the best I ever played and those who experienced it also agree. Here is an example of his thinking:


Buddye on design of the BOB2 AI Maneuver Selection

The design of the AI maneuver Selection Criteria was driven by the need to become more deterministic and less random in selecting AI maneuvers. I felt the need to move in this direction to improve the AI offence and defense so the AI selection software had more control...

Here is a summary of how the AI selects from the (more than 80) available maneuvers:

1. Altitude (how much altitude and rate of change)
2. Speed (how much speed, and rate of change)
3. Position of A/C to each other (nose to tail, tail to tail, nose to beam, tail to beam or left, right, front, back) This is what makes the AI really 'smart' - it is constantly testing to see if it is 'offensive' or 'defensive' and chooses its response dynamically as the fight progresses.

To implement the new selection criteria I built a 3 X 6 matrix (a truth table) and many new programs. For each A/C (the unfriendly and the AI or the player), I designed programs to look at Altitude, Speed, and position and to first try and select the best maneuver option (aggressive or defense) based on AI skill level. The same I applied to ground attack scenarios, was the aircraft offensive (targets in range, and not being targeted by player or other AI aircraft or AAA) or was it defensive (targets in range but being targeted itself).

Altitude and speed can also be thought of as “energy” as altitude can be turned into speed.

I created an uber aggressive 'Terminator AI' which only chooses from the offensive tactical set, it never goes defensive, so you might want to try it out. With the tweak to Terminator routines, he was getting “cocky” so I implemented a random spinout feature. The Terminator flies so close to the edge now that he has a chance to “spinout”. This is when you can most easily get him.

I also implemented a new AI feature called “Flying Factor (FF)”. This is the knowledge of the AI pilot to fly a given maneuver (the game tracks the experience of every individual AI pilot in successful or unsuccessful sorties) and how well the AI pilot will actually fly the given maneuver (skill). The FF is based on the Skill Level (customer selected in Instant Action Missions and software assigned in the Campaign). The Terminator is assigned a Skill Level of Hero2 (the highest in the game) so that is where he gets his boost in performance (edge). BOB2 has since 2009 had up to 4 mixed skills within a flight Novice, Veteran, Ace or Hero. So you might get lucky and bag a novice with limited abilities, to then be up against an ace who has the full range of AI talents available to it.

AI Maneuver Selection is the KEY

First, the BOBII AI has a special case for selection called “Evasive maneuver selection”. The Evasive maneuver is required when an AI is shot at (either a hit or near miss) or padlocked by an aircraft within visual line of sight and range. The AI will select a defensive maneuver randomly based on the criteria/data for both Player and enemy AI (speed, altitude, and the position of the targeting AI and the AI being targeted with respect to each other). Of course, the AI will evade the players quicker, if and only if, the AI can see the enemy (remember in BOBII, the AI vision is blocked just like the player's vision is blocked by the cockpit/airframe, wings, sun, clouds and distance). So as in real combat, you have the best chance if you surprise the AI by attacking from a blind spot, with altitude advantage, out of the sun or cloud.

The first key decision to be made by the AI is to select either an aggressive or defensive maneuver. This is a complex decision based on the available information on both the Player and the Enemy AI or the friendly AI and the enemy AI. The core data considered for both Player and enemy is speed, altitude, and the tactical position of the targeting AI and the AI being targeted with respect to each other.

After selecting either an aggressive or defensive tactic, then a semi random approach is used to select a category (choose good, choose bad, or choose “neither” good nor bad maneuver). This also makes the AI very human, creating the chance that it will choose a 'bad' maneuver in some circumstances. The chance is higher for novice, and lowest for Hero AI.

Maneuvers are then divided into three parts Vertical, Horizontal, and dive for each of our categories (choose good, choose bad, and choose neither good nor bad maneuver).

In BOBII we have over 80 complex maneuvers for selection (both the aggressive and defensive maneuvers) for the fighters (Spit,Hurri,109.110) and over 50 maneuvers for selection for the ground attack aircraft like the JU87. The following are BOBII’s complex maneuvers. Highlighted maneuvers can be ordered by the player and are also tied to the radio commands so that the player can order their wingmen to perform the maneouver:

MANOEUVRE_LOOKROUND (AI will weave and roll to allow it to try to 'check' in blind spots when in the combat area.)
MANOEUVRE_GOHOME (Radio command for RTB)
MANOEUVRE_ATTACKMYTARGET (Radio command. In ground attack radio menu, if the player has padlocked a target, the AI assigns 2 aircraft if available to attack the padlocked target. If no target is padlocked, the AI assigns 2 aircraft if available to search for ground targets and attack them, within visual range. Similar for air targets in the air attack radio menu context.)
MANOEUVRE_STAYWITHPREY (Radio command which forces AI to ignore eg fighters and concentrate on bombers. The PREY is defined by the mission target type, either fighter, bomber or ground target. Important for BOB because RAF doctrine said pilots were not to deviate from mission objectives to attack targets of opportunity.)
MANOEUVRE_STRAIGHTDIVE (for LW, this is a bunt, for the RAF Merlin engine fighters, they will roll to invert, then dive)
MANOEUVRE_SHOOTTOFRIGHTEN (eg if AI detects a comrade under attack within range)
MANOEUVRE_SELFASBAIT (or 'drag and bag' in other parlance - AI flying with an AI wingman - one AI will fly steady and slow, luring the player, while its wingman stalks)
MANOEUVRE_LUFBERRY (a special manoeuver for the Bf110s)
MANOEUVRE_STRAFFE (if given as a radio command - attack ground targets within visual range, or if player has padlocked a specific target, attack that target)
MANOEUVRE_STAYONTAIL (if given as a radio command - attack nearest air target within visual range, or if player has padlocked a specific target, attack that target)
MANOEUVRE_FLYTHROUGHCLOUD (a defensive manouver available if clouds are present - the AI dives for the nearest cloud)
MANOEUVRE_TURNTOHDGANDPITCH (turn to heading, a waypoint command)
MANOEUVRE_SCREWYOUGUYSIMGOINGHOME (when damaged, out of fuel, or low on morale - the AI will still evade if attacked when running for home.).

The AI Performance Criteria/Dependencies

Skill Level

The AI performance is dependent on AI Skill Level (which is customer selected in Instant Action and SW assigned in the campaign). BOBII AI do make mistakes (spin, crash, dumb maneuvers, bad judgment, shoot late , shoot bad, etc) which is after all very human.

The skill level of the AI is key in making decisions on about everything with respect to AI performance like (1) how well the AI fly, shoot, shoot fast, slow, accuracy, or not shoot, (2) how well the AI fly, what maneuvers are selected, and how well the AI will fly the chosen maneuver.


Each AI pilot/aircraft in the game is assigned a unique identifier. Each time that pilot is included in a sortie their experience score increases. If the sortie is successful (enemy destroyed by squadron>friendly lost) experience is also increased. If the sortie is unsuccessful (enemy destroyed<friendly lost) experience remains the same. Experience determines how many maneuvers the pilot can choose from, skill determines how well they execute them (choose good, choose bad, or choose “neither” good nor bad maneuver). This is the Flying Factor.


The game tracks the morale of every pilot and squadron/staffel in the game. Losses during combat impact the morale of a pilot and his unit in real time. If the AI pilot achieves a kill, morale is increased for themselves, and for their unit. If the unit takes losses, the AI pilot morale is decreased. When they land if enemy destroyed by squadron>friendly lost, overall morale is increased for the whole unit. If the sortie is unsuccessful (enemy destroyed<friendly lost) overall morale is decreased for the whole unit. An AI pilot's morale level and any losses of their unit during an actual combat, will increase or decrease the likelihood of the pilot choosing a bug-out maneuver ('RTB', 'turn_and_run', 'dive_for_home', 'screw you I'm going home') or a panic maneuver (panic_turn, maneuver_collide, shoot_too_early).
Random Numbers (Luck of the draw)

The BOBII AI A/C is also dependent on luck (specifically on random numbers). Random number decisions are coded through out the AI code. BOBII’s random approach keeps BOBII from doing the same thing each time. Even something as simple as the direction to start a maneuver (left or right), I will use a random number to decide (why hard code something when you can use a random number).

For example, most BOBII vertical maneuvers use a random number to assign a length of time to for a specific vertical maneuver (Like Zoom). The AI pilot will sometimes cut off early, or late, or somewhere in the middle. If early, the maneuver may carry too much speed, and if late, the AI may slow down so much that control is lost (very human).

The bottom line is that the customer will always see a somewhat different maneuver (very good, good, not so good, and loss of control) both because of the random implementation and the different physic’s parameters (speed, roll, heading, pitch, and overall energy) going into each maneuver.

The very real downside of random numbers is it is very hard to test (not repeatable) and the processing power used.


The conditions for each maneuver are always different - weather: wind speed, and wind direction will affect airspeed, and damage to AI aircraft affects how well the AI can maneuver or what maneuvers are available. A damaged AI will not fly as well as an undamaged AI as engine damage effects airspeed and structural damage limits control surface response (damage is always taken into account in the AI flying performance).



I flew against this AI and watched as a 109 I shot up, tried to out manoeuvre me low on the deck. 

The AI failed due to the damage on the wings, it obviously hadn't taken into account the loss of aerodynamics, and stalled then crashed into the ground. 

Still the best single player moment I have ever experienced. 


Cheers, Mysticpuma 

Link to comment
Share on other sites

While I'm sure the AI you describe is excellent and tremendously fun to play against (and I certainly do not want to detract from the obviously great quality Buddeye delivered), there's nothing in the above description that's especially innovative or that cannot be done by pretty much any other AI programmer, given enough time and money. I'm pretty sure the Devs will prefer to develop it in-house with the AI experts they already have, rather than hire an external person with less access to the team to do it for them.

We've entered an era where it may just become feasible to use a fast and shallow Neural Net though, which might revolutionise AI. If external people were to be hired, I'd go the Neural route instead of hiring another "traditional" programmer that I'm certain they already have.

  • Like 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...