🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Tactical Circle System

Started by
6 comments, last by shade4x 5 years, 3 months ago

Hello,

Games like Assassin's creed and various others position enemies around the player in a meaningful way, I have been wondering how this problem is generally solved. The way i solved it in a previous project was to use UE4 EQS with a Backend system to register attackers into a List. They each would request an attack each tick until the system returned a "token" stating they are now able to attack, this was to reduce the number of attackers to say 2 at a time each with there own offset. The attacker would enter an attack radius defined by there min and max attack distance and perform there attack then back off to an appropriate approach radius signifying they were no longer an active attacker.

However im wondering how other programmers have approached this and weather there are any suggestions to improve this system such as maybe using attack weighting to define which enemy gets an attack as opposed to just handing them out in a first come first serve basis. Also the expensive path finding each time the player moves all the AI's have to re-evaluate the EQS points and create a new path to them.

Note: UE4 and EQS are not specific to the question just a background of my exerpeince as this type of system could be implemented in a custom engine or unity etc.

Thanks!

Advertisement

One common way is to have a specific set of position locations that automatically surround the player. These can be marked as "reserved" when a future combatant claims them. They then move to that position. That handles the creation and maintenance of the "kung fu circle" as it is often called. Anything else can then be used for determining who in that circle attacks. Often, one person enters and stays until they are downed (thus summoning the next one in) but other times, they will do an attack or 2 and back out allowing someone else to enter. This way feels a bit more natural and also has the game mechanic of keeping the player searching the circle for who is coming next. Much of that is design-dependent, though.

I've used another way using my influence map system where people won't close that last X meters if the is already too much of a crowd right next to the player. Also, since I use my Imap system for spacing, this has the effect of automatically spreading folks in a circle around the player. That is, they are finding a place that is 1) close to the player, 2) away from allies, 3) close to them. The Imap system streamlines all of this easily. Additionally, it has the effect of being far more scalable in that enemies will space roughly equally apart no matter how many there are. If everyone was just picking a nearby slot in the template, they may stand closer together in some cases and leave gaping holes on the other side. Also, if there are more enemies than can fit in a single perimeter, they end up stacking up deeper away from the target.

I give these as ideas rather than solutions since my Imap system is a huge, well-polished system. I don't expect people to recreate it out of nowhere.

Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play

"Reducing the world to mathematical equations!"

Yes i watched your GDC GW2 video which was very interesting. The solution i ended up with uses fixed points of influence so if an enemy is standing on-top of a points it will drop to a score of 0 and distance to other points depending on how close will be slightly less favorable. I feel the EQS/Tactical Positioning points work well to some extent. However it has weaknesses when compared to your influence map especially the infinite resolution method which can provide quite big benefits for things like your example of where to throw a grenade etc.

Note that my full Imap system was not covered in the GW2 video. I spoke a full hour on that at the last AI Summit though. (4 days before I was almost killed.) That one is not available for free on the Vault yet.

Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play

"Reducing the world to mathematical equations!"

Im very sorry to hear about that, glad your okay though. It would be great to see that talk drop on the vault at some point in the future! 

it will be free on the Vault after 2 years. All things become so now.

Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play

"Reducing the world to mathematical equations!"

On 2/8/2019 at 2:59 PM, Jman2 said:

Hello,

Games like Assassin's creed and various others position enemies around the player in a meaningful way, I have been wondering how this problem is generally solved. The way i solved it in a previous project was to use UE4 EQS with a Backend system to register attackers into a List. They each would request an attack each tick until the system returned a "token" stating they are now able to attack, this was to reduce the number of attackers to say 2 at a time each with there own offset. The attacker would enter an attack radius defined by there min and max attack distance and perform there attack then back off to an appropriate approach radius signifying they were no longer an active attacker.

However im wondering how other programmers have approached this and weather there are any suggestions to improve this system such as maybe using attack weighting to define which enemy gets an attack as opposed to just handing them out in a first come first serve basis. Also the expensive path finding each time the player moves all the AI's have to re-evaluate the EQS points and create a new path to them.

Note: UE4 and EQS are not specific to the question just a background of my exerpeince as this type of system could be implemented in a custom engine or unity etc.

Thanks!

I was working on this problem with a 2 man team, and we went the kung fu circle route that IADaveMark said. Each enemy could enter the circle and recieve a position in the circle. If there where not enough positions, the circle would increase. The problem i had with our implementation is it looked like a 1980's school fight scene, where there were 10 people circling around and 1-2 guy's fighting at a time. I ended up adding logic to allow an enemy to continue attacking for a random amount of seconds, to allow for more of a feeling your fighting multiple people at the same time. Even added a priority system based on rank (which each enemy had). It was great on paper, but in practice, i couldn't have a lot of AI in the scene at one time, and it didn't feel like it was matching the combat system.

The other big limitation i ran into is that i had enemy's of differn't sizes. So like an ogre was in the same position as a goblin on the circle. Even if the attacks cover the same distance, it felt to much like AI on the rails. We ended up scrapping the system for a simple script that made it so the AI would never be within a certain radius, which i configured based on the size of the enemy, and a chance to dodge left/right/back when the player attacked if they where facing each other (collider check before the actual attack). The big advantage was going from something like 15 AI to 50 for the same Frame rate on a build.

One thing i found very helpful was playing assasin's creed, dark souls, Breath of the wild, and try to figure out how there AI works, and how my combat system would work in their games. Dark souls AI for instance still feels tough and smart, but can be replicated mostly by random attacks at random times, and pretty much having a simple combat state that has strafe movement. The biggest thing i ended up wrestling with, was that with the previous system was to manicured, and combat was to controlled, to same.

Really good AI IMHO allows for "Oh Sh*T!!" movements, where it gives the illusion that the enemy is doing something unexpected that either makes the fight easier (enemy's clump up and take a massive AoE) or harder (Enemy combines 2 or more skills into a combo that if you don't avoid will kill you).

Not sure if that helps, but that was my experience.

This topic is closed to new replies.

Advertisement