<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 3 June 2017 at 15:28, Ralph Versteegen <span dir="ltr"><<a href="mailto:teeemcee@gmail.com" target="_blank">teeemcee@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="gmail-">On 3 June 2017 at 07:02,  <span dir="ltr"><<a href="mailto:subversion@hamsterrepublic.com" target="_blank">subversion@hamsterrepublic.co<wbr>m</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">james<br>
2017-06-02 12:02:15 -0700 (Fri, 02 Jun 2017)<br>
50<br>
Pathfinding now breaks ties with distance squared<br>
---<br>
U   wip/pathfinding.bas<br>
U   wip/<a href="http://pathfinding.bi" rel="noreferrer" target="_blank">pathfinding.bi</a></blockquote><div><br></div></span><div>You didn't notice that I added v_heappush and v_heappop?<br><br></div><div>Also, I didn't notice before that your cost_before_node function is insane. You need to store the cost of the node in the node, not recompute it constantly. That is why pathfinding is so incredibly slow.<br></div></div></div></div></blockquote><div><br></div><div>(That, and the use of v_sort, which amplifies the problem)<br><br></div><div>Also, the result of guess_cost_after_node should also be stored in the node.<br></div><div><br></div><div>Also, why did you make _pathfinder_obj a global instead of a file-local (shared) variable?<br><br></div><div>Also, you could get rid of  _pathfinder_obj altogether, by storing cost_a/cost_b from close_node_compare/open_node_compare in the node as well, to avoid recomputing that too. This has its own costs, but FB does squaring using floating point and pow(), so avoiding doing that repeatedly should also be a good improvement.<br></div></div><br></div></div>