Re: [pygame] Pathfinding

2009-01-26 Thread Marius Gedminas
On Sun, Jan 25, 2009 at 07:16:38PM -0800, Yanom Mobis wrote: 1) How is pathfinding done? There are algorithms for it. Breadth-first search is the simplest one and works well for grids where the distance between nearby cells is the same. Dijkstra is a generalization that works for arbitrary

Re: [pygame] Pathfinding

2009-01-26 Thread evil monkey
I used this AStar in some of my games, and it works very well: http://www.pygame.org/projects/9/195/ On Sun, 25 Jan 2009 19:16:38 -0800 (PST) Yanom Mobis ya...@rocketmail.com wrote: 1) How is pathfinding done? 2) How do you prevent a moving sprite from being caught in a v-shaped rut made

Re: [pygame] Pathfinding

2009-01-26 Thread Michael George
Marius Gedminas wrote: My personal snag with A* is that the NPCs seem to know too much about the map and directly walk the most optimal path without exploration. One possibility to solving this is to have the npc move as it's performing the algorithm. i.e. as your search explores a path,

Re: [pygame] Pathfinding

2009-01-26 Thread Jake b
This is the best A* Pathfinding tutorial, ever: http://theory.stanford.edu/~amitp/GameProgramming/http://theory.stanford.edu/%7Eamitp/GameProgramming/ -- Jake

Re: [pygame] Pathfinding

2009-01-26 Thread John Eikenberry
evil monkey wrote: I used this AStar in some of my games, and it works very well: http://www.pygame.org/projects/9/195/ I wrote an A* implementation awhile back for civil that might make another good example. Mine is a little different from the others I've seen as it can handle a few

Re: [pygame] Pathfinding

2009-01-26 Thread Brian Fisher
On Sun, Jan 25, 2009 at 7:16 PM, Yanom Mobis ya...@rocketmail.com wrote: 1) How is pathfinding done? So what are your pathfinding needs? what exactly is the character or game element that you need pathfinding for doing? or is this just research for you? On Mon, Jan 26, 2009 at 12:53 AM, Marius

Re: [pygame] Pathfinding

2009-01-26 Thread Michael George
Brian Fisher wrote: On Mon, Jan 26, 2009 at 9:01 AM, Michael George mdgeo...@cs.cornell.edu mailto:mdgeo...@cs.cornell.edu wrote: One possibility to solving this is to have the npc move as it's performing the algorithm. i.e. as your search explores a path, the character walks along that

Re: [pygame] pygame.midi using portmidi?

2009-01-26 Thread René Dudfield
Hi, this notes a patch for 10.5sdk http://lists.create.ucsb.edu/pipermail/media_api/2009-January/000703.html Also found a section on OSX here: http://cratel.wichita.edu/cratel/cratel_pyportmidi Also, have you tried the .c test programs that come with portmidi? cheers, On Sun, Jan 25, 2009 at

Re: [pygame] Pathfinding

2009-01-26 Thread Mike C. Fletcher
John Eikenberry wrote: evil monkey wrote: I used this AStar in some of my games, and it works very well: http://www.pygame.org/projects/9/195/ ... http://zhar.net/projects/gameai/ There are a few other python implementations of A* that I know of as well. They are also linked to

Re: [pygame] Pathfinding

2009-01-26 Thread René Dudfield
hi, the pygame.org page has a few pathfinding things here: http://pygame.org/tags/pathfinding Also, using the google search of the pygame website, you can find games that also use pathfinding in them. A lot of the classic algorithms are represented... Dijkstra's, A*, and breadth first.

Re: [pygame] Pathfinding

2009-01-26 Thread Yanom Mobis
it seems to me that A* only works on tile-based games. What if my game isn't tile-based? --- On Sun, 1/25/09, Noah Kantrowitz n...@coderanger.net wrote: From: Noah Kantrowitz n...@coderanger.net Subject: Re: [pygame] Pathfinding To: pygame-users@seul.org Date: Sunday, January 25, 2009, 9:20 PM

Re: [pygame] Pathfinding

2009-01-26 Thread Yanom Mobis
I need to have an npc take a relatively short route from a to b. First priority isn't the shortest distance, it's getting there without getting stuck My game is in a futuristic setting, so taking the shortest path without exploring too much    is reasonable because they would have GPS and the

Re: [pygame] Pathfinding

2009-01-26 Thread Douglas Bagnall
Yanom Mobis wrote: I need to have an npc take a relatively short route from a to b. First priority isn't the shortest distance, it's getting there without getting stuck My game is in a futuristic setting, so taking the shortest path without exploring too much is reasonable because

Re: [pygame] Pathfinding

2009-01-26 Thread NBarnes
it seems to me that A* only works on tile-based games. What if my game isn't tile-based? A* works on 'nodes', where a node is just some location defined in the game space. Tile-based games have a very obvious node structure to them, and so A* is very easily adapted to them. But, really,

RE: [pygame] Pathfinding

2009-01-26 Thread Noah Kantrowitz
You need to construct a graph of possible paths. In a tile-based game this is easy, but it can be done in other kinds of games the same technique can be applied. A* is also used in other types of AIs, such a many board games. As for doing pathfinding in 3D worlds or similar, the word complex is a

Re: [pygame] Pathfinding

