Forum: PogamutUT2004

Editing Nav Graph

I know that the latest version of Pogamut supports editing the nav graph given to the bot by UT. If I wanted to edit the nav graph for a specific level, what would be the best way to do it? At what point in the bot setup (which of the start up methods) should I do it? My general plan is to use the GameBots debug options to walk through the levels and identify specific nav points whose links I want to delete. Then in the bot initialization (wherever I should do this), I'll see if the current level is the one whose graph I want to edit, and then call a sequence of edit commands.

Can I get some help with this?
Hi! Sure :-)

Are you aware of NavigationGraphBuilder class? It is hidden under "navBuilder" field in the UT2004BotModuleController.
It is meant to be used inside botInitialized() method where you may alter the nav-graph arbitrarily.

You may:

1) alter existing nodes / links
2) add/remove nodes/links completely

Please read javadocs for that: http://diana.ms.mff.cuni.cz/maven-sites/pogamut/3.3.1-SNAPSHOT/pogamut-ut2004/apidocs/cz/cuni/amis/pogamut/ut2004/agent/module/sensor/NavigationGraphBuilder.html

Note that these operations are working directly with NavPoint.getOutgoing/IncomingEdges, thus they are irreversible.
Also note that these operations are JVM-only, they are NOT propagated to UT2004 so they are used only by FloydWarshallMap
implementation. FWMap will pick-up your modifications automatically after botInitialized() ... later changes can be propagated
by calling: http://diana.ms.mff.cuni.cz/maven-sites/pogamut/3.3.1-SNAPSHOT/pogamut-ut2004/apidocs/cz/cuni/amis/pogamut/ut2004/agent/navigation/floydwarshall/FloydWarshallMap.html#refreshPathMatrix%28%29

I've been able to create new navpoints/links on DM-1on1-Albatross so my bot jumped for quad-dmg on the tower (with a few tweaks to
the path-following I admit, but fwMap was able to find the way to it).

Cheers!
Jakub