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

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



Magnus Lie Hetland wrote:

> It seems to me that if you want performance, perhaps a full A* is a
> bit general? Or, at least, how about doing some preprocessing, or
> adding some constraints on the terrain generation or something? After
> all, once you have any kind of information about your problem domain,
> you can probably do better than in the general case.

I already do a bit of preprocessing. I assume a static map and
pre-calculate all the terrain costs. I just stick them in a 2D list at
the moment. I do a couple other small optimizations that aren't in full
A*. And I am thinking about some game specific optimzations to add
later.

My goal is to get a base that's as fast as possible, while still being
understandable, from which to work off. Thus I'm messing around with
various ways of optimizing it as a general algorithm. I hope more people
will find useful this way. I am 'planning' on doing a series of various
AI tools like this (eg. influence maps, flocking algorithms, etc).

-- 

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