Download

AI programming, squads and squad coherency?

Hi, I’m just going to throw this out there. Not sure it fits mostly with blueprint or programming.

Anyone have any ideas of doing groups of AI that can keep formation, say to the player. Count as part of a squad for squad-wide effects.

From the player set up way points in say a line pattern stretching out from each side of the player.

When the player moves, these waypoints move with the player and AI’s try to reach the new position of their waypoints.

What I want to do.
Player walks into a specified area, player activates a menu, choses the number of AI’s to be spawned.
These AI belong to the players “squad”, and will try to move in formation with the player.

Example of this in other games, would for example be the Operation flashpoint /Armed Assault series.

Thanks in advance for any insights and tips given. I’ll be happy for any pointers to documentation, examples to break down and/or tutorials to look at.

About several ways to do this - use a vector to track the list of squad members, subclass the unit class and add a squad member flag, etc.

During processing for each frame, if a unit is a squad member have them move to a predefined offset from the player - for each formation you’ll have to define these offsets, and you’ll need to keep track of which offset to use for each unit (perhaps simply assign the position index to each unit when they are assigned to the squad).

I’d place the difficulty of the task at intermediate, but you should be pretty familiar with the source and with AI coding in general to do it.

You’ll find lots of good pointers and tutorials at AiGameDev.com

Also check out:

AiWisdom.com