A to B via Z
October 12, 2008 5:05 AM   Subscribe

Can anyone direct me to some good sources of algorithms or tutorials that will help me to creater something somewhat more complex than a 2D particle system?

I can already create a 2D particle system (balls colliding with and rebounding from each other and from enclosing walls). And there are plenty of examples and tutorials for that kind of thing, so that's not what I'm looking for.

What I am looking for are resources that will help me to develop something more complex, where the objects are 'simulated creatures'. I've created a couple of prototypes already, but they're really not up to scratch. Here's a list of the things the simulation needs to do:

1. Creatures normally move about at random within a set of boundaries. They mostly move in straight lines but sometimes pause for a while or change direction.

2. When creatures collide with other creatures (or boundaries), they turn and move off in a new, random direction (one that takes them 'away' from the collision.

3. (and this is where my problems start) Creatures can be directed to go to a particular point, and will find their way to that point, either directly or by going around obstacles (including other creatures).

Is basing my approach on a particle system the right way to go about this? Would it be better to switch to a tile-based system and try to use something like an A* pathfinding algorithm? I'm really looking for some resources that adopt a 'hand-holding' approach, as my games-programming skills are somewhat limited.
posted by le morte de bea arthur to Computers & Internet (3 answers total) 1 user marked this as a favorite
A* on a grid system is probably easier than pure vector path-finding. If you are a noob you might avoid the vector stuff for now (at the cost of constrained movement along grid lines)
posted by sandking at 5:58 AM on October 12, 2008

This may help.
posted by grumblebee at 7:33 AM on October 12, 2008

Response by poster: Well, no best answer excatly, although they were both helpful. grumblebee's link in particular proved to be fascinating reading. In the end I went for a system of repulsive forces combined with attraction to destination points and some boundary restrictions. It works pretty well for what I'm simulating (chickens moving around in a yard, as it happens). Thanks again for the input.
posted by le morte de bea arthur at 2:23 AM on November 12, 2008

« Older Tonkotsu Ramen search: calling all London ramen...   |   What proportion of couples in relationships shower... Newer »
This thread is closed to new comments.