About:
This document contains editing information for the Gladiator bot.

The Gladiator bot is an artificial player for Quake2.
Author:
Mr Elusive (MrElusive@demigod.demon.nl)
Gladiator page:
http://www.botepidemic.com/gladiator
Last update:
1999-05-05

First a brief introduction to fuzzy logic and how it is used in the Gladiator bot.

Fuzzy Logic

Fuzzy logic is a superset of conventional (Boolean) logic. This logic was extended to
handle the concept of partial truth, also using values between "completely true"
and "completely false". It was introduced by Dr. Lotfi Zadeh of UC/Berkeley in the
1960's as a means to model the uncertainty of natural language.

Fuzzy Subsets

Just as there is a strong relationship between Boolean logic and the concept of a subset,
there is a similar strong relationship between fuzzy logic and fuzzy subset theory.

Let's assume there's a set S and to all it's elements there's one element of the set {0,1}
attached. The subset U of the set S is defined as all the elements of S that have an '1'
attached. The truth or falsity of the statement "x is in U" can be determined. The
statement is true if there's a '1' attached to the element 'x' in S. Otherwise the
statement is false.

Similarly for the fuzzy case there's a set S. But now a value from the interval [0, 1] is
attached to every element of S. The subset U of the set S isn't strictly defined in this
case. However it can be determined how much an element from the set S belongs to the fuzzy
subset U. A value of zero attached to an element from S represents complete non membership
of U. A value of one represents complete membership. The values between zero an one represent
intermediate degrees of membership. The degree to which the statement "x is in U" is true can
also be determined. The degree of truth of the statement is given by the attached value to
the element x in the set S.

Fuzzy functions and relations

Often a value from the interval [0, 1] is attached to an element of the set S using a function,
the membership function. Such a function is one-dimensional because it's based solely on one
criterium. In practice functions are based on two or even more criteria. Such a function gives a
value from the interval [0, 1] to a combination of criteria and is often referred to as a
"fuzzy relation". The criteria don't have to be elements from the same set they could just as
well be elements from different sets. The criteria also don't have to be elements from sets.
Variables of some kind could also be used as criteria.

Gladiator bot and fuzzy logic

The Gladiator bot uses fuzzy relations to specify how much the bot wants to do, have or
use something. For instance a value is attached to how much the bot wants to have a certain
item. The 'fuzzy relation' is based on the current situation and environment of the bot. The
situation and environment are represented by a set of variables.

The fuzzy relations which the Gladiator bot uses are stored using a tree-like structures. The leaves
of this tree store fuzzy values. A node in the tree can link to either a leaf or one of the
nodes on the next level of the tree. Linking to another node is based on one of the criteria
of the fuzzy relation.

The fuzzy relations are stored in plain text using a C-like syntax.

Here is an example of a fuzzy relation:

weight "name"

{

switch( /*one of the criteria*/ )

{

case /*smaller than a certain value*/:

{

switch( /*one of the criteria*/ )

{

case /*smaller than a certain value*/: return /*a fuzzy value*/;

case /*smaller than a certain value*/: return /*a fuzzy value*/;

default: return /*a fuzzy value*/;

}

}

case /*smaller than a certain value*/: return /*a fuzzy value*/;

case /*smaller than a certain value*/: return /*a fuzzy value*/;

default: return /*a fuzzy value*/;

}

}

First of all every fuzzy relation (called a weight) has a name. Different fuzzy relations are identified by their name.

The nodes of the tree-like structure are represented by C-like switch statements. The switch statement selects one of the criteria of the fuzzy relation. The case keywords divide the value range of the criterium into several chunks. A divisions of the value range is made at the value that appears after the case keyword. The number of case keywords determines the number of divisions. A case statement 'links' to a node or leaf on the next level of the tree when the value of the criterium is below the value that appears after the case keyword. A switch always has a 'default' statement. If the value of the criterium is higher than the value that appears after last case statement then the default keyword links to the next node or leaf in the tree. A leaf of the tree denoted by the keyword 'return' stores a fuzzy value.

The criteria used in the fuzzy relations are the inventory item amounts extended with several other variables. To select one of the criteria an index from the inv.h file is used.

Evaluation of a fuzzy relation

Fuzzy relation code pros and cons

- structure is easy to understand
- the fuzzy relation can be deduced from situations
- the fuzzy relation can be created with logical reasoning
- the bot can easily update and write the structure
- structure can be used with bot interbreeding schemes
- in combination with the recursive evalution of the fuzzy relation with interpolation between criterium divisions the structure is suitable to generalise from situations

- pretty much every relation can be expressed but sometimes the realisation takes way to much code

Item weights

Weapon weights