How to add Expert Knowledge in a game agent
Notes:
Implementing Expert Knowledge:
I. Expert Knowledge: set of if-then rules
Expert: a person who is very knowledgeable in a particular domain and the one who can be able to apply the knowledge gained from his experiences, training, practices etc. in solving problems in that specific domain.
Game expert: a person who is very knowledgeable in a gaming domain and the one who can be able to apply the knowledge gained from his experiences, training, practices etc in building intelligent game agents.
The knowledge acquired by game experts through experience, training, practices etc. is represented mainly as set of if-then rules (called as knowledge base is a rule based system).
Coding expert knowledge is all about coding series of if-then statements, so that our game agents make better decisions.
Ex:
Shooting Game: Rule set for a game agent can be
if player is visible then shoot
if player is not visible then roam around
if player health is more than your health then notify others for backup
II. Problems with implementing expert knowledge using if-then statements:
Implementing the expert knowledge with the help of if-then statements is not very salable because as the number of rules gets increase the system becomes unreliable and difficult to fix bugs. The alternative solution is using command pattern which is one of the behavioral design pattern help you to build flexible and extensible knowledge base.
For coding expert knowledge many other techniques are used, they are:
a) Finite state machines (most commonly used)
b) Decision trees
c) Logical inference