Maybe you should attach different AI movement tendencies to different AI "roles" (similar to auto-battle)?
That more or less how it already works. Critical/Cowardly and Default have different movement patterns. Protective and Aggressive have the same patterns as Default, but since they tunnel vision on one unit, they tend to move differently anyways.
Also how does this mesh with the other AI hacks that increase the AI awareness of various things? Second-order effects may not be visible with one hack alone, but with multiple ones you can make a truly ferocious AI.
Honestly, I haven't really tried them all out at once yet. That is my ultimate goal though.
Anyways...
Golem AI fixesHere's how the AI currently handles Golem in Vanilla. Remember that Priority is a function of HP. Statuses are given a set Priority value for how much damage this effect is equivalent to (Protect/Shell are given +20% because they reduce damage by 20%).
- Fetches current team Golem amount
- Fetches the average HP of every unit that was in play. This value was determined at the very start of the battle and does not change at all. This value is capped at 255 HP/0xff.
- Shifts current Golem by 7 (multiples by 128/0x80 for the unfamiliar)
- Divides (curGolem * 128) by the team average
- Adds this amount to the running priority total.
- Repeat for every unit on that team
This formula only works until mid/late game, when even on the most fragile of units, HP values easily exceed 255 HP. What ends up happening is that
Golem ends up with double or almost triple the priority its supposed to have, per unit. Even if Golem Priority was divided properly, Golem would still have an absurdly high priority compared to the average effect. It would be roughly priority valued at +100% per unit, which it is technically, but because the effect is shared amongst the team, it's more like +20% for the average 5 man party. It should not be valued at the same amount as a unit's actual HP, which I think was the intent and thus the core mistake in making the Golem handling routine.
However, that's not the worst part. The absolutely worst part, is that
any damage done to Golem, to even a single unit, is interpreted as happening to every unit on that team. It works like this because it actually is effecting every unit on the team. You deal damage to Golem, you reduce that amount for the entire team. From the AI's standpoint, you are dealing damage to the entire team.
So what happens when the AI sees it can deal damage to an already overvalued effect and it also effects every enemy unit on the field with a single no cost action? Why, the AI is going to attempt to damage Golem every single time. The way the game has it handled,
the AI sees damaging Golem as more valuable than dealing actual damage. This effect is strong, it even overpowers the AI's desire to finish off critical units. Small wonder why Golem breaks the AI so hard.
I have two fixes for you guys today.
The first fix simply blanks this entire routine outright. You can use this fix if you are dissatisfied with the second actual fix or you are not using Golem in your patch at all.
The second fix is an actual, if rudimentary, fix. It now handles Golem like thus:
- Fetches current Golem amount
- Divides Golem amount by 8 (shifts down by 3). 999 HP produces 0x7c, which is at least somewhat in line with normal priority values.
- Divides that amount by 5, the number of units on an average player team.
- Adds that amount to the running Priority total
- Repeat for every unit on that team, which if there are only 5 units, ends up being about the current shifted down Golem amount.
Of course the obvious problem with this fix is that if you have more than 5 units on a team, the golem amount is still going to high. Not as absurdly high as it was, but still high. One can argue that is a good thing, because an 11 man team with Golem on top of it is a dire threat.
However, the idea of fixing Golem is to encourage the AI to use other attacks to bypass Golem instead of dropping everything to try to remove Golem. Making it too high of value was what was causing the problem in the first place.
So yes, I'm not satisfied with my current fix. The idea fix would be making Golem Priority = (curGolemHP * 40) / (Team Total HP). Team Total HP is just that, the sum of every unit's max HP on a team. For an example, assuming curGolem is 999, and every unit's HP is also 999 with 11 units, you would end up with +5% priority per unit. This seems rather small, but remember that because the AI sees that it effects every unit on the field, that effect adds up. Furthermore, the AI also understands that it is not dealing actual damage when it is hitting Golem.
Having Golem being seen as a small amount that nevertheless prevents certain attacks from dealing real damage achieves our desired goal: discourages, but still allows for Golem breaking, but for the most part, encourages bypassing Golem.
So yeah, it's not the perfect solution, but it's a start. It should, at the very least, make it so that the enemy AI doesn't go nuts when Golem hits the field anymore and has a reasonable response. This destroys yet another way the player frequently cheesed the AI. I strongly recommend this hack for PvE patches.
Here is a video of this hack in action:
http://www.youtube.com/watch?v=uOO8uTB4BqU