[Pogamut-list] mapping bot

jakub.gemrot pogamut-forum at artemis.ms.mff.cuni.cz
Wed Sep 10 08:44:38 CEST 2008


Re: Re: mapping bot
Hi cazub, welcome to the forum!

Right now A* can't be rely on ... I advise you to use gameMap.pathManager to deal with running along the path, use GameBots2004 GETPATH (via gameMap.pathManager):

gameMap.pathManager.retrievePathGB()

Call it iteratively until PATH_FOUND is returned.

When the path is successfully retrieved, you may then use:

gameMap.pathManager.getPath() to get the list of points where to run to, or simply use

gameMap.pathManager.runAlongPath() ... call it iteratively and checks its result. I also advise you to checkout the latest source code

svn://artemis.ms.mff.cuni.cz/pogamut/trunk

And check the code inside pathManager.runAlongPath() and change it - it's not perfect and after all it's the most cruicial method when coding the bot. To do it simply do this:

create:

class MyGameMap extends GameMap {
public MyGameMap(Logger logger, AgentBody body, AgentMemory memory) {
 super(logger, body, memory);
 pathManager = new MyPathManager();
}

class MyPathManager extends PathManager {
public MyPathManager(GameMap gameMap, AgentBody body, Logger platformLog) {
 super(gameMap, body, platformLog);
}

public RunResult runAlongPath() {
... provide own implementation ... based probably on our code as you will find neccessary to have that many local fields to successfully run along path ...
}

}

Then inside the constructor of your agent write gameMap = new MyGameMap();


Cheers! Let me know if you need any more help.

Jakub



----

Reply Link: <https://artemis.ms.mff.cuni.cz/pogamut/tiki-view_forum_thread.php?forumId=6&comments_reply_threadId=228&comments_parentId=222&post_reply=1#form>





More information about the Pogamut-list mailing list