Categories
Discord Updates

Discord Updates – July 13, 2020

4:12 PM] TheKillerNacho: 

So, we (field tests I’ve made as well as insight and review from Dokuride and MagicBottle) made a pretty big breakthrough today in the pursuit of solving the issue of “Fake Critical”. And by breakthrough we discovered what it actually is, and surprisingly, it has absolutely nothing to do with the critical AI routine, but rather, a quirk of the main AI routine and a concept called focus (this is a new term I came up with to distinct it with ability targeting, which is actually independent of this). The purpose of this rather long post is to explain it and open a discussion with the best way to deal with this moving forward. Before I focus on what’s causing the fake critical phenomenon, I need to first explain the two (yes, only two) main AI routines in the game: the default AI routine, and the critical AI routine. The critical routine is fairly simple and one that everyone should be familiar with. The unit runs from enemies using the retreat subroutine and focuses mainly on buffs and heals, occasionally doing an attack before running if able. It’s an easy to understand routine we all know and love and has absolutely nothing to do with “fake critical”. This routine is triggered by one of the AutoBattle options (“Run like rabbit”), and is also enabled on AI-controlled units when they have critical status and a healthy ally remaining (“But wait!” you might be thinking, “I know I’ve seen the last unit on teams before still run away from enemies, Nacho!” … don’t worry, I’ll explain this as well further down, hold your horses!).

[4:12 PM] TheKillerNacho: 

Therefore, the bulk of what the AI does all comes from the same, default AI routine. That may surprise some of you, since there are four AutoBattle options in the main game. The default routine is fairly complex, and it has one optional parameter: the unit’s focus. Focus, in general, is what it sounds like: the AI will focus its actions on that one unit for the turn, doing everything in its power towards the goal of killing (or helping if its focus is a friend) that unit.

[4:12 PM] TheKillerNacho: 

Once a Focus is determined and sent to the main AI routine, the logic is actually surprisingly simple… if a Focus is passed: :here: If the Focus is too far away to do something to even after moving, [do the most valuable action available], then move closer to the Focus (usually trying to maintain a small distance between the two). :here: If the Focus is in range to do something, calculate the [most valuable action available including that unit], move to the most optional place to execute this action, then execute it. This includes moving to the side or back of that unit before executing a regular Attack to lower evasion, and for AoE attacks, figuring out which is the best place to cast it where it will affect not only the Focus, but more of its allies. If there’s no Focus passed to the routine: :here: Determine what the [overall most valuable action available] is from a space that unit can move, as well as the [most valuable action available from where the unit is currently standing]. :here: If the [overall most valuable action available] is “significantly more valuable” (how much more is still something we’re researching) than the [most valuable action available from where the unit is currently standing], move to the required space and do the action. :here: If not, execute the [most valuable action available from where the unit is currently standing], then use the retreat subroutine to move away from enemies.

[4:12 PM] TheKillerNacho: 

Before I continue, let me explain what the three other AutoBattle types actually are. :here: “Fight for Life”, the AutoBattle type everyone’s usually obsessed with and asking me to include in FFTBG, is nothing more than the default AI routine with the player selecting one enemy to be the Focus. Notice how when this AI is used, while they can do other actions that don’t involve any other unit, they’ll actively try to advance on that unit and even if all they can do is use Throw Stone on it, they’d still rather do it than giving an Elixir to their dying adjacent comrade, instead. :here: “Protect Allies”, is very similar, using the defualt AI routine with the player selecting one ally to be the Focus. While units under this mode can attack if the opportunity grants, they’d rather move towards their Focus and buff/heal them if possible. :here: “Save Fading Life”, however is a bit different… it tells your unit to behave similar to an enemy-controlled unit: that is, the game will calculate the ideal Focus for that unit each turn! That’s right, as you’d expect, the AI is fully able to calculate its own Focus. This process is similar to the AI’s move/act decision making process and a lot of factors are considered… Is this unit targetable at all (are they immune to everything I have, are they in a position I cannot path to, should I ignore them because they’re Death Sentenced anyway)? How close are they (they’ll much more likely pick a focus they can damage this turn)? If they’re an enemy, how much damage can you do to them (can you finish them off)? If they’re an ally, how much peril are they in? This is a complex procedure, as you’d expect, but eventually, after evaluating each other unit on the board, it decides on the unit to pass to the main AI routine.

