Advertisement

A*Pathfinding with PHP?

Started by July 19, 2009 05:32 PM
1 comment, last by phresnel 15 years, 4 months ago
What would be the best refrence to help me code a*pathfinding in php. I only want forward and sideways paths. no diagnols movement.
Coding Samples :: Tips :: Discussions :: Game Directory => Game Makers Forums Online RPG Creator
I haven't ever needed to bother with advanced data structures in php, but I'm thinking they might not have the types of structures you would need to hold the nav grid, the open and closed lists, etc. Also, does php support recursion? If they DO have those data structures, then it would be the same process as most any other A* implementation.

Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play

"Reducing the world to mathematical equations!"

Advertisement
Quote: Original post by InnocuousFox
I haven't ever needed to bother with advanced data structures in php, but I'm thinking they might not have the types of structures you would need to hold the nav grid, the open and closed lists, etc.


There are PHP4 classes, there are PHP5 classes, then PHP has arbitrary dimensional, associative arrays. So no problem from that side.

Quote: Also, does php support recursion?

You don't want to know what PHP has in its entirety ;) As a little hint: I wrote a ray tracer in PHP once, though I haven't published it, as I continually postponed release as for some really ugly code. Plus, the nitpicker in me wants to say that recursion can be transormed to iteration, and vice versa :D


Quote: If they DO have those data structures, then it would be the same process as most any other A* implementation.

Yes. For kicks, you could also implement compile time A* in C++.

[Edited by - phresnel on July 20, 2009 9:02:52 AM]

This topic is closed to new replies.

Advertisement