<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Jun 3, 2017 at 2:23 AM, 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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On 3 June 2017 at 15:50, James Paige <span dir="ltr"><<a href="mailto:Bob@hamsterrepublic.com" target="_blank">Bob@hamsterrepublic.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span><br><br>On Friday, June 2, 2017, Ralph Versteegen <<a href="mailto:teeemcee@gmail.com" target="_blank">teeemcee@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 3 June 2017 at 07:02,  <span dir="ltr"><<a>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><div>You didn't notice that I added v_heappush and v_heappop?<br><br></div></div></div></div></blockquote><div><br></div></span><div>I noticed, but wasn't sure what to do with them.</div></blockquote><div><br></div></span><div>OK, I'll modify the code to make use of them.<br></div><div>I purposefully made them almost identical to the functions of the same name from the heapq python module. The only differences are that you can specify a compare function, and that heappop doesn't return the item it popped, because that's impossible (unless it was moved to a temporary location and returned byref, I guess...)<br></div><div></div></div></div></div></blockquote><div><br></div><div>I went and read the python heapq docs a bit, so now I think I understand better what is going on. Thank you :)<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><span><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><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></span><div>Oh, yes! You are right. The A* reference article I was working from even told me to do that, but I totally forgot. Thanks!</div><div><br></div><div>You know, I'll bet I had the same problem in my python A* implementation for Bob the Hamster Dirt Dig. That sounds like exactly the sort of thing I would do twice ;)</div><div><br></div><div>---</div><div>James</div><div> </div>
<br></span><span class="">______________________________<wbr>_________________<br>
Ohrrpgce mailing list<br>
<a href="mailto:ohrrpgce@lists.motherhamster.org" target="_blank">ohrrpgce@lists.motherhamster.o<wbr>rg</a><br>
<a href="http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org" rel="noreferrer" target="_blank">http://lists.motherhamster.org<wbr>/listinfo.cgi/ohrrpgce-motherh<wbr>amster.org</a><br>
<br></span></blockquote></div><br></div></div>
<br>______________________________<wbr>_________________<br>
Ohrrpgce mailing list<br>
<a href="mailto:ohrrpgce@lists.motherhamster.org">ohrrpgce@lists.motherhamster.<wbr>org</a><br>
<a href="http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org" rel="noreferrer" target="_blank">http://lists.motherhamster.<wbr>org/listinfo.cgi/ohrrpgce-<wbr>motherhamster.org</a><br>
<br></blockquote></div><br></div></div>