View Javadoc

1   package cz.cuni.amis.pogamut.sposh.context;
2   
3   import java.util.Random;
4   import java.util.logging.Level;
5   
6   import cz.cuni.amis.pogamut.base.agent.navigation.IPathPlanner;
7   import cz.cuni.amis.pogamut.base.communication.command.IAct;
8   import cz.cuni.amis.pogamut.base.communication.worldview.listener.annotation.AnnotationListenerRegistrator;
9   import cz.cuni.amis.pogamut.base.communication.worldview.listener.annotation.EventListener;
10  import cz.cuni.amis.pogamut.base.communication.worldview.listener.annotation.ObjectClassEventListener;
11  import cz.cuni.amis.pogamut.base.communication.worldview.listener.annotation.ObjectClassListener;
12  import cz.cuni.amis.pogamut.base.communication.worldview.listener.annotation.ObjectEventListener;
13  import cz.cuni.amis.pogamut.base.communication.worldview.listener.annotation.ObjectListener;
14  import cz.cuni.amis.pogamut.base.utils.logging.LogCategory;
15  import cz.cuni.amis.pogamut.base.utils.math.DistanceUtils;
16  import cz.cuni.amis.pogamut.base3d.worldview.IVisionWorldView;
17  import cz.cuni.amis.pogamut.base3d.worldview.object.ILocated;
18  import cz.cuni.amis.pogamut.sposh.JavaBehaviour;
19  import cz.cuni.amis.pogamut.ut2004.agent.module.sensomotoric.AgentConfig;
20  import cz.cuni.amis.pogamut.ut2004.agent.module.sensomotoric.Raycasting;
21  import cz.cuni.amis.pogamut.ut2004.agent.module.sensomotoric.Weaponry;
22  import cz.cuni.amis.pogamut.ut2004.agent.module.sensor.AgentInfo;
23  import cz.cuni.amis.pogamut.ut2004.agent.module.sensor.AgentStats;
24  import cz.cuni.amis.pogamut.ut2004.agent.module.sensor.Game;
25  import cz.cuni.amis.pogamut.ut2004.agent.module.sensor.ItemDescriptors;
26  import cz.cuni.amis.pogamut.ut2004.agent.module.sensor.Items;
27  import cz.cuni.amis.pogamut.ut2004.agent.module.sensor.NavigationGraphBuilder;
28  import cz.cuni.amis.pogamut.ut2004.agent.module.sensor.Players;
29  import cz.cuni.amis.pogamut.ut2004.agent.module.sensor.Senses;
30  import cz.cuni.amis.pogamut.ut2004.agent.module.sensor.WeaponPrefs;
31  import cz.cuni.amis.pogamut.ut2004.agent.module.sensor.visibility.Visibility;
32  import cz.cuni.amis.pogamut.ut2004.agent.navigation.UT2004AStarPathPlanner;
33  import cz.cuni.amis.pogamut.ut2004.agent.navigation.UT2004GetBackToNavGraph;
34  import cz.cuni.amis.pogamut.ut2004.agent.navigation.UT2004Navigation;
35  import cz.cuni.amis.pogamut.ut2004.agent.navigation.UT2004PathExecutor;
36  import cz.cuni.amis.pogamut.ut2004.agent.navigation.UT2004RunStraight;
37  import cz.cuni.amis.pogamut.ut2004.agent.navigation.floydwarshall.FloydWarshallMap;
38  import cz.cuni.amis.pogamut.ut2004.agent.navigation.loquenavigator.KefikRunner;
39  import cz.cuni.amis.pogamut.ut2004.agent.navigation.loquenavigator.LoqueNavigator;
40  import cz.cuni.amis.pogamut.ut2004.bot.IUT2004BotController;
41  import cz.cuni.amis.pogamut.ut2004.bot.command.AdvancedLocomotion;
42  import cz.cuni.amis.pogamut.ut2004.bot.command.CompleteBotCommandsWrapper;
43  import cz.cuni.amis.pogamut.ut2004.bot.command.ImprovedShooting;
44  import cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004Bot;
45  import cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004BotController;
46  import cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004BotModuleController;
47  import cz.cuni.amis.pogamut.ut2004.communication.messages.ItemType;
48  import cz.cuni.amis.pogamut.ut2004.communication.messages.gbcommands.GetPath;
49  import cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.AutoTraceRay;
50  import cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.BotKilled;
51  import cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.ConfigChange;
52  import cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo;
53  import cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.InitedMessage;
54  import cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.NavPoint;
55  import cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.PathList;
56  import cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Self;
57  import cz.cuni.amis.pogamut.ut2004.communication.translator.itemdescriptor.ItemDescriptor;
58  
59  
60  //
61  // 3rd change
62  //
63  
64  public class UT2004Behaviour<BOT extends UT2004Bot> extends JavaBehaviour<BOT> {
65  	
66  	/**
67  	 * Random number generator that is usually useful to have during decision making.
68  	 */
69  	protected Random random = new Random(System.currentTimeMillis());
70  	
71  	/**
72       * User log - it's log-level is initially set to {@link Level#ALL}.
73       * @deprecated use {@link UT2004BotController#log} instead
74       */
75      protected LogCategory user = null;
76      
77      /**
78       * Alias for user's log.
79       */
80      protected LogCategory log = null;
81  	
82  	/**
83  	 * Memory module specialized on general info about the game - game type, time limit, frag limit, etc.
84  	 * <p><p>
85  	 * May be used since {@link SposhBotLogic#botInitialized(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.ConfigChange, cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.InitedMessage)}
86       * is called.
87       * <p><p>
88       * Initialized inside {@link UT2004Behaviour#initializeModules(UT2004Bot)}.
89  	 */
90  	protected Game game;
91  	
92  	/**
93  	 * Memory module specialized on general info about the agent whereabouts - location, rotation, health, current weapon, who is enemy/friend, etc.
94  	 * <p><p>
95  	 * May be used since first {@link Self} message is received, i.e, since the first {@link SposhBotLogic#botFirstSpawn(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, ConfigChange, InitedMessage, Self)} 
96       * is called.
97       * <p><p>
98       * Initialized inside {@link UT2004Behaviour#initializeModules(UT2004Bot)}.
99  	 */
100 	protected AgentInfo info;
101 	
102 	/**
103 	 * Memory module specialized on whereabouts of other players - who is visible, enemy / friend, whether bot can see anybody, etc.
104 	 * <p><p>
105 	 * May be used since {@link SposhBotLogic#botInitialized(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.ConfigChange, cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.InitedMessage)}
106      * is called.
107      * <p><p>
108      * Initialized inside {@link UT2004Behaviour#initializeModules(UT2004Bot)}.
109 	 */
110 	protected Players players;
111 	
112 	/**
113 	 * Sensory module that provides mapping between {@link ItemType} and {@link ItemDescriptor} providing
114      * an easy way to obtain item descriptors for various items in UT2004.
115      * <p><p>
116      * May be used since {@link SposhBotLogic#botInitialized(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.ConfigChange, cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.InitedMessage)}
117      * is called.
118      * <p><p>
119      * Initialized inside {@link UT2004Behaviour#initializeModules(UT2004Bot)}.
120 	 */
121 	protected ItemDescriptors descriptors;
122 	
123 	/**
124 	 * Memory module specialized on items on the map - which are visible and which are probably spawned.
125 	 * <p><p>
126 	 * May be used since {@link SposhBotLogic#botInitialized(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.ConfigChange, cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.InitedMessage)}
127      * is called.
128      * <p><p>
129      * Initialized inside {@link UT2004Behaviour#initializeModules(UT2004Bot)}.
130 	 */
131 	protected Items items;
132 	
133 	/**
134 	 * Memory module specialized on agent's senses - whether the bot has been recently killed, collide with level's geometry, etc.
135 	 * <p><p>
136 	 * May be used since {@link SposhBotLogic#botInitialized(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.ConfigChange, cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.InitedMessage)}
137      * is called.
138      * <p><p>
139      * Initialized inside {@link UT2004Behaviour#initializeModules(UT2004Bot)}.
140 	 */
141 	protected Senses senses;
142 	
143 	/**
144 	 * Memory module specialized on info about the bot's weapon and ammo inventory - it can tell you which weapons are loaded, melee/ranged, etc.
145 	 * <p><p>
146 	 * May be used since {@link SposhBotLogic#botInitialized(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.ConfigChange, cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.InitedMessage)}
147      * is called.
148      * <p><p>
149      * Initialized inside {@link UT2004Behaviour#initializeModules(UT2004Bot)}.
150 	 */
151 	protected Weaponry weaponry;
152 	
153 	/**
154 	 * Memory module specialized on the agent's configuration inside UT2004 - name, vision time, manual spawn, cheats (if enabled at GB2004).
155 	 * <p><p>
156 	 * May be used since {@link SposhBotLogic#botInitialized(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, ConfigChange, cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.InitedMessage)}
157      * is called.
158      * <p><p>
159      * Initialized inside {@link UT2004Behaviour#initializeModules(UT2004Bot)}.
160 	 */
161 	protected AgentConfig config;
162 	
163 	/**
164 	 * Support for creating rays used for raycasting (see {@link AutoTraceRay} that is being utilized).
165 	 * <p><p>
166 	 * May be used since {@link SposhBotLogic#botInitialized(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.ConfigChange, cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.InitedMessage)}
167      * is called.
168 	 */
169 	protected Raycasting raycasting;
170 	
171 	/**
172 	 * Creates and wraps all available commands that can be issued to the virtual body of the bot inside UT2004.
173      * <p><p>
174      * May be used since since the first {@link SposhBotLogic#botFirstSpawn(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, ConfigChange, InitedMessage, Self)} 
175      * is called.
176      * <p><p>
177      * Initialized inside {@link UT2004Behaviour#initializeModules(UT2004Bot)}.
178 	 */
179 	protected CompleteBotCommandsWrapper body;
180 	
181 	/**
182 	 * Shortcut for <i>body.getImprovedShooting()</i> that allows you to shoot at opponent.
183 	 * <p><p>
184 	 * Note: more weapon-handling methods are available through {@link UT2004Behaviour#weaponry}.
185 	 * <p><p>
186 	 * May be used since since the first {@link SposhBotLogic#botFirstSpawn(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, ConfigChange, InitedMessage, Self)} 
187      * is called.
188      * <p><p>
189 	 * Initialized inside {@link UT2004Behaviour#initializeModules(UT2004Bot)}.
190 	 */
191 	protected ImprovedShooting shoot;
192 	
193 	/**
194 	 * Shortcut for <i>body.getAdvancedLocomotion()</i> that allows you to manually steer the movement through the environment.
195 	 * <p><p>
196 	 * Note: navigation is done via {@link UT2004Behaviour#pathExecutor} that needs {@link PathHandle} from the {@link UT2004Behaviour#pathPlanner}.
197 	 * <p><p>
198 	 * May be used since since the first {@link SposhBotLogic#botFirstSpawn(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, ConfigChange, InitedMessage, Self)} 
199      * is called.
200      * <p><p>
201 	 * Initialized inside {@link UT2004Behaviour#initializeModules(UT2004Bot)}.
202 	 */
203 	protected AdvancedLocomotion move;
204 	
205 	/**
206      * Executor is used for following a path in the environment.
207      * <p><p>
208      * May be used since since the first {@link IUT2004BotController#botFirstSpawn(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, ConfigChange, InitedMessage, Self)}
209      * is called.
210      * <p><p>
211      * Initialized inside {@link UT2004BotModuleControllerNew#initializePathFinding(UT2004Bot)}.
212      */
213 	protected UT2004PathExecutor<ILocated> pathExecutor = null;
214 
215     /**
216      * Planner used to compute the path (consisting of navigation points) inside the map.
217      * <p><p>
218      * May be used since since the first {@link IUT2004BotController#botFirstSpawn(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, ConfigChange, InitedMessage, Self)}
219      * is called.
220      * <p><p>
221      * Initialized inside {@link UT2004BotModuleControllerNew#initializePathFinding(UT2004Bot)}.
222      */
223     protected IPathPlanner<ILocated> pathPlanner = null;
224     
225     /**
226      * Weapon preferences for your bot. See {@link WeaponPrefs} class javadoc. It allows you to define preferences for
227      * weapons to be used at given distance (together with their firing mode).
228      */
229     protected WeaponPrefs weaponPrefs;
230     
231     /**
232      * Navigation graph builder that may be used to manually extend the navigation graph of the UT2004.
233      * <p><p>
234      * May be used since {@link IUT2004BotController#botInitialized(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, ConfigChange, InitedMessage)} 
235      * is called.
236      * <p><p>
237      * Initialized inside {@link UT2004BotModuleController#initializeModules(UT2004Bot)}.
238      */
239     protected NavigationGraphBuilder navBuilder;
240     
241     /**
242      * Module that is providing various statistics about the bot. You may also used it to output these stats (in CSV format)
243      * into some file using {@link AgentStats#startOutput(String)} or {@link AgentStats#startOutput(String, boolean)}.
244      */
245     protected AgentStats stats;
246 
247     /**
248      * Path-planner ({@link IPathPlanner} using {@link NavPoint}s), you may use it to find paths inside the environment wihtout
249      * waiting for round-trip of {@link GetPath} command and {@link PathList}s response from UT2004. It is much faster than 
250      * {@link UT2004BotModuleController#pathPlanner} but you need to pass {@link NavPoint} instances to planner instead of
251      * {@link ILocated} ... to find the nearest {@link NavPoint} instance, {@link DistanceUtils} is a handy, check especially
252      * {@link DistanceUtils#getNearest(java.util.Collection, ILocated)}.
253      */
254 	protected FloydWarshallMap fwMap;
255 	
256 	/**
257 	 * Navigation helper that is able to get your bot back to the nearest navigation graph so you can use {@link UT2004BotModuleController#navigation} 
258 	 * without fear of catastrophe.
259 	 * May be used since {@link IUT2004BotController#botInitialized(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, ConfigChange, InitedMessage)} 
260      * is called.
261      * <p><p>
262      * Initialized inside {@link UT2004BotModuleController#initializePathFinding(UT2004Bot)}.
263 	 */
264 	protected UT2004GetBackToNavGraph getBackToNavGraph;
265 	
266 	/**
267 	 * Navigation helper that can run-straight to some point with stuck detectors.
268 	 * <p><p>
269 	 * May be used since {@link IUT2004BotController#botInitialized(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, ConfigChange, InitedMessage)} 
270      * is called.
271      * <p><p>
272      * Initialized inside {@link UT2004BotModuleController#initializePathFinding(UT2004Bot)}.
273 	 */
274 	protected UT2004RunStraight runStraight;
275 	
276 	/**
277 	 * Command module that is internally using {@link UT2004PathExecutor} for path-following and {@link FloydWarshallMap}
278 	 * for path planning resulting in unified class that can solely handle navigation of the bot within the environment.
279 	 * <p><p> 
280 	 * In contrast to {@link UT2004PathExecutor} methods
281 	 * of this module may be recalled every {@link UT2004BotModuleController#logic()} iteration even with 
282 	 * the same argument (which is not true for {@link UT2004PathExecutor#followPath(cz.cuni.amis.pogamut.base.agent.navigation.IPathFuture)}.
283 	 * <p><p>
284 	 * Note that this class is actually initialized with instances of {@link UT2004BotModuleController#pathExecutor} and {@link UT2004BotModuleController#fwMap}
285 	 * so you must take care if using add/remove stuck detectors or reinitilize this property to your liking (you can do that in {@link UT2004BotModuleController#botInitialized(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, ConfigChange, InitedMessage)} 
286 	 * method.
287 	 * <p><p>
288 	 * May be used since first {@link UT2004BotModuleController#logic()} is called.
289      * <p><p>
290      * Initialized inside {@link UT2004BotModuleController#initializePathFinding(UT2004Bot)}.
291 	 */
292 	protected UT2004Navigation navigation;
293 	
294 	/**
295 	 * Module that provides visibility/cover information for the map.
296 	 * <p><p>
297 	 * May be used since {@link IUT2004BotController#botInitialized(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, ConfigChange, InitedMessage)} 
298      * is called.
299      * <p><p>
300      * Initialized inside {@link UT2004BotModuleController#initializeModules(UT2004Bot)}.
301 	 */
302 	protected Visibility visibility;
303     
304     /**
305      * Listener registrator that probes declared methods for the presence of {@link EventListener}, {@link ObjectClassEventListener},
306      * {@link ObjectClassListener}, {@link ObjectEventListener} and {@link ObjectListener} annotations and automatically registers
307      * them as listeners on a specific events.
308      * <p><p>
309      * Note that this registrator is usable for 'this' object only! It will work only for 'this' object.
310      */
311     protected AnnotationListenerRegistrator listenerRegistrator;
312     
313     /**
314      * Shortcut for the {@link UT2004BotModuleController#getWorldView()}.
315      */
316     protected IVisionWorldView world;
317     
318     /**
319      * Shortcut for the {@link UT2004BotModuleController#getAct()}.
320      */
321     protected IAct act;
322 
323 	public UT2004Behaviour(String name, BOT bot) {
324 		super(name, bot);
325         log = bot.getLogger().getCategory(UT2004BotController.USER_LOG_CATEGORY_ID);
326         log.setLevel(Level.ALL);
327         user = log;
328 	}
329 
330 	/**
331 	 * Called after the construction of the {@link UT2004Behaviour} before the GameBots2004 greets the bot even before
332 	 * {@link UT2004Behaviour#prepareBehaviour(UT2004Bot)} method.
333 	 * <p><p>
334 	 * <b>NOTE:</b> This is Pogamut's developers reserved method - do not override it and if you do, always use 'super' 
335 	 * to call parent's initializeBehaviour.
336      */
337 	protected void initializeBehaviour(BOT bot) {
338 		initializeModules(bot);
339 		initializePathFinding(bot);
340 		initializeListeners(bot);
341 	}
342 	
343 	/**
344      * Initializes {@link UT2004Behaviour#listenerRegistrator} and calls {@link AnnotationListenerRegistrator#addListeners()} method
345      * to probe all declared methods for event-annotation presence.
346      * @param bot
347      */
348 	protected void initializeListeners(BOT bot) {
349 		listenerRegistrator = new AnnotationListenerRegistrator(this, getWorldView(), bot.getLogger().getCategory("Listeners"));
350 		listenerRegistrator.addListeners();
351 	}
352 
353 	/**
354 	 * Initializes path-finding modules: {@link UT2004BotModuleControllerNew#pathPlanner} and {@link UT2004BotModuleControllerNew#pathExecutor}.
355 	 * If you need different path planner / path executor - override this method and initialize your own modules.
356 	 * @param bot
357 	 */
358 	protected void initializePathFinding(BOT bot) {
359 		pathPlanner  = new UT2004AStarPathPlanner(bot);
360 		fwMap        = new FloydWarshallMap(bot);
361 		pathExecutor = 
362         	new UT2004PathExecutor<ILocated>(
363         		bot, 
364         		new LoqueNavigator<ILocated>(bot, 
365         		bot.getLog())
366         	);   
367 		getBackToNavGraph = new UT2004GetBackToNavGraph(bot, info, move);
368 		runStraight = new UT2004RunStraight(bot, info, move);
369 		navigation = new UT2004Navigation(bot, pathExecutor, fwMap, getBackToNavGraph, runStraight);
370 	}
371 
372 	/**
373 	 * Initializes memory/command modules of the bot.
374 	 * 
375 	 * @param bot
376 	 */
377 	protected void initializeModules(BOT bot) {
378 		world       = getWorldView();
379 		act         = getAct();
380 		game        = new Game(bot);
381 		info        = new AgentInfo(bot, game);
382 		visibility  = new Visibility(bot, info);
383 		players     = new Players(bot);
384 		descriptors = new ItemDescriptors(bot);
385 		senses      = new Senses(bot, info, players);
386 		weaponry    = new Weaponry(bot, descriptors);
387 		items       = new Items(bot, info, game, weaponry, null);
388 		config      = new AgentConfig(bot);
389 		raycasting  = new Raycasting(bot);
390 		body        = new CompleteBotCommandsWrapper(bot, weaponry, null);		
391 		shoot       = body.getImprovedShooting();
392 		move        = body.getLocomotion();
393 		weaponPrefs = new WeaponPrefs(weaponry, bot);
394 		stats       = new AgentStats(bot);
395 		navBuilder  = new NavigationGraphBuilder(bot);
396 	}
397 	
398 	/**
399 	 * Called after the behaviour construction to initialize user's data structures.
400 	 * @param bot
401 	 */
402 	protected void prepareBehaviour(BOT bot) {		
403 	}	
404 	
405 	/**
406      * This method is called whenever {@link InitedMessage} is received. Various agent modules are usable since this
407      * method is called.
408      * 
409      * @param gameInfo
410      * @param config
411      * @param init
412      * @param self
413      */
414     public void botInitialized(GameInfo info, ConfigChange config, InitedMessage init) {
415     }
416 
417     /**
418      * This method is called only once whenever first batch of information what the bot can see is received.
419      * <i><i>
420      * It is sort of "first-logic-method" where you may issue commands for the first time and handle everything
421      * else in bot's logic then. It eliminates the need to have 'boolean firstLogic' field inside your bot.
422      * <p><p>
423      * Note that this method has advantage over the {@link IUT2004BotController#botInitialized(GameInfo, ConfigChange, InitedMessage)}
424      * that you already have {@link Self} object.
425      * 
426      * @param gameInfo
427      * @param config
428      * @param init
429      * @param self
430      */
431     public void botSpawned(GameInfo gameInfo, ConfigChange config, InitedMessage init, Self self) {
432     }
433     
434     /**
435 	 * Called after {@link UT2004Behaviour#botSpawned(GameInfo, ConfigChange, InitedMessage, Self)} as a hook for Pogamut's core developers
436 	 * to finalize initialization of various modules.
437 	 * <p><p>
438 	 * <b>NOTE:</b> This is Pogamut's developers reserved method - do not override it and if you do, always use 'super' 
439 	 * to call parent's finishControllerInitialization.
440      */
441     public void finishBehaviourInitialization() {
442     	if (navBuilder.isUsed()) {
443 			log.info("Navigation graph has been altered by 'navBuilder', triggering recomputation of Floyd-Warshall path matrix...");
444 			Level oldLevel = fwMap.getLog().getLevel();
445 			fwMap.getLog().setLevel(Level.FINER);
446 			fwMap.refreshPathMatrix();
447 			fwMap.getLog().setLevel(oldLevel);
448 		}
449     }
450     
451     /**
452      * Called whenever the bot gets killed inside the game.
453      * 
454      * @param event
455      */
456 	public void botKilled(BotKilled event) {		
457 	}
458 	
459 	public IVisionWorldView getWorldView() {
460 		return bot.getWorldView();
461 	}
462 	
463 	public IAct getAct() {
464 		return bot.getAct();
465 	}
466 
467 	public UT2004GetBackToNavGraph getGetBackToNavGraph() {
468 		return getBackToNavGraph;
469 	}
470 
471 	public Visibility getVisibility() {
472 		return visibility;
473 	}
474 
475 }