Using A * and yet avoiding collisions?

I am developing a tower defense game, and for this I am using the A * search algorithm to achieve a goal from my appearance areas.

The problem is that all the blocks of the stack that do not look visually good. Is there a way that I can make them somehow a group, and spread more if there is not enough space?

The algorithm works so that all units move a single plate at a time.

+5
source share
5 answers

You can use the behavior of the pack so that they follow the same general path, but do not stack with each other. Here's an XNA example: http://xbox.create.msdn.com/en-US/education/catalog/sample/flocking

+4
source

My friend, who used to design AI for the famous first-person shooter game you've probably heard of, tells the story of how their trajectory algorithm created fake behavior. You throw a grenade at a group of enemies in a limited space, and they will all collide with each other, trying to find an effective way to a single exit. It looked dumb and broke the illusion.

, , , , , , -, , , . .

, - . , , - , , ?

+5

?

: , . , .

: . , ( ), . A *. : .

.

1 , , 1 .

+3

, , , , , .

, , . , :)

+1

?

  • , . .
  • . , .
  • ( ) , , , . , , . , .
  • Repeat steps 2-3 until a condition is met and pay attention to previous excess weights.

This algorithm will require full integration into something useful. However, this has the advantage of using pre-planned paths, so it will not have any loops or creeps moving backward. It also allows you to ignore things like synchronization, which makes it conceptually simpler. But also probably less effective.

+1
source

All Articles