Title: Omnibot
1AI Bot for First Person Shooters
João Carlos Gonçalves jcgonc_at_student.dei.uc.pt
2OMNI-BOT - Resume
- Bots
- Resume Omni-Bot
- Game functioning,
- Framework
- Agent structure,
- Goals
- Society and interaction
- between agents,
- Waypoints and traversal,
- Manual routing,
- Scripting,
- Problems and scripting,
- Conclusion
3Whats a bot?
- Everyone who has played a computer game has
encountered a bot. - Computer controlled game player.
- Computational equivalent of a robot
- Bot ? Agent
4Why bots?
- Fill a game with more players.
- Help humans to train.
- Execute tasks boring for us.
- Etc.
5OMNI-BOT
- Framework implementing bots in FPS
- Games supported
- Wolfenstein Enemy Territory, Doom 3, Quake 4,
Fortress Forever, Return To Castle Wolfenstein,
Team Fortress 2 - BDI agents, internally state machines.
Oriented towards completing goals while sensing
their environment. - Not ALL games fully working (currently).
- Best implementation on W.E.T.
6Enemy Territory- Resume -
- Comprised of various environments (maps) usually
set in WW2, with different goals (frequently
contradictory) for the factions. - Two factions Allies and Axis, equal in
characteristics, spawning in pre-determinated
locations. - Five classes Soldier, Medic, Engineer, Field
Ops, Covert Ops, each one with its advantages
and disadvantages.
7Wolfenstein Enemy Territory- Goals -
- Goals like stealing vehicles, escorting or not
allowing them to move, destroying or constructing
entities, healing and reviving teammates, etc. - Completing goals may create contradictory goals
on the opposing faction. - Game development may also create or delete
goals, possibly specific for some faction. - Show Demo.
8Wolfenstein Enemy Territory
- Limbo, with maps goals for allied faction
9Wolfenstein ET MODs
- SDK for changing game logic available
- Various game modifications (mods) with different
game plays - ETPub
- NoQuarter
- ShrubMod
- ETPro
- Jaymod
- True Combat Elite
- PowerBall
- etc.
- Installed on the games directory
10OMNI-BOT
- Independent Library installed on ETs folder
(usually omni-bot) - omnibot_et.dll has the implementation
- qagame_mp_x86.dll server side engine (game
logic) - cgame_mp_x86.dll ui_mp_x86.dll client
side engine and graphics (client side logic and
corresponding graphics) - Omnibot_et.dll linked by the running mod (must
support omnis interface) - mod initializes omnibot and bots are connected
to the engine as clients (like players) - supported mods ETPub, Jaymod, NoQuarter
11OMNI-BOT - agent structure
- List of goals, with execution states, positions,
priorities and availability - Sensory memory, with list of attractive
entities, like enemies or aimable things. - Available weapons, with their preference and
firing parameters. - Motor Control, executing the path following
algorithm as well as the aiming mechanism.
12OMNI-BOT - agent structure
- Simplified version of a BDI agent
- Beliefs Stored on sensory memory
- Desires List of goals
- Intentions desire selected for execution,
being performed - Basically a state machine (deterministic finite
automaton, DFA)
13OMNI-BOT - State Tree
14OMNI-BOT Agents behaviour
if(incapacitated) do for(medicteam.medics)
evaluation avaliate(medic.proximity)
evaluation avaliate(timer.spawn) decideResp
awn(evaluation) selectEquipment()
while(incapacitated) else updateSensoryMemor
y(world.getNeighborhood()) // additional
behaviour scripts executeScripts() selectEquipm
ent() goal getHighestPriorityAvailableGoal()
// goal may include alternative route path
computePath(goal) // wait for world
events while(not(world.changed)) waypoint
nearestWaypoint(path) motorControl.setDestinati
on(waypoint) if(near(waypoint)) do
execute(goal) while(not(executed(goal)
))
- Simplified algorithm for bots' behaviour.
Actually implemented in parallel threads, like
path following, enemy aiming and firing, sensory
information, etc. (external scripts)
15OMNI-BOT Agents behaviour
- Executed on each server frame (usually 20 per
second, server side cvar sv_fps) - Threads and execution details on Debugs
window, section profiler
16OMNI-BOT - Goals
- Retrieved from the maps script and bsps
entities - Following example destroy Side Door, for axis
17OMNI-BOT - Goals
- x goal -gt bitflag serial y priority z
- bitflag specifying allowed team (axis, allies)
- serial internal goal identification
- priority goal priority (relating to others).
- and more properties
18OMNI-BOT - Society
- By default goals are shared by different agents
(excluding some cases). - If not, the goal is assigned by the framework to
some agent (actually, first come, first served). - An agent may require support from others
(ammunition and health / revival). In this case,
it creates a specific goal (like heal me). - No negotiation of goals between the agents.
- Individual behaviour
19OMNI-BOT - Waypoints
- Goals are reached by following paths
- Paths created using waypoints
- Directed graphs (typically cyclic)
- Diagonal descending edge connection direction
20OMNI-BOT - Waypoints
- Travelling properties (flags)
- Crouch, prone, sprint, walk, jump, route,
radius, etc.
- radius of waypoint affects path cornering
- waypoint flag affects bots behaviour when its
approaching the node or when reaches its radius
21OMNI-BOT Path travelling
Uses Dijkstra's algorithm for waypoint
selection Essentially uses the shortest path from
the source (where the agent selected the goal) to
its destination (where goal resides or next
route point if used)
22OMNI-BOT Routing
- Path travelling easily expected
- Boring for humans
- Solution Manual routing
- Basically a human codes different paths for
different map traversal - Goal X travel through waypoint 1, then 2 OR 3,
then 4, etc. until reach destination - Define waypoint selection probability
- Route is chosen when goal acquired near first
route waypoint.
23OMNI-BOT Routing
From SPAWN to GOAL
MapRoutes GOAL ROUTE_SPAWN
ROUTE_A Weight 2.0,, ROUTE_B ,
ROUTE_C Weight 0.66 ROUTE_B Weight
0.5 ROUTE_D , ,,,
- If goal got when at spawn waypoint, choose
next waypoint from A, B or C, with probabilities
of 2, 1 and 0.66. Calculate shortest path to
chosen route point and travel the path - When arrive to A or B, travel shortest path to
goals waypoint - If chose waypoint C and reached it, choose B or
D (with corresponding probabilities) and
calculate shortest path to goal. Then travel it.
24OMNI-BOT Scripting
- Written in GameMonkey language
- Add functionality to goals, maps, weapons, bots,
utils, etc. - Goal scripts Tells or helps the bot how to
achieve some goal (map or another) - Map scripts Control the logic of the map, like
enabling or disabling routes and goals (for
instance according to the games progress) - Weapon scripts Configure how to use and handle
some weapon or item - Bot scripts Stores a behaviour which can be
associated to some bots. - Utils implement some usefull functions for been
called in other scripts.
25OMNI-BOT Map scripts
- Goal script example goal_askforhealth.gm
- this.GetPriority()
- if my health lt threshold and Im alive (me, the
bot) then - increase this goals priority
- get nearest health pack
- if no pack near, and my team has medics, request
medical support - this.update()
- if acquired pack, get packs position, aim
towards it and try to acquire the pack
26OMNI-BOT Goal scripts
Goal script example bunker.gm
- Store the logic of the map (the bots dont know
the goals dependencies as well as their
importance) - If objective taken ? leave the stairs and attack
the radio - If objective returned ? leave the radio and
attack the stairs - On map start ? start attacking the stairs,
forget the radio
27OMNI-BOT Problems
- Human waypointing, quite boring. Done manually.
Detailed waypoints take time as well as routing
them. - Proposed navigational mesh, detailed version of
waypoints, but with the problem of the mesh
resolution.
28OMNI-BOT Problems
- Cant plan a sequence of intentions
- No objectives negotiation between agents
(assigned FCFS) - Objectives are not assigned to the nearest
agent - Human coded intentions order and priorities
- Dont learn the best paths (currently and in
the past) - Dont predict (and learn) actions taken by
others (cooperation and synchronization) -
29OMNI-BOT Reference
http//www.omni-bot.com/wiki/index.php?titleMain_
Page http//en.wikipedia.org/wiki/Wolfenstein_Ene
my_Territory http//www.omni-bot.de http//www.gam
asutra.com/gdc2005/features/20050311/isla_01.shtml
30OMNI-BOT Questions
Tuesday, 16 December 2008