![]() |
a much faster version of waypoint checking code.
PHP Code:
|
Re: a much faster version of waypoint checking code.
sometimes it may be useful to describe the functionality of some piece of posted code in a few sentences ...
this is a version of this podbot function checking paths before saving, to avoid whatever, right ? that stuff that can be found in every forum to be ignored by nocheck ? :P here a fast way to check if there is a near waypoint, can also be found in http://www.lampel.net/johannes/joebo...XPDoc-beta.pdf PHP Code:
|
Re: a much faster version of waypoint checking code.
here's a bit of explanations on the code above...
the original POD-Bot uses Floyd-Warshall algorithm to find all paths between all nodes... but this is just not necessary: 1. we needn't find the shortest path, finding a random path is enough 2. have you noticed that POD-Bot only reports "path broken from 0 to n" or "from n to 0" ? so actually we only need to verify connections between waypoint nr. 0 and the other waypoints I just do a traverse in the waypoint graph with Depth-first Search. because I'm lazy, I used the std::vector. you can try using a linked list instead if you don't want to use standard library. |
Re: a much faster version of waypoint checking code.
just a note : linked list and std:vector is a bit difference, since vector allows you very fast random access, while a linked list ( without additional tables ) does not
|
Re: a much faster version of waypoint checking code.
thanks Whistler :)
It definately feels faster on my slow comp :) |
Re: a much faster version of waypoint checking code.
ooo can i test it plzzzzzzzzzzzzzzzzzzz...(just emai it to huntakillaz at gmail)
my super slow comp should be good for this :D |
Re: a much faster version of waypoint checking code.
Quote:
|
All times are GMT +2. The time now is 07:30. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.