![]() |
what's your pathwalking algorithm
Hi guys
I was wondering... what's your pathwalking algorithm like ? I mean, right after the pathfinder returned a path, be it a linked list or an array of waypoints, how do you put your bots into movement ? How do you detect if a path fails (the bot falled down a pit or whatever), or if it's time to head up to the next waypoint ? Do you allow your bot to "skip" waypoints in the path ? Where do you make it look at ? I'm currently asking all these things because I wonder if it wouldn't be more natural to make the bot walk directly towards the furthest visible "waypoint" each time instead of making it follow the whole series. Or if not walk, at least look at. Lots of things like that. What do you think ? |
Re: what's your pathwalking algorithm
Since my nodes are close to each other, i force the bots to walk to each of them. This to ensure the path is valid, because i cannot tell if 2 nodes out of reach actually are reachable (even though they are 'visible' with 1 tracehull).
I let my bots just face body to the waypoint and run to it. Whenever something blocks it (due the bot falls in a pit i could not somehow detect , or due false connecting nodes) the bot will get stuck, when that is true i begin doing some checks. I do never skip waypoints. Perhaps checking if the distance to waypoint grows instead of getting smaller can make things neater, but it also is dangerous, like when going on a 180 degree corner, you should do a traceline thingy for this, but even then it is not water proof. FYI, i have posted the relevant path_walk function of RB BUILD 2049 Code:
// Walk the path Neo |
Re: what's your pathwalking algorithm
om** what a long function, mine is 5 times shorter !!! :D
the bit to get stuck bots to unstuck each other is well thought anyway :) BTW thanks, I just realized why I shouldn't let my bots skip navnodes at all. I'll keep optimizing the current method and I'll post my BotWalkPath() function once it'll be correctly debugged. |
Re: what's your pathwalking algorithm
I dont skip waypoints neither ... but you know, the practical things of joebot xp are still very beta ...
Code:
void CBVNP_HLDM_MovePath::evaluate(list<CGoal> *pGoals,CPerceipt* p){ and for avoid getting stuck it's until now just this, but there are already structures to handle connections which are often not usable, so the pathfinder can take this into account. Code:
void CBVNP_HLDM_AvoidStuckWP::evaluate(list<CGoal> *pGoals,CPerceipt* p){ |
Re: what's your pathwalking algorithm
I just want to say, WOAH. You thought about this a hell of a lot more than I did. Nice...
Phreak |
Re: what's your pathwalking algorithm
Hmm I'm using A* algorithm for finding paths.
My bots are auto-waypointing, cause my task is to develop an "highly intelligent" 8D bots and navmeshes are cheating IMO because bot's will create them from map file and not from "seeing" and "exploring" After path is found, it is returned in array (array of pointers to my CWaypoint class). Bot than go to first waypoint in array (actually last waypoint, cause path is upside down in my array) and when he came there, he goes to another waypoint in array. I have a FIFO stack in bot's "Navigation Cognitive subsystem" and I place there tasks what bot should do (go there, connect this waypoint with this, create waypoint there) and one of task is GOPATH which is : take first waypoint from path, go there and place new GOPATH task into stack where new path does not have waypoint you are going to now. o_O My bot auto-waypoined de_aztec an created about 800 waypoint (this is early stage of my auto-waypointing technique, I plan to reduce count of waypoints to max 500 (by merging waypoints into larger). With this waypoint count, 'random' A* pathfinding never took more than 15ms (I was checking this by ::GetTickCount() windows API function. It was either 0 or 15, strange :|) I want to ask those who work with A* if this is fast or slow. The path can't fail (It stands and falls on waypoints). If it fails from whatever reason (example New Round while bot walking along path) my stack in navigation subsystem is 'flushed' so path is forgotten. -- Jozef Wagner |
Re: what's your pathwalking algorithm
15ms ... on what kind of hardware ?
getTickCount isnt the best choice, since it's normally using a counter which is running at @ 1Mhz I think ... so no good choice. use something like this to read the number of cpu cycles instead. then you need of course to clean the result from effects of your multitasking environment Code:
_int64 CTime::getTime(){ |
Re: what's your pathwalking algorithm
2GB Athlon (1.6 real), 512RAM, 100fps in CS
I thing that 15ms values are due to some background program in my OS, 'cause it is never 14ms or 16ms, only 0 or 15. I used the function you posted here. Does it return the number of cpu cycles or what ? I get most of time < 100000 but sometimes I get more than milion (always 0 with ::GetTickCount). When I get 15 with GetTickCount, I get more than 10 milions obviously o_O thanx for help |
Re: what's your pathwalking algorithm
yes, it returns the number of cpu cycles elapsed from starting the cpu ... you have of course to check your cpu frequency to make sensemaking measurements ...
argh, no attaching of cpp files allowed .... |
Re: what's your pathwalking algorithm
darn, I gotta have a look in the config panel of this forum to see if we can attach .cpp and .dsp files :)
|
All times are GMT +2. The time now is 13:53. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.