Let's talk about minion AI


Greetings everyone!

The long awaited devlog about how the ai of my minions work is here!

I was thinking about how this topic should be communicated and i decided to divide it by feature, and demonstrated by a few short videos, so let's go:

In general


Minions in this game can be summoned, they will follow you around and shoot enemies until they run out of ammo, if this happens they are getting destroyed, and you have to summon them again. Their ammo capacity increases as you level the skill higher. By default you can summon up to 5 minions, but there is a unique item which can increase this maximum to 6. Summoning them cost stamina, which is one of the 2 resource in the game (along with mana) and it's used for physical based skills like Chakram, Dash or Sprint. 

They cannot be targeted by enemies nor they have their own HP, so they won't draw attention from you, resolving a common issue of minions in games, where players getting an unfair advantage by having a nearly indestructible HP wall as protection while it is still dealing damage to enemies.

Attacking enemies

Minions have 3 states: idle, following and attacking. While on idle state, they both occasionally (0.5 sec timer) check for the players distance to them, and cast rays to mobs in their sight range. If the ray hits they assigning the collider as their target and switch to attacking state. 

Since their attack range is shorter than their sight range at this point i'm generating a path to the target which they follow until they are inside their attacking range, when this happens they stop moving, do a final check for collisions between them and the target and if the target isn't occluded they are aiming and firing their weapon. 

If the target is occluded a new path is generated and moving the minion closer to the target, ignoring their attack range. I've also added a firing spread which can be lowered by player stats, so they start of kind of inaccurate, leaving bunch of room for improvement by the player.

Following player

Minions occasionally check if their target is still alive, and either switch their target if there are any nearby, or stop shooting and switch to follow state, in which they generate a path to the player and follow this path until they are in a desired range (so not running on the player, but they will stop slightly earlier). 


Minions can switch directly to following state if the player is getting too far from them while they are in attacking state, but the distance required for this condition is much greater than while they are in idle state. As soon as the minion reaches it's desired range to the player it will switch to idle state.

Target override

Sounds good, but there is an issue with targeting, which had to be resolved: what if your minions already acquired their target, but you are getting attacked by another enemy, and you wish you could draw the attention of your minions to this new threat, what would you do to achieve this? 

Many games tried adding an extra action which commans your minions to go where you want, but honestly i find these kind of solutions extremely uncomfortable in a fast paced fps game, so i decided to hide it behind a mechanic which was already implemented, and which is responsible for showing the nameplate of the enemy you are currently fighting, which is a raycast, hitting enemies and giving back info of their properties. 

The solution is using this info to override the target of minions, which causes them to immediately switch target and do their thing described above. The mechanic is completely seamless to the player and feels natural as you play the game. If their overridden target is blocked by any obstacle, so they can't do a clear shot, they will generate a path around to get closer first.

Ignoring certain targets

Breakable objects technically count as enemies in the game, but they are getting ignored by the minions for the sake of their ammo conservation, this is simply a design decision to don't make players frustrated over their minions constantly running out of ammo by destroying barrels, or unnecessarily drawing their attention while there is a much greater threat around. While these targets are ignored they can be still destroyed by an attack which missed their primary target.

Summoning while you are at minion cap


So what will happen if you summon a minion while you are at the minion cap? Obviously you want to get rid one of them first, but which one will it be? Is it the first or the last one you've summoned? The answer is neither, but another hidden mechanic which looks for the minion with the least remaining ammo, and getting rid of that one, ensuring you are always removing the least useful one, keeping the total ammo capacity of your loyal crew at maximum!

Gear and stat affection

Aside of increasing their skill level, minions can be improved by your gear, as they carry almost every stat over from it, you can customize them to fit for your playstyle. 

If you find them inaccurate, wasting most of their ammo on the environment you can either try improving your dexterity, or if thats not feasible you can try finding or augmenting items with weapon accuracy. By default they are dealing physical damage, which can be great for triggering a secondary effect (or sfx for short) called "exposure", which greatly improves non-physical damage taken by enemies for a few seconds, but you can augment them with all other elemental damage type just by carrying an item which has this affix, or improving the chance of this sfx to happen by carrying an item with increased exposure chance stat. 

When you augment them by any other damage type you also granting them the chance to afflict their corresponding sfx. However the augmented damage is penalized, and will be for certain spells too in the next update for balancing reasons, but i'll make a separate post about this when we get there.


But the customization doesn't ends here: you can augment critical chance and damage too, shifting their build into dps territory, or by using items which causing novas on hit will also affect your minions resulting in a beautiful disco effect as you go. 

As i said not only the stats from your gear will carry over on them, but stats from some of your passive skills too, so if you want to make them crit more, then you can take the Critical Mastery, or if you want to apply sfx by them more often, you can take the Elemental Mastery passive

To tell you a more conditional choice, you can take Sniper Mastery, which causes an enemy to bleed on a critical strike if you are wielding a sniper rifle or a pistol and carry this effect over to your minions. This has it's benefits as their attack speed is much faster than a sniper rifle, but as a downside their bleeding damage will be much lower due to their lower base damage.

Conclusion

To wrap this all up, adding minions to the game will lead to many interesting new build options, and while you will be able to play it as a pure summoner, it will blend well into many other builds, and i encourage everyone to experiment with them once it's out.


However the date of this update is still uncertain and heavily depends on when the 3D model and it's animations are done.

I hope you've enjoyed this log, and wish you happy hunting.

Until next time!

Get Alterworld

Comments

Log in with itch.io to leave a comment.

(+1)

Thank you for writing such a detailed post! I had so much fun playing with minions in the build you have sent earlier, now i can hardly imagine playing this game without them. Honestly, i thought they have some details i missed in them, and, in fact, i was right, they have much more detailed behavior than i thought! It is amazing to see

Thank you for your feedback, glad you still like the game! :)