[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pygame] Does anyone have a python implementation of A*?




I've been working on an A* for civil. Its not organized as well as it
could be at the moment, but I'm currently in the middle of optimizing
it.  I've done some work to make it more generic, with distance cost
algorithms for both square based and hex based maps. Its based primarily
off Amit Patel's great site.

I'll put it up somewhere on my site this weekend and let you know.


BTW, have you done much performance testing on your version of A* Danny?

My current implementation takes about 1 second (with profiling on) to
find a path ~100 steps long on a 128x128 map with randomly generated
terrain. This is with C implementations of the distance cost algorithm
and static terrain. 

Danny Yoo wrote:

> On Thu, 14 Feb 2002, Chris McCormick wrote:
> 
> > Hello all,
> >    I am working on a pretty simple little game, which is sort of a
> > cross between an RPG and a world simulation.  I want my NPC's to
> > navigate around obstacles, and I have found some web resources on the
> > A* algorithm.  Unfortunately, the C code is pretty unintelligible to
> > me.  Has anyone done something similar in a Python project?  Seeing
> > some code, or even pseudocode, would be a great help.
> 
> Here you go:
> 
>     http://hkn.eecs.berkeley.edu/~dyoo/python/
> 
> Go down near the bottom, and you should see something about A*.  Hope this
> helps!
> 
> ____________________________________
> pygame mailing list
> pygame-users@seul.org
> http://pygame.seul.org

-- 

John Eikenberry
[jae@zhar.net - http://zhar.net]
______________________________________________________________
"They who can give up essential liberty to purchase a little temporary
 safety, deserve neither liberty nor safety."
                                          --B. Franklin
____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org