[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[pygame] GSoC A* for AI



its only little time left for submiting deadline but i want to share
quickly my ideas with you about AI module and i can work for a
proposal. I red some discussions about this on the mailing list. Here
is my opinion. A* algorithm is not a very hard thing to write. Porting
it from C may make it faster but i think main question here how to
make it more usable. It should be used with minimal effort. Finding
shortest way is not as good as finding shortest way in shortest time
but algorithm or code can be healed, changed in future but usage must
be same and good. I plan to write a astar pathfinding module that is
practical to use.
something like first registering sprites or rects to module(rect
objects have coordinates and size ). Rect objects are general with all
games and this is better than creating a matrix or scanning a surface
for colorkeys.
pathfinder.register( user.rect )
pathfinder.register( enemy.rect )
pathfinder.register( house.rect )

and any time using some function like this  pathfinder.findway
(start=user.rect,dest=house.rect)
and it can return a result like node points of shortest path like
(  (12,32), (12,300), (400,300)  ) that each node consist of x and y