I've got a few tips to improve speed:
-Give the nodes an open and closed lists boolean flags so the lookup for "is in open" is O(1) (you can now even get rid of the closed list).
-Use integers for scores rather than floats. (diagonal movement is usual 1.4x the cost of orthogonal movement, so make the standard costs 14(dia) and 10(ortho)).
-Use a MinHeap for the openlist.
This should make your implementation a lot faster. You can have a look at my sample code:
http://roy-t.nl/index.php/2009/07/07/new-version-a-pathfinding-in-3d/ but I think it would be faster to change your existing code with some speed ups you find usefull. than to change to my "not so elegant and pluggable" version.
My implementation takes an average of 1.7ms on 10x10x10 grid. Although this was not a maze but a randomly constructed 3d grid I think you should be able to get your code down to taking at most 10ms to find a path.
(This is really handy because it means you might not have to spawn a seperate thread for pathfinding, an extra 50ms would really disrupt the game loop, but an extra 10ms might not be noticeable enough to need an extra pathfinding thread, as long as you only try to find one path per iteration).
Anyway I hope these are some useful tips! Oh and btw, you've been featured on http://www.sgtconker.com !
]]>There are also similar delegates which are similar Action, Action, etc are used the same as Func except where no return value is required
Predicate used when you want a function that compares and return true or false based on the comparison (Pretty much the same as Func, except it's just Predicate :))
Delegates are useful things 😀
]]>