RPG squad formations?

I’m experimenting with some ideas, right now is squad formations for fantasy RPG.
How hard would it be to set up squad formations around the players character with NPCs from 1 - 5

I would like to have maybe … 4? formations that the player could switch between, warriors in front, support in back and i will think of other formations later.

would this be easy or hard to do?

depends on your skills and solutions you can come up with, I would probably approach it the way to make an arrangement of empty gameobjects around your character (each empty gameobject a position), group them like “sets” for a formation and then just make one set for each formation which then can be used as targets for positions.
Another way would be using vector3 positions directly in code, based on parent position.
Since child positions under parents are always relative to parent (parent=0,0,0) it should be easy to determine where each squad member has to go.

i remember in Command and Conquer 3, the squad formations looked like they were set on a parent system where the “units” were set in thier location.
I wouldnt want the “squad” to be stuck in the formation indefinitely, but that for example during combat, they can and will break formation to attack a target/s unless told to stay information.

i guess think of skyrim or some other RPG where a squad can follow you in a formation but also be independant

yes that would be possible with the system I thought of, since I could just “translate” them towards the formation positions, but when needed could simply prefer the enemy as a target position to break up formation (I’m having something in mind like they did in age of empires)

cool.
my idea would in a nut shell, be an expanded version of the dragon age games, you have your “squad” they follow you and will enter formations, but wont just stand there if someone is hitting the knight with arrows, hes going to get mad and chase that SOD down and make him/her scream, but wont chase them to the other side of the world.

how hard would that be? (still learning Unity)

I don’t think it will be too hard if you stay simple, like using “movetowards” function from unity (google it if you don’t know it).
But if you want to have proper pathfinding system, then it will get alot more complex and difficult. (would look into a* pathfinding then).
Honestly I can’t give you a clearer answer, because I don’t know what you know exactly and I have no clue to what extend you want to do this, how sophisticated you want the system to be, regarding complexity of the movement. The “defining targets to go to” is not difficult at all, but everything else around could be.

Your question presupposes a bunch of other questions. For the moment I’m just going to assume that you have a system for characters in place. You also have a system for moving the characters. And you have a system for getting the player input as to which formation should be used.

From that point formations isn’t difficult. The simplest way to run a formation is to play ‘follow the leader’. Each character simply has a target destination that is offset from the leader. Characters use navigation and steering to reach their place in formation. All of the path finding and decision making is done by the leader.

‘Follow the leader’ has some downfalls. Characters can run into each other if the paths to their respective locations cross. It doesn’t automatically account for differences in speed (unless you make your leader the slowest character). And you can get some odd behaviour around obstacles.

But its a good place to start.

1 Like

I will be honest, i am just starting to learn unity, but i have found the more … interesting something is, the better chance i will have learning it, than listening to the over explained mono tone “this is how we import a rock” voice.

I want to make a prototype for a game that just shows simple game play, squad formations and its over. total 10? min game.

my HOPE is that the squad will work something like this.

Warriors moving in formation will run up to enemy in range of …10? meters to fight if squad is set in a hostile stance and not sneaking.

Ranged characters will attack anything at … 50? meters but mages will only use special spells at 60? meters, also depending on squad stance.

no character will move a distance beyond 20 meters from the squad leader (you) allowing them to act and react to the environment and threats of enemy.

as i said this is just my HOPE, as I am still trying to set some things up, trying to find the best ways to do A and B so noting is laid out until I can see what would/should work best.

does anyone know what would be the best method to pick from?
I haven’t started anything until i have an idea of what i should be working towards.