iDevGames Forums
Gauntlet-style bot movements - Printable Version

+- iDevGames Forums (
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Game Design (/forum-5.html)
+--- Thread: Gauntlet-style bot movements (/thread-6688.html)

Gauntlet-style bot movements - buddy - Oct 13, 2003 06:06 AM

This should be so simple...

Let's say I have 10 computer controlled ghosts on the screen.
I don't want them to be able to run one another down.
They are directly following and pursuing the main player... i.e. they turn towards the player and they move in the direction, adjusting every frame to continuously point at him.

I test all 10 ghosts for collisions with one another, so that I can keep them from runing over one another.

When I do detect a collision, I'm not sure what to do to get them to not run over each other.

If I just tell them to not move, well then eventually none of them will move (i.e. once they all bunch up next to one another and they are technically all colliding with at least one ghost)

I have had them "bounce back" a pixel or two, but this shows in a really jerky way.

Any advice?


Gauntlet-style bot movements - NCarter - Oct 13, 2003 06:46 AM

How about using the map to remember where the ghosts are? Set a flag in the map data when a ghost enters a square, clear it when it leaves, and don't allow any other ghosts to enter the same square while the flag is still set.

That way you don't have to do collision tests between every pair of ghosts, so it should be faster too.

Gauntlet-style bot movements - Steven - Oct 13, 2003 07:24 AM

Have your pathfinder take into account where the other ghosts are so that they don't collide in the first place...

Gauntlet-style bot movements - szymczyk - Oct 13, 2003 08:18 PM

For group movement, look into the flocking technique. It tries to emulate the way a flock of birds flies. The head bird (or ghost in your case) moves toward the player, and the other birds follow the one in front of them. Craig Reynolds wrote a paper on it that you can download from the Web, and there's an article about it in the book Game Programming Gems.

Gauntlet-style bot movements - Jason Colman - Oct 14, 2003 03:15 AM

Yeah, Craig Reynolds rocks. He has a bunch of java examples of behaviours. Check out It sounds like the "Queuing" behaviour would prevent your bots from bunching up and blocking each other.
But I'm sure Gauntlet itself had a very coarse grid of allowable positions, like 20*30 or so. So you just need an array of these positions, and only move a bot into a space if it's free. As you iterate over all the bots in successive frames the bots at the front will move, so the ones behind can move forward, etc. I think I'm just repeating what NCarter said. Oh well :?: