cormack12
Gold Member
Been playing a lot of BF II lately and diving into the co-op missions to level some classes as catchup. I'm surprised how aggressive the AI is - plays better than some battlefield teams to be honest. Got me to googling and came across the below link. Quite interesting to read through. What do you think?
Source: https://www.ea.com/games/starwars/battlefront/star-wars-battlefront-2/news/ai-article-deep-dive
If you’re a long-time player (or just generally observant), you’ve probably noticed how the implementation of non-human players – driven by AI (artificial intelligence) – has played a major role in the evolution of Star Wars™ Battlefront™ II throughout the year.
The New AI in Star Wars Battlefront II – A Brief Summary
A big milestone was reached in early 2019 as Capital Supremacy launched, introducing a brand-new AI technology. For the first time in Star Wars Battlefront II’s online multiplayer, players battled alongside and against bots (another word for AI controlled units).
The AI provided scale to the combat by increasing the sheer number of troopers on the battlefront. But it also enabled players across the entire skill spectrum to have a good time, as the bots are – if compared to seasoned veteran players – easier targets.
Since then, as part of the Cooperation Update, the AI has been put front and center in no less than two new game modes: online Co-Op and offline Instant Action. The development team doubled down on utilizing the AI to make players feel heroic on the battlefront, allowing them to create their own, larger-than-life Star Wars moments – and to just have fun without the pressure of human competition.
It All Started as a Testing Tool
The project was started by Jonas Gillberg, Sr AI Engineer at EA, in August 2017 and involved (as mentioned above) the creation of a brand-new technology. For clarity, the initiative has nothing in common with the self-learning agents as demonstrated by SEED or the AI present in Star Wars Battlefront II’s Arcade mode.
This tech was basically built to make bots play games, so that humans don’t have to. But why?
The initial scope of the project was to build an AI to scale automated testing for large multiplayer sessions. In order to test things properly, an AI behaving as close as possible to human players was needed.
The technology is set up to provide quality assurance analysts – who analyze and test games on a regular basis – and content creators (e.g. game and level designers) high-level control of AI objectives through visual scripting. This way, when utilizing the AI for testing purposes, direct interaction with the code isn’t necessary.
Soon after, Luca took on the assignment to polish up the combat system, navigation, and implement behaviors to make it a shippable feature – with the specific focus on Star Wars Battlefront II.
Under the Hood of Star Wars Battlefront II’s New AI Tech
As soon as you start a game of Capital Supremacy, Co-Op, or Instant Action, the AI bots immediately evaluate what to do next. This continues throughout the game, with the AI prioritizing and selecting actions based on its current state.
This is where logic creates magic (if we dare brag a little).
The AI’s decision-making can be looked upon as sub-categories working in tandem:
That’s the top line, but there’s even more logic set up for the AI to follow, such as:
Source: https://www.ea.com/games/starwars/battlefront/star-wars-battlefront-2/news/ai-article-deep-dive
If you’re a long-time player (or just generally observant), you’ve probably noticed how the implementation of non-human players – driven by AI (artificial intelligence) – has played a major role in the evolution of Star Wars™ Battlefront™ II throughout the year.
The New AI in Star Wars Battlefront II – A Brief Summary
A big milestone was reached in early 2019 as Capital Supremacy launched, introducing a brand-new AI technology. For the first time in Star Wars Battlefront II’s online multiplayer, players battled alongside and against bots (another word for AI controlled units).
The AI provided scale to the combat by increasing the sheer number of troopers on the battlefront. But it also enabled players across the entire skill spectrum to have a good time, as the bots are – if compared to seasoned veteran players – easier targets.
Since then, as part of the Cooperation Update, the AI has been put front and center in no less than two new game modes: online Co-Op and offline Instant Action. The development team doubled down on utilizing the AI to make players feel heroic on the battlefront, allowing them to create their own, larger-than-life Star Wars moments – and to just have fun without the pressure of human competition.
It All Started as a Testing Tool
The project was started by Jonas Gillberg, Sr AI Engineer at EA, in August 2017 and involved (as mentioned above) the creation of a brand-new technology. For clarity, the initiative has nothing in common with the self-learning agents as demonstrated by SEED or the AI present in Star Wars Battlefront II’s Arcade mode.
This tech was basically built to make bots play games, so that humans don’t have to. But why?
The initial scope of the project was to build an AI to scale automated testing for large multiplayer sessions. In order to test things properly, an AI behaving as close as possible to human players was needed.
The technology is set up to provide quality assurance analysts – who analyze and test games on a regular basis – and content creators (e.g. game and level designers) high-level control of AI objectives through visual scripting. This way, when utilizing the AI for testing purposes, direct interaction with the code isn’t necessary.
Soon after, Luca took on the assignment to polish up the combat system, navigation, and implement behaviors to make it a shippable feature – with the specific focus on Star Wars Battlefront II.
Under the Hood of Star Wars Battlefront II’s New AI Tech
As soon as you start a game of Capital Supremacy, Co-Op, or Instant Action, the AI bots immediately evaluate what to do next. This continues throughout the game, with the AI prioritizing and selecting actions based on its current state.
This is where logic creates magic (if we dare brag a little).
The AI’s decision-making can be looked upon as sub-categories working in tandem:
- Targeting and vision. A line-of-sight check is made by the AI controlled unit in a front-facing cone view. The closest target in this view is engaged with. Targets that are in cover and not directly visible are not engaged with. Each bot tracks its current target’s positions and timestamps.
Looking at the last positions of the found target, the AI estimates where the target will be a couple of seconds in the future, calculates the velocity vector, and multiplies them both to predict the future position. That’s where the bot will aim. Then, of course, the accuracy of the AI is configurable, and depends on how much aim noise is added to its weapon.
- Weapons and engaging distances. Combat decisions are based on the bot’s equipped weapon, and how far it can reach. There’s an optimal “stop and shoot” distance for each weapon, which is set slightly before the projectiles’ damage starts to drop off. This is the point at where the AI will stop moving towards the target, since 1) getting closer wouldn't deal more damage, and 2) it would make the AI an easier target as well. Each weapon is also given a float value between 0 and 1, deciding where on the target’s body the bot will aim – with 0 being at the target’s feet, and 1 at the target’s head.
Furthermore, the limit set for where targets will be tracked by the AI is the end of the damage drop-off multiplied by an tweakable number, deciding when the target is close enough to go after.
- Combat maneuvers and awareness. The bot seeing through a front-facing cone view opens the possibility to sneak up behind them! However, as soon as the bot gets shot at, it’ll turn towards the player who inflicted the damage and set him or her as its priority target.
If the bot and the player (or other target) are facing each other, the bot will enter a state where it tries to evade and dodge its target’s projectiles while returning fire itself. The bot will strafe left and right (variating randomly each time the bot changes direction) and make the occasional movements back and forth – all within certain configurable time constraints.
At each change of direction, the bot will be given an opportunity to jump or make a dodge roll, as well. This controlled unpredictability, so to speak, helps to convey a sense of human behavior.
That’s the top line, but there’s even more logic set up for the AI to follow, such as:
- Defending an area
- Crouching and patrolling when defending an area
- Navigating through the map in a realistic manner by using a constraint-random set of intermediate positions between the starting point and destination
- Procedures to get out of an area where it’s stuck (where one step is for the AI to mash all buttons frantically in order to unstuck itself – visualize that!)
- Follow objectives, circle up in formations around the player, and reach a position close to the followed player to patrol the vicinity and protect it from hostiles.