NEWS
Project Update - Companion Combat AI Improvements
23 Apr | 10:00 am

Initially, we built Companion Combat without too much focus on the combat AI, knowing full well that it would be a massive task to code and having most of the combat features locked before we do so would make it overall a more efficient undertaking.

Thus, vanilla Companion Combat AI was 'equipped' with nothing more but brute force, running thousands of random choices without any direction that were then evaluated in the back end by a not-too-sophisticated point system spiced up with a dash of random generation aiming to make the AI choose sub-optimal scenarios too from time to time. Otherwise it would have been much too strong.

That unfortunately had its share of drawbacks. It was either extremely slow (too many iterations) or dumb (not enough iterations). After some tuning, we went for the middle ground with a rather slow and occasionally irrational setting. Truth be told, it felt awkward every time we saw someone stream the game like that and initially planned to return to it earlier but our players felt more concerned about other areas of the game, so we moved it behind other open-world features on our priority list.

Now that the first open-world region is in the hands of our backers and patron testers, we finally got around to improve AI, too.

First Objective: Increase Speed

We introduced a number of new attributes for all characters to drive their behavior, such as:

  • Row preference: Melee or range preference, or being versatile in both. That allowed to eliminate all simulations from non-preferred positions on the battlefield.
  • Tactical level (TL): Only characters with higher tactical awareness look for high certainty of their available options, while the ones with lower TL could drop the iteration numbers in the simulation drastically.
  • Expected damage: It is calculated based on the characters' average damage. Characters finding a 'good-enough' option stop the simulation and look no further. The higher the TL of a character is, the higher that imaginary bar of expected damage is set. 

Second Objective: Optimal Positioning

When an AI - in any game - makes a dumb move, most of us feel lucky, even happy for a moment but then we immediately start to resent it. We want to beat the game with our superior strategy and not because of the AI's inferior tactics. Thus, we added new priorities for the AI:

  • Row preference: It was already mentioned above but beside helping with efficiency it also increased the effectiveness of the AI as enemies naturally priorities moving into their preferred rows allowing them to use their most impactful Skills.

  • Use cover: It is much harder to hit characters in cover with ranged attacks, so it only would make sense for the enemy units to use that advantage (even if only on higher TL).

  • Use swap: Why spend two actions on shuffling around each other when you can swap? The players can do it, and so can the enemies now.

Third Objective: Colorful Skill Usage

Balancing a tactical game is very difficult and can barely ever be perfect - we knew that from the beginning.  We are also aware that for a single-player game, variety and challenge is more important than being perfectly balanced, so when we design enemies, we do not mind them having a mix of stronger and weaker skills. On the other hand, we would like the AI to use all of them, even if not with the same frequency, so now the AI takes into account:

  • Effect prop points: Our old AI gathered 'points' during its simulation for instant and overtime damage as well as heal, also for getting targets stunned, killed, or downed. In the new version, we plugged in buffs, debuffs, and impediments too, so those skills would be assessed on their true merit.
  • Cleansing matters: We also take into consideration cleansing (meaning removing) effects, since those can be equally helpful or painful, depending on the situation. 
  • Choice pooling: To ensure that weaker skills are used occasionally, we pool all viable options, sort them based on their scoring, then pick from the top number of actions on the list, where the number is determined based on the character's TL. The higher their TL, the narrower the pool, resulting in better choices.

We have worked for weeks on these changes but are quite happy with the final outcome. The next build will include all these changes and we hope to see you guys try them very soon.

Gábor, Lost Pilgrim 

--------------------------------------------------

Our crowdfunding campaign is LIVE at Fig.co. Get instant access to the Alpha build now!

--------------------------------------------------

Wanna get the game as early as possible with even more content? Please share our pages and posts with your friends through your favorite social media channel(s). Appreciate it! 

Fig.co | Steam | Website | Youtube | Twitter | Facebook | Instagram | Patreon | Discord

<< PreviousNext >>

#gamedesign