[4:12 PM] TheKillerNacho: 

As I mentioned earlier, there are instances where the AI’s Focus-generating routine determines no Focus. If all enemies have DS, or they cannot path to a single enemy, or the unit is Don’t Acted, for example (we’ve seen this quite a bit over these six months). The final result from the default routine is when no Focus is found, from the above, the units simply retreat, occasionally doing actions like buffing or healing or canceling enemy moves (even though they can’t be focused, the enemy will still try to Silence a Death Sentenced enemy that’s casting a large spell, for instance). But here is the new revelation: In this Focus-determination routine, there’s a clause that Any unit determined to be in low HP will have no Focus, and this threshold is different than Critical: at 35% HP or less. Now I’m sure many will point out that there’s units in every battle still fighting at less HP than that and not acting in “fake critical”, and you’d be right, because there’s still valuable actions they can execute. This is also what causes the last unit in critical to retreat until an enemy unit comes into range of them, then strike. Because charging and attacking is way more valuable to the AI than buffing, these units will usually function similarly to units above 35% HP with a few quirks. These quirks being: :here: The value of acting before moving is higher. This lack of unit focus is why units will Chakra or Murasame prior to moving despite enemies being adjacent (apparently, healing enemies isn’t sufficiently less valuable than moving first). Or why a Knight, normally wanting to move to the back of a unit to attack with less evasion, will decide instead to Attack from the front then back off. Or why a Samurai may decide to settle for a single-target Muramasa and move away rather than moving to a place where it could hit two targets, as it normally would.

[4:12 PM] TheKillerNacho: 

:here: If there’s no enemies in range whatsoever, it will do some other action it finds valuable (healing, buffing, etc itself or an ally), then RETREAT. THIS is the source of “fake critical”. It also explains why certain units seem more susceptible to it…. High HP units have a larger range of HP between 20% and 35%. Also, low Move units and units with no ranged attacks because they’re far less likely to start a turn with no offensive action to take because the enemies are outside their ability to attack this turn. Once a unit gets in this state, it snowballs, since the unit moves even farther away from enemies, until an enemy moves close enough for it to attack. Also, remember earlier when I said I would explain last unit remaining? Since they’re under 35% by definition as well, they are using this behavior pattern as well. They aren’t using the critical status AI routine – they’re using the default AI routine with no Focus set! At the end of the day, I was thinking that “fake critical” was an error, possibly a rounding error or a difference of a < and <= somewhere in the code, but it’s not. The developers fully intended this “Cowardly” AI pattern when a unit’s HP was low but not quite in critical. My philosophy on changing the AI has always been that I want to fix obvious AI bugs, but not touch the AI’s behavior at its core. In other words, I usually don’t want to change something that was intended by the original developers. There’s a number of ASM out there that would make the AI smarter, but I’ve always felt the default AI is more approachable to fans of the original game, and far more exciting to watch. In contrast, FFT Arena’s AI modifications makes the AI lose the “soul” it has from the vanilla game.

[4:12 PM] TheKillerNacho: 

Unfortunately, due to the lack of understanding of why it occurs and the frustration caused by watching one of your units stand back and doing nothing the whole fight, the “fake critical” problem leaves us in between a rock and a hard place. There’s three main options available: a) Remove the cowardly AI altogether by changing the < 35% requirement to < 20% requirement. This means it would completely overlap with normal critical, and would only be used when a unit is the last unit standing on a team. But it would also be removing an intended AI behavior of “strike and retreat” while at low HP. b) Do nothing, keeping it as it is, and learning to live with the Cowardly AI behaviors, quirks and all. This would be most in line with my previous AI quirks… if it was intended and not a bug, keep it. c) Find a way to change the code to preserve the intended Low HP behaviors within the AI, while trying to find a way to minimize its quirks (most notably, find a way to stop “fake critical” units from only retreating, and getting units even in this mode to move before using Chakra rather than giving the AI free HP). Thanks for reading this rather large explanation, and I look forward to the discussion on how viewers would most like to proceed in #suggestions .