Title: Pogamut 2 Platform for fast development of cognitive agents inside 3D environment
1Pogamut 2 Platform for fast development of
cognitive agents inside 3D environment
Faculty of mathematics and physics Charles
University at Prague 9th April 2008
- UT2004 items and Pogamut API
- Raycasting
- Lets talk about raycasting -)
http//artemis.ms.mff.cuni.cz/pogamut
2UT2004 items 1/2
- messages Ammo, Armor, Extra, Health, Special,
- Weapon
- two things
- items from INV messages (ancestor Item)
- items from AIN messages (prefix Add, e.g.
AddAmmo, ancestor AddItem) - each individual object has specific properties
- read JavaDoc API for items special fields
http//artemis.ms.mff.cuni.cz/pogamut
3UT2004 items 2/2
- AgentMemory implements interface Inventory
- Iterface Inventory
- used for weapons (guess why -)
- .getBetterWeapon(Triple from, Triple to)
- returns weapon that the bot is carrying and
- that is more suitable for the range (from-gtto)
- .hasWeaponOfType(ItemType)
- whether the bot has a certain weapon
- ItemType is enum
http//artemis.ms.mff.cuni.cz/pogamut
4Raycasting 1/5
- two options
- 1) periodic checks (GB will send ATR messages in
every batch) - body.addRayToAutoTrace(
- int ID, Triple direction, Double length, boolean
fastTrace, boolean traceActors - )
- ID -gt your specified number for that ray
- memory.getAutoTraceById(int ID)
http//artemis.ms.mff.cuni.cz/pogamut
5Raycasting 2/5
- two options
- 2) on-demand
- body.trace() response TRC message
- memory.getTraceResult(int ID)
- body.fastTrace() response FTR message
- memory.getFastTraceResult(int ID)
- both commands takes int ID as well and you have
to wait for the round-trip time between your
agent and the bot - ID is returned in ATR / FTR messages inside
UnrealID - you can set listener for messages to be sure
http//artemis.ms.mff.cuni.cz/pogamut
6Raycasting 3/5
- fast trace -gt works only with walls (level
- geometry)
- goes through players / bots / etc. (actors in
- UT/GB terminology)
- faster, doesnt overload server that much
-
- trace -gt works with actors and items as well
- slower (not sure how much)
- contains HitNormal (of the triangle it hit)
http//artemis.ms.mff.cuni.cz/pogamut
7Raycasting 4/5
- Where to configure?
- the good place should be postPrepareAgent()
- if it wont work gt BUG!
- Workaround
- create method init() and call it first time the
doLogic() is called
http//artemis.ms.mff.cuni.cz/pogamut
8Raycasting 5/5
- Whats it for?
- get better notion about the world around you
- easily detect obstacles in the world
- not easy to use as it seems
- how are you going to detect holes?
- is it wall or just hill that can be climbed?
- few traces in each direction with different
lenghts perheps?
http//artemis.ms.mff.cuni.cz/pogamut
9Using traces
Lets try to create bot that will detect walls,
holes, anything I have dreamed of -) I hope
that the solution will emerge lets say that
the bot should log into its user log what is
left/in front/right to him may be the topic
for non-violent bot -)
http//artemis.ms.mff.cuni.cz/pogamut