Wednesday, November 6, 2024
spot_img

ai – Grid-based pathfinding for lots of brokers: the best way to implement “Tight-Following”?


Notice: the principle downside has nothing to do with the TYPE of pathfinding algorithm (A*, flow-field and many others), permit me to clarify:

I’ve a second grid and quite a lot of brokers transferring round, I need it in order that clearly no two brokers occupy the identical tile on the identical time. Agent could be both standing on a tile or in-transit (transferring from a tile to a neighboring tile).

I at present have a “reservation system” in place in order that agent will request a tile from the pathfinding algorithm, which mark it as occupied, then the agent strikes in animation to the brand new tile, and as soon as it fully reached the brand new tile, the outdated tile is marked as unoccupied. Nonetheless, this trigger the next downside:

Take into account the next scenario the place X=goal, >=agent, .=empty tiles.

>>>>>..X

The agent closest to the goal strikes towards the goal:

>>>>.>.X

Now that the tile the agent is standing on is free, the agent behind it transfer into it:

>>>.>>.X

And so forth.

Nonetheless there’s a vital delay between picture 2 to three the place the tile would seems to be empty, so there’s a giant “hole” between the 2 brokers.

Ideally step 2 would appear like this:

.>>>>>.X

The place all brokers advance in the direction of the goal with little to no gaps.

There’s clearly a method to keep away from this, one of the best instance I can consider is within the basic flash sport Boxhead the place all of the zombies would tightly observe one another regardless of the pathfinding additionally being clearly on a grid.

Any perception on this may be appreciated.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisement -spot_img

Latest Articles