Rule 1. IF Target_Far AND Ammo_Loads THEN Desirable
Rule 2. IF Target_Far AND Ammo_Okay THEN Undesirable
Rule 3. IF Target_Far AND Ammo_Low THEN Undesirable
Rule 4. IF Target_Medium AND Ammo_Loads THEN VeryDesirable
Rule 5. IF Target_Medium AND Ammo_Okay THEN VeryDesirable
Rule 6. IF Target_Medium AND Ammo_Low THEN Desirable
Rule 7. IF Target_Close AND Ammo_Loads THEN Undesirable
Rule 8. IF Target_Close AND Ammo_Okay THEN Undesirable
Rule 9. IF Target_Close AND Ammo_Low THEN Undesirable
Note that these rules are only my opinion and will reflect my level of
expertise in the game. When you design the rules for your own game, con

sult the best player you have on your development team because the more
expert the player you derive the rules from, the better your AI will perform.
This makes sense in the same way that Michael Schumacher will be able to
describe a much better set of rules for driving a Formula One racing car
than you or me.
Fuzzy Inference
It’s now time to study the fuzzy inference procedure. This is where we
present the system with some values to see which rules fire and to what
degree. Fuzzy inference follows these steps:
1. For each rule,
1a. For each antecedent, calculate the degree of membership of the
input data.
1b. Calculate the rule’s inferred conclusion based upon the values
determined in 1a.
2. Combine all the inferred conclusions into a single conclusion (a fuzzy
set).
3. For crisp values, the conclusion from 2 must be defuzzified.
Let’s now work through these steps using some of the rules we’ve created
for weapon selection and some crisp input values. Let’s say the target is at
a distance of 200 pixels and the amount of ammo remaining is 8 rockets.
One rule at a time then…
Rule One
IF Target_Far AND Ammo_Loads THEN Desirable
The degree of membership of the value 200 to the set Target_Far is 0.33.
The degree of membership of the value 8 in the set Ammo_Loads is 0. The
AND operator results in the minimum of these values so the inferred con

clusion for Rule 1 is Desirable =0. In other words, the rule doesn’t fire.
Figure 10.15 shows this rule graphically.
Fuzzy Logic  429
Fuzzy Rules