[Pogamut-list] Navigation path problem

Jakub Gemrot jakub.gemrot at gmail.com
Wed Jul 20 12:31:36 CEST 2011


Hi!

Yes, unfortunatelly pathPlanner is using underlying "UT2004 A*
Algorithm" that won't return path that is longer than 24 path nodes
(== navigation points).

fwMap is good if: you need to run between navpoints only

pathPlanner is needed when: you need to run to some arbitrary location
... but you have to watch out for long paths.

Personally, I always test "where am I" when pathExecutor stops (either
due to error in navigation or reaching the target),
just to be sure that I'm in the position == state I wanted ... if not,
try to recover.

Regarding premade methods, check out DistanceUtils class, I think it
does what you need.

E.g.: DistanceUtils.getNearest(world.getAll(NavPoint.class).values(),
info.getLocation()) will return nearest navpoint to you.

Also if I remember correctly, there is a info.getNearestNavpoint() method.

Chees!

Jakub

On Wed, Jul 20, 2011 at 10:56 AM, Sören Dierkes
<soeren.dierkes at informatik.uni-oldenburg.de> wrote:
> Ok it works with fwMap:
>
> pathExecutor.followPath(fwMap.computePath(getNearestNavPoint(bot.getLocation()),
> item.getNavPoint()));
>
> is there an existing method to get the nearest navpoint?
> I wrote now an own one, could be inefficient ;-)
>
> Am 20.07.2011 10:10, schrieb Soeren Dierkes:
>> Hello Jakub,
>>
>> first of all thanks to you, that you :)
>> I used pathExecutor until now like this:
>>
>> item =
>> DistanceUtils.getNearest(items.getSpawnedItems(ItemType.FLAK_CANNON).values(),
>> info.getLocation());
>> pathExecutor.followPath(pathPlanner.computePath(bot, item.getLocation()));
>>
>> with those lines I got the error wich I mentioned already.
>> Now I tried it with:
>>
>> pathExecutor.followPath(pathPlanner.computePath(bot, item.getNavPoint()));
>>
>> and he runs until pathnode 24 but not until the weapon spot?
>> I'll try it with fwMap shortly, just want to know why this happens :)
>>
>> Sören
>>
>> PS: I am using Pogamut 3.2.0
>>
>> Am 19.07.2011 19:48, schrieb jakub.gemrot:
>>> Re: Navigation path problem
>>>
>>> Author: jakub.gemrot
>>>
>>> Hi!
>>>
>>> I'm sorry, we've got a "works for me" situation here:
>>>
>>> Using code: pathExecutor.followPath(pathPlanner.computePath(info.getLocation(), endNavPoint));
>>>
>>> Between navpoints: "DM-DE-Ironic.PlayerStart7",      "DM-DE-Ironic.InventorySpot108"
>>>
>>> And it is working just fine.
>>>
>>> Please send me two navpoints between which you can't navigate. And please, try to experiment with "fwMap" as well!
>>>
>>> Btw, Sören, which version of Pogamut are you using?
>>>
>>> Cheers!
>>> Jakub
>>>
>> _______________________________________________
>> Pogamut-list mailing list
>> Pogamut-list at amis.mff.cuni.cz
>> https://artemis.ms.mff.cuni.cz/mailman/listinfo/pogamut-list
>
> _______________________________________________
> Pogamut-list mailing list
> Pogamut-list at amis.mff.cuni.cz
> https://artemis.ms.mff.cuni.cz/mailman/listinfo/pogamut-list
>



More information about the Pogamut-list mailing list