2009-01-26 Thread Bill Coderre
On Sun, Jan 25, 2009 at 09:13:28PM -0800, Bill Coderre wrote: There are still ways that this can get confused or beaten, of course. Until someone comes out with a low-cost traveling-salesman solver, however, whatever algorithm you find will have some snags. On Jan 26, 2009, at 12:53 AM,

Re: [pygame] Pathfinding

2009-01-26 Thread Joe Strout
Yanom Mobis wrote: it seems to me that A* only works on tile-based games. What if my game isn't tile-based? I'm not sure you think that. A* (or any other pathfinding algorithm) will work for any search tree. You do need some sort of heuristic, though, that estimates how far any given

Re: [pygame] Pathfinding

2009-01-26 Thread Kris Schnee
Yanom Mobis wrote: 1) How is pathfinding done? 2) How do you prevent a moving sprite from being caught in a v-shaped rut made of obstacles? Like this: __ A - # | B __| Others have already talked about the A* Algorithm

RE: [pygame] Pathfinding

2009-01-26 Thread Yanom Mobis
a graph, as in just a regular x, y kind of thing? I don't need an overly complex library, is something less complex available? --- On Mon, 1/26/09, Noah Kantrowitz n...@coderanger.net wrote: From: Noah Kantrowitz n...@coderanger.net Subject: RE: [pygame] Pathfinding To: pygame-users@seul.org

Re: [pygame] Pathfinding

2009-01-26 Thread Yanom Mobis
Complex distance evaluation isn't necessary, but the sprite never getting stuck is. --- On Mon, 1/26/09, Joe Strout j...@strout.net wrote: From: Joe Strout j...@strout.net Subject: Re: [pygame] Pathfinding To: pygame-users@seul.org Date: Monday, January 26, 2009, 6:11 PM Yanom Mobis wrote:

Re: [pygame] Pathfinding

2009-01-26 Thread Yanom Mobis
My game isn't tile-based (probably, I haven't made it yet), but it is 2-d --- On Mon, 1/26/09, NBarnes nbar...@gmail.com wrote: From: NBarnes nbar...@gmail.com Subject: Re: [pygame] Pathfinding To: pygame-users@seul.org Date: Monday, January 26, 2009, 6:10 PM it seems to me that A* only works

Re: [pygame] Pathfinding

2009-01-26 Thread René Dudfield
A graph, as in one from graph theory: http://en.wikipedia.org/wiki/Graph_theory On Tue, Jan 27, 2009 at 12:12 PM, Yanom Mobis ya...@rocketmail.com wrote: Complex distance evaluation isn't necessary, but the sprite never getting stuck is. --- On Mon, 1/26/09, Joe Strout j...@strout.net

RE: [pygame] Pathfinding

2009-01-26 Thread Noah Kantrowitz
http://en.wikipedia.org/wiki/Graph_(mathematics) http://en.wikipedia.org/wiki/Graph_(mathematics) If you are unclear on what a graph is, I wouldn't recommend trying to write a pathfinding system youself. Perhaps try something higher-level or a library that includes one. --Noah From:

Re: [pygame] Pathfinding

2009-01-26 Thread Joe Strout
Yanom Mobis wrote: Complex distance evaluation isn't necessary, but the sprite never getting stuck is. The sprite will never get stuck with any of the algorithms we have discussed. And you're right, you don't need a complex distance evaluation for A* -- a simple one will do. (Though the

Re: [pygame] Pathfinding

2009-01-26 Thread Yanom Mobis
so is A* the easiest to use? --- On Mon, 1/26/09, Joe Strout j...@strout.net wrote: From: Joe Strout j...@strout.net Subject: Re: [pygame] Pathfinding To: pygame-users@seul.org Date: Monday, January 26, 2009, 8:14 PM Yanom Mobis wrote: Complex distance evaluation isn't necessary, but the

[pygame] Python 2.5.4

2009-01-26 Thread Yanom Mobis
is it possible to install python2.5.4 on top of 2.5.2 ( ./configure make sudo make install ) on Linux? Will this break any packages?

Re: [pygame] Python 2.5.4

2009-01-26 Thread René Dudfield
yes it will break packages On Tue, Jan 27, 2009 at 2:23 PM, Yanom Mobis ya...@rocketmail.com wrote: is it possible to install python2.5.4 on top of 2.5.2 ( ./configure make sudo make install ) on Linux? Will this break any packages?

Re: [pygame] Pathfinding

2009-01-26 Thread Joe Strout
Yanom Mobis wrote: so is A* the easiest to use? They're all about the same; they differ only in what order new nodes are examined. If you have a cost function (which you do), you can do a least-cost search. If you also have a heuristic (which I think you do), you can do A*. They'll both

Re: [pygame] Pathfinding

2009-01-26 Thread Jake b
Have you played any of the unreal tournament games? The way it pathfinds is like what you're asking. It uses a graph ( a bunch of nodes connecting to each other. It actually pre-calculates pathfinding, but you don't need to worry about that at first ) The link posted has a good image:

Re: [pygame] Python 2.5.4

2009-01-26 Thread Lenard Lindstrom
Minor Python versions are simply bug fixes. Python 2.5.4 libraries are intended as drop-in replacements for those of 2.5.2. Extension modules compiled and linked against 2.5.2 will also work with 2.5.4. So unless Linux version control is so finicky as to operate on the minor version level it