A* works with any topography. The nodes you create should represent the complete, discrete state at any one stage in the puzzle; and you must be able to provide a heuristic which guesses the cost of changing from one state to each of the possible adjacent states.

For a grid topology, the state can be very easily represented as a coordinate (x, y), and the adjacent states are likewise very easy to find, as they're the set of 8 coordinates surrounding (x, y). Likewise the cost is generally very easy to computed, based on some arbitrary "difficulty" of traversing the map at that point. Some states won't be possible because there's a wall in that map grid. The goal state is simply a node with the desired x,y coordinate. The SPGL AStarInt algorithm is optimised for simple tile maps and 2D grids.

It starts getting more interesting when you stop representing the world as a grid. A state in 3D would most likely consist of an approximate coordinate in space (given by x, y, z, r for example). The surrounding states would be perhaps generated by casting rays from that point in different directions. The goal state would be to be within a certain range of a goal coordinate gx, gy, gz.

The cost of getting from x1,y1,z1 to x2,y2,z2 would be dependent on your physics model. Going down is always easier than going up when there's gravity involved, so you might guess the cost of a route as being the distance in the 2D plane, plus a factor times the height if the height needs to be increased.

The SPGL algorithm is the basic A* algorithm. All the cleverness comes from your heuristics and choice of adjacent node states.

Cas