Topic: AI Behaviour

  • Author
    Posts
  • #4273
    Avatar photoGOD
    Participant

    In another thread, the AI came up in how it uses its different abilities and skills in battle (depending on the faction). One way in which it differs from human players currently is how it uses its abilities less to reposition itself or to do a tactical retreat. This is something that is worth addressing, as it would result in more variance between the factions and for the enemies to be both more challenging and reactive.

    The example I’m about to give assumes human opponents, in a three versus three fight with elevated terrain and hiding places. Now, let’s say that you hid one of your three brothers prior to the enemy spotting you, meaning that they perceive it to be two versus three. The hidden brother is between you and the enemies and would have enough AP to attack, were he to stand on an elevated spot close-by. What follows is the turn of the closest enemy, who makes use of his full movement to get close to you as he is planning to take the elevate spot. The position he takes is outside the movement range of the unhidden mercenaries and right next to the elevated spot. However, the hidden merc has the next turn and jumps out to take the high ground, pinning the enemy unit at the same time. He also takes a swing, though he does not succeed in killing the enemy. Now, the other two mercs come closer, though not close enough to join the fight. Same goes for the two enemy units; they come closer, but are not close enough to help out.

    Now, what I would like to see is for the AI to recognise that they’re in a bad position (assumed two versus three and access to high ground, but both were wrong) and use its abilities to reposition itself. Otherwise, the first unit could end up getting attacked by three mercs in the next turn and will most likely die – resulting in a two versus three fight in favour of the mercs. This could involve the unit (if it has a shield) trying to shield bash the unit that is pinning it and either taking the high ground or retreating closer to its comrades (could depend on whether or not they took damage, and if so how much), or put up a shieldwall and either try to holdout or retreat (using shield to up chances of survival or of missing the disengagement attack). If it has a weapon that can stun, it could try to do so and retreat if successful. The point is that the unit should not just try to do as much damage as possible before it dies (if human and unless they have traits that make them aggressive), but try to retreat to a position where it can fight better, or use its inevitable death to give its comrades a tactical advantage (shield bash, take high ground, tie up all three mercs). Depending on how close everyone is and what tools they have, they could also use other tools to turn the situation around (intentionally sending a bandit with a disengagement perk in first when faced with potentially hidden enemies, who can more easily withdraw when necessary, so that he can scout out the situation).

    Basically, I would like to see the AI (for the appropriate faction) use its abilities to try and both reposition itself when it gets outmanoeuvred, retreat a bit when caught with their pants down or sometimes try to make intentional sacrifices when this allows for a tactical advantage. Basically, make them act more like players. This seems especially appropriate for bandits, who are pretty motivated to try and stay alive (can’t spend loot when you’re dead). I see the AI do this kind of thing at times, but so far it seems to be more by accident, rather than by design. I’m interested in hearing if I’m wrong, though.

    One a side note and unrelated to repositioning, I suggest for the necromancer AI to use undead as guards. It could be me, but by the time I tend to encounter necromancers they are usually alone on the battlefield. Since the necromancers have little combat ability, it makes sense to me for them to always try to keep an undead nearby whose only purpose is attacking anyone who gets close, in case someone manages to reach them. If that undead dies, they could just raise another one. This seems like a logical way for the fragile necromancer to act that is in theme with whole immortality shtick of undeath.

    Any thoughts or suggestions on how to improve AI?

    #4276
    Avatar photoguidon101
    Participant

    Great write-up! I thought to enhance your point by describing what I think WORKS RIGHT NOW for the AI (from a player impression), and go from there before making suggestions.

    *WARNING: LOTS OF TEXT. NOT FOR THE FAINT OF EYES*

    Correct me if I’m wrong on some of these, but these are some observed AI battle tactic behaviors that I think work well or at least give the player an impression of intelligence, so that maybe we can benchmark what we consider “good AI”:

    1) Flanking: Whether due to sheer numbers and so the battle lines inevitably stretch out, or there is an active flanking script, the AI seem to commonly apply flanking tactics (regardless of faction, although orcs and bandits seem to achieve this more effectively). Especially when presented with a solid battle line of spearwalls, the AI shows propensity to avoid a full frontal assault (it will still do a partial frontal assault, but its main force will fall on the flanks). This is awesome battle behavior :)

    These flanking maneuvers seem to be limited to the right/left flanks, as in the AI usually does not go for a wide rear-flank attack (only counting when two battle lines face each other, not ambushes). A rear flank is much harder to pull off, especially without enough forces, but would be cool to see if the AI had the resources and algorithm to pull it off. Optional.

    2) Unit Targeting Preferences and Focus Fire: From observation, the AI seems to target units that it has the highest chance to hit (from the player’s point of view, the mercs with the lowest melee def or range def), also avoiding those with defensive buffs up, such as ShieldWall or Riposte. This is great. However, this sometimes makes the AI ignore certain “targets of opportunity” (for example: a high def melee warrior that has its armor destroyed and low hp; it’s harder to hit, but will likely die if hit; the AI will prefer to target another fully armored merc, with lower defenses because he is easier to hit; there seems to be some randomization, so I think this is not as predictable). Overall, good targetting behavior for Melee Units.

    Ranged Units are another story. I can’t tell if they only like to shoot the nearest target (or because all other units are out of range), or they also apply similar targetting algorithm as the Melee Units… but I don’t feel like enemy Ranged Units are very effective in their choice of targets. Player archers tend to target AI archers or high damage/low armor targets. When given the choice to shoot all 12 mercs within range, the AI archers don’t seem to pick the “best” targets (the targets a player would pick for maximum impact), sometimes they shoot the unshielded Swordmaster, sometimes the archer, sometimes the heavily armored and shielded knight…and then they shoot different targets so that the damage is dispersed, and basically ineffective against the organized player who will then counter with selective focused fire.

    3) Defensive AI Posture: I’ve only started to notice this recently, so not sure if this has always been the case, but it seems now that sometimes when I grossly outnumber the AI, the AI will adopt a defensive posture on good terrain (high ground) and refuse to advance on the player. This is smarter than launching an assault against impossible odds, but the smarter player would run away against those odds. Since the AI doesn’t have Retreat as an option, the Defensive Posture is probably their best last resort. In fact, the AI should probably do this more often than we currently see (for certain factions like Bandits or maybe Orcs); the AI still generally has a propensity to assault under dire odds (acceptable behavior for undead or orcs, but not for bandits).

    4) Unique/Special AI Skills: There is a great variety of these, so I won’t go into detail on each one, but suffice it to say the AI seems to use the active skills available to them with good frequency, although not necessarily to optimum effectiveness. I see ShieldWall/Riposte/Spearwall used pretty frequently, and I think their use is generally effective. Some skills are sometimes not used to full effectiveness though, for example, the Orc Warrior bash — very effective in breaking player formations, however, oftentimes the Orc Warrior bashes twice, and the second bash is often extraneous/redundant or the AP would probably have been better spent on a follow-up attack.

    5) Ambush Bushes: Is it just me, or is the AI always aware of my mercs hiding in bushes? Even archers run away when I approach “stealthily” from one bush to another (LOL). Anyway, I think the AI being aware of the player’s “hidden” units helps the AI respond more intelligently to the flow of battle, but the player should not be given the illusion that his unit is “invisible” to the AI. Yes, the AI archers can’t shoot an “invisible” unit in bushes, but they certainly know that merc is there. Good AI, but somewhat deceiving to the player.

    6) Specific AI Tactics: Many here, just listing the few I can think of right now.
    6a) Taking High Ground/Pushing Player Off: One of the best AI tactics at work!
    6b) Ranged Unit Skirmish Behavior: As much as I hate to chase archers down, this is undoubtedly a smart way for them to behave
    6c) Orc Warrior Bash: Mentioned earlier its effectiveness, but also sometimes redundant double-application.
    6d) Orc Young Stun: Very effective AI use currently
    6e) Orc Warlord Warcry: This is a great skill for the AI, but I haven’t seen it used probably to its full effectiveness. This has the potential to route entire chunks of the player’s company if used well, in addition to Rallying routing Orcs. Currently, it seems somewhat sporadic and random when this is used. Needs to be used more intelligently/effectively. (e.g. offensively, trigger frequent use when more than 3 mercs in range of effect; defensively, use when there is at least one Orc fleeing/breaking in range of effect)
    6f) Lost Soul Wail/BansheeCry: Very cool AI skill, with all the recent nerfs/patches, balanced and effectively used, I think.

    As I’ve said before, I enjoy the current combat mechanics and even AI, but sure there is always room for improvement; so here are some other suggestions for maybe some incremental improvement:

    1) Battle Buddies: As a player, I tend to have a “buddy system” whereby at least two mercs will support each other as much as possible. A shield merc providing cover for a billhook-merc while advancing. Two archers complimenting each other’s line of fire coverage (e.g. one covers the right flank, the other covers the left, and they have a deadly zone of converged line of fire).

    I think it would go a long way for the AI to try not to charge alone but try to move in synchronization with one or two other units. I think this happens to some extent already, especially when starting with battle lines formed. However, in ambush scenarios especially, the heroic solo-unit advance of the AI is not very effective. The AI should always start in clusters and advance/withdraw in clusters to help them out against players who are usually very organized in their formations and maneuvers.

    2) Focus Fire: Battle Buddies should also play in terms of Focus Fire, where two or more AI units should try to focus fire more on a good target instead of dispersing the damage across multiple mercs. Currently, each AI seems to think individualistically when it comes to picking targets and maneuvering on the battlefield (is this true?). Focus Fire is one of the most basic yet extremely effective player tactics, a pillar of Teamwork. It sounds rather lame to say it, but basically the AI could show more Teamwork, especially with target selection/focus fire, especially for ranged units. The AI appears to do focus fire to some extent, especially when surrounding a merc, or no other adjacent targets are available, but in general since the AI units seem to behave more individualistically, I can manipulate the AI aggression (without the Taunt skill) by tempting their hits away from the merc they have been pummeling to near-death towards a fresh lower-defense target.

    On a slight tangent, near-death units should look tastier perhaps to the AI (but only if they are skilled enough to hit the ailing unit, and approach only if they have the support to back them up while also taking into account the battle circumstances if they will fall to a player trap using low-health or low-defense characters as bait).

    I find it difficult to propose specific tactical maneuvers as improvement for AI. Mostly because every time I think of a good maneuver, I can think of a good counter-maneuver… so for now I only have these basic suggestions to enhance overall AI performance.

    And I would also like to add caution, with the popular saying, “if it ain’t broke, don’t fix it” :)

    #4281
    Avatar photoSalperticon
    Participant

    Thanks a bunch for the input so far, all of you.
    The way the AI works and acts surely has a deep impact on the game and how enjoyable it will be to play it in the end, and therefore is a very intresting topic to talk about.

    Without taking into consideration how hard it would be to implement it into the game, I want to point out a few things which should be kept in mind when tinkering with the battle behaviour of the opponents. I have a lot of trust in the capabilities of our beloved developers, but still. Cannot hurt to mention it.

    At the moment and from my personal point of view, the enemies mostly use abilities which come with the weapon of choice – split shield, stun, riposte, shield bash and shield wall. However, they seem to use these rather randomly. The rare exception is the rotation perk (level two in the defense tree), which I personally never saw in use so far – but in BumpyMcSquigums’ let’s play on Youtube I could see two bandits swapping their position twice by using that perk, so they ended up in the very same position as beforehand. I’ll try to look up the exact part when I am home, and link it as a reference.

    However.
    If we are going to improve this however, we should take a close look at who and how far. The orcs for example excel by being absolute killing machines in a duel, which is a good reason not to take them on alone, or at low levels at all. Which is totally fine.
    But giving an enemy a broader skillset and a better AI to use these, could also be utilized as a way to set apart the different factions from each other. So while orcs would rely not much on any weapon abilities or perks which require finesse (like riposte), it seems totally fitting for them to use shieldbash and other actions which rely rather on strength. I would not expect any of them to have a great sense of positioning, though. Goblins, on the other hand, are a totally different matter.

    So all in all, I would encourage to give the enemies more access to the perks besides the normal weapon abilities, but make it strongly dependant on the faction – and even within the faction. If bandit thugs were using their skills in the same, smart way as bandit leaders, it would not only make the game probably a bit too difficult without the ability to tune it further for less skilled players, and also waste some potential which could otherwise be used to differentiate the particular types of enemies within the same faction.

    GOD:
    I wholeheartedly agree to the idea to back the necromancer up with a guard. It is not only very fitting, but will also make him much more useful. Just yesterday, I engaged a group of undead in a hideout; two normal skeletons, two skeletons with hookbills, eight fallen heroes and one necromancer. It was labeled as ‘deadly’, so I was very careful about my positioning and movements during the fight. The necromancer however, did absolutely nothing in this fight. He kept lurking way too far from the frontlines to be able to resurrect any of his minions, so it never happened. Then he took a hit from an arrow because he was the only really useful target for my archers – and then fled when enough of the fallen heroes were down to send a shieldbearer after him. An undead guard who could shield him from the arrows and make him a bit harder to catch would be awesome.

    guidon101:
    Horray for lots of text! It was quite nice to read.
    In most of your described cases I would agree, in particular to your last sentence: If it is not broken, do not fix it.

    But in a few cases I have made a different experience. For the enemy archers, they quite reliably aim for my un-shielded troops. The only times where I see them shooting at shieldbearers is, when they do not have any other valid targets. What I am more concerned about with them, is when they try to shoot and when they try to move. The positioning seems to be very difficult for them, especially in forest battles. It has happened a few times already to me, that I had to scout the map after the battle for that one last archer in the forest, who was confident sitting where he was and not participating in the fight at all.

    The other point is the defensive AI tactic. I agree to the behaviour which you described above, where the AI tends to move onto a hill and camp there if necessary, so they keep the advantage of the high ground. However, if you move all your troops out of sight from them, they will come and look for you. In most cases, only with a few of their men, so they split their forces.

    If nobody pointed it out by now (took a while to write this all up at work), bushes work just fine to conceal your units. However, if the enemy saw you moving into it, they will remember your unit being there for a while. So not only your battle brother has to be hidden to make this work, but also his movement into that cover. Therefore, they really work best as am-bushes (sorry for the pun). Fall back, retreat some guys into bushes, the rest further. The enemy will come to them, even with his archers.

    Focus and teamwork: This is one of the biggest advantages I currently have over my oponents, and which allows me to beat much tougher enemies if I can prolong the start of the fight until I have reached a forest. Therefore, out of very personal, selfish reasons, I like the fact that I am able to separate the opposition well there and would like to keep it at that. However, I can understand that others might want a smarter behaviour, a bit more of a challenge in this regard, and improve their behaviour. Causing the AI to stick together more closely in confined circumstances like forest battles will surely help them a fair bit. And I think I have already seen some group tactics, as they already spread out in open fields before they engage to make it more difficult for your archers to hit them with a lucky fluke, should they miss their intentional target.

    Plague Rats - we're not famous, but we get the job done.

    #4282
    Avatar photoiason
    Participant

    Very Godd Discussion here.

    The positioning seems to be very difficult for them, especially in forest battles. It has happened a few times already to me, that I had to scout the map after the battle for that one last archer in the forest, who was confident sitting where he was and not participating in the fight at all.

    This seems to be a bigger Problems, not only the Archers do that in Forest Battles. I have often Bandits which waits somewhere out of sight during the wohole fight. After I killed all but one bandits i go searching and find a lonely two-hander guy or something sitting there, like he didn’t knew there was a battle going on.

    #4288
    Avatar photoSalperticon
    Participant

    This is the double rotation use I talked about earlier:
    Strange use of Rotation by the AI
    I am not sure why the bandit raider did this, but as it is not my let’s play and I therefore have no access to the saves, I cannot reproduce it at the moment.

    Plague Rats - we're not famous, but we get the job done.

    #4295
    Avatar photoguidon101
    Participant

    This is the double rotation use I talked about earlier:
    Strange use of Rotation by the AI
    I am not sure why the bandit raider did this, but as it is not my let’s play and I therefore have no access to the saves, I cannot reproduce it at the moment.

    Haha, that’s so funny especially with the guy’s comment… “Oh, they swapped with me…and then they swapped back because of… I uh… I don’t have a logical explanation guys, I really don’t…” Wow that’s a fun LP series to watch, thanks for linking it.

    I forgot to mention Rotation as a skill, but from my experience, it’s been used rarely by bandits and it sort of like the Orc Bash where they sometimes double-use it, but the 2nd use usually doesn’t make sense for the situation. The 1st use is usually appropriate though that I’ve seen (at least it serves to delay or hinder the player from Focus Firing on the player’s initial target).

    The positioning seems to be very difficult for them, especially in forest battles. It has happened a few times already to me, that I had to scout the map after the battle for that one last archer in the forest, who was confident sitting where he was and not participating in the fight at all.
    This seems to be a bigger Problems, not only the Archers do that in Forest Battles. I have often Bandits which waits somewhere out of sight during the wohole fight. After I killed all but one bandits i go searching and find a lonely two-hander guy or something sitting there, like he didn’t knew there was a battle going on.

    Both good points, and I also noticed both behaviors in forest battles: archers or other units don’t actively participate in the main engagement, and I have to mop them up after the rest of their comrades are wiped. I thought it might be because they Fled during the fight, and I just didn’t see them flee? Unless they were just out of sight and out of the battle the entire time, which is rather non-team-player-y (there must be a word for this?) of them.

    If nobody pointed it out by now (took a while to write this all up at work), bushes work just fine to conceal your units. However, if the enemy saw you moving into it, they will remember your unit being there for a while. So not only your battle brother has to be hidden to make this work, but also his movement into that cover. Therefore, they really work best as am-bushes (sorry for the pun). Fall back, retreat some guys into bushes, the rest further. The enemy will come to them, even with his archers.

    Ah, thanks for the clarification! That makes a lot of sense. I applaud the AI there, both playing smart yet at the same time showing appropriate weakness. Good balance.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.