AI 102. AI Conditions

AI 102. AI Conditions

Editing the AI on rooms and crews can be intimidating. You don’t want to ‘break’ anything that works, but you do want to optimize their potential. It’s important to understand how everything works before you adjust anything. 

It all boils down to a string of ‘condition/action’ lines. If it helps, you can think of them as ‘if/then’ statements. 

Conditions are the ‘if’ part. This means that when the condition is true, the ai will execute (do) the corresponding action. When there are multiple lines of code, they will be processed in order of priority from top down. 

Before we look at examples of what they can do, here are some conditions initially available to us in an MSL room with a level 1 unresearched CMD room. 

There are many! But don’t be intimidated. They’re all just situations. Whichever you select, your saying, “if the situation is this…”

[Note- The PSS AI platform has different categories of conditions such as room hp, subject (crew) hp, room status (contents), etc.]

  • First, let’s apply the game’s ai concept to real life circumstances. If you’re brand new to the game it might help you understand the system. Here’s a fake example:
  • Tired: sit in chair
  • In this fake example, it tells us that if we are tired, we sit in a chair. It does not tell us what to do with our legs if we are not tired. It also doesn’t tell us what to do if there are no chairs. Let’s add another line. 
  • Tired: sit in chair
  • None: walk
  • Now, when you are tired, you sit down and in all other situations (with no conditions) you walk. We could find other situations where sitting in a chair would be useful OR other places to sit and we could add more lines, but they must come above our “none: walk” line. 
  • If we do it the other way around:
  • None: walk
  • Tired: sit in chair
  • We would never sit down. We would always walk because the line of higher priority is the “none: walk” line. That means no conditions make us want to do anything other than “walk”.

Now, Let’s look at a basic in-game example of MSL room AI:
(expressed as “condition: action”)

  • None: Set max power
  • None: Set cheapest
  • None: Target enemy random rooms

All 3 lines have ‘none’ as the condition. This should not be read as never. It means no conditions make the line untrue. The room will always call for max power, it will always set the cheapest ammo, and it will always target random rooms. 

In this example, you can see that power setting, ammo selection and target acquisition operate independently and concurrently. Things get more interesting when you add more of either of these types of commands. 

Let’s add another targeting line:

  • None: Set max power
  • None: Set cheapest
  • None: Target enemy missiles
  • None: Target enemy random rooms

Now, the same things will happen except it will prioritize the enemy missile rooms as a target. Instantly, the room will set max available power, load the cheapest available ammo and target an enemy missile room (if present). If no enemy missile room is present, your ai will progress to line 4 and select a target based on the ‘Target enemy random’ action.

Remember, the ai sets priority. This means that it will first choose a missile room. If that room is destroyed, it selects the next target allowed by your ai set.
So, if the enemy has a second missile room, it will start shooting there.
If both missile rooms are destroyed, it will move on to line 4 and begin targeting random rooms.
However, if a missile room is repaired, it will return to that target because Line 3 takes precedence over line 4.

Let’s now change the situations:

  • None: Set max power
  • None: Set cheapest
  • Your ship <100: Target enemy missiles
  • None: Target enemy random rooms

At the beginning of a fight, your ai still sets max available power to the room. It still selects the cheapest available ammo. 
But, it skips Line 3 (because you have full health) and picks it’s first target from line 4 of your code. 
Once your hull takes damage, it will prioritize enemy missile rooms.
Unfortunately, if the enemy missile rooms are both completely destroyed (or not present in the first place), it will continue on to line 4 and start targeting random enemy rooms again.  

This is explained in further detail in the next section (AI 103: conditions).

For more information on power controls, see the AI 400 series. 

For more information on target acquisition and ammo selection, see the AI 200 series.

Scroll to top