Jump to content

Playing DA:I Cleared My Doubts About Engagement Mechanics In PoE


Gairnulf

Recommended Posts

Well, if your only goal is to prevent kiting, this is pretty straightforward:

 

You can detect when kiting is occurring by comparing the ratio of attempted attacks by the NPC vs. the number of attempted attacks by the player.  If this ratio goes outside of some arbitrary bound (say 2:1) over some arbitrary period of time (30 seconds), the gods are angered, lightning strikes all the PC character's, which prevents all PCs from (but not attacking or performing other actions) for the next 60 seconds and imposes a hefty deflection penalty.

 

I'm not suggesting that as a legitimate solution, but if the developers really want to prevent kiting, this would do the trick. :)

  • Like 1
Link to comment
Share on other sites

Well, if your only goal is to prevent kiting, this is pretty straightforward:

 

You can detect when kiting is occurring by comparing the ratio of attempted attacks by the NPC vs. the number of attempted attacks by the player.  If this ratio goes outside of some arbitrary bound (say 2:1) over some arbitrary period of time (30 seconds), the gods are angered, lightning strikes all the PC character's, which prevents all PCs from (but not attacking or performing other actions) for the next 60 seconds and imposes a hefty deflection penalty.

 

I'm not suggesting that as a legitimate solution, but if the developers really want to prevent kiting, this would do the trick. :)

 

 

That sounds a little heavy handed :)

 

I actually think kiting is a legitimate combat tactic for faster ranged combatants.    It's just I hate it when the NPC never switches agro and wanders around aimlessly after a party member while the rest of the team pummels it,  which is, coincidentally, how I passed the majority of boss fights in IW.  I like your timer approach ( um, I haven't attacked my target in 3 seconds,  maybe switch to the slowest/weakest enemy in range).  

 

And for silly things like single NPC aggro pulling,  why not have  a broadcast aggro range, where you pull one,  you pull them all (kobold pack tactics, anyone?)

 

 

I hope we can mod AI.

Edited by tdphys
Link to comment
Share on other sites

I'm not an AI Programmer (or a good programmer in general, i suck) but there's no way to prevent kiting.

 

Kiters gonna kite, know what I'm sayin?

Just for the heck of it, let's compose an AI's behavior in pseudocode.

 

1. AI turns hostile (Observation)

2. Evaluates enemies  (Orientation)

2.1 Calculates distance from self to every enemy

2.2 Enemies are ordered in an ascending list by order of their damage

3. Decides which enemy to attack, and preforms the action (Decision and Action)

3.1 If the AI has ranged weapons (incl. spells that damage a single target):

3.1.1 If there are no melee-equipped enemies within a given distance of the AI, the AI attacks the most dangerous enemy with its ranged weapons

3.1.2 If there are melee equipped enemies too close to the AI, the AI checks if it has any melee weapons of its own

3.1.2.1 The AI has no melee weapons, and runs away from the nearby melee enemy.

3.1.2.2 The AI has melee weapons but decides he has no chance against the closing enemy and runs away (this decision can be based on stuff like hitpoints difference between AI and enemy, weapon properties, armor, etc.)

3.1.2.3 The AI has melee weapons and switches over to them and starts fighting in melee with the closing enemy

3.2 If the AI has no ranged weapons and nobody is attacking him

3.2.1 Attacks the enemy who is attacking his nearest buddy

3.2.1 Attacks closest enemy

 

 

You can get this as much more complicated as you want, for example the AI may want to evaluate if any of his friends who are being attacked have lots of health left and not come to their help, choosing to attack some other enemy instead. Within such a scheme, a kiting enemy can be described for the AI as an enemy who breaks engagement, and the AI can decide to do something different than chase that enemy. I mean kiting is not unavoidable.

Edited by Gairnulf

A Custom Editor for Deadfire's Data:
eFoHp9V.png

Link to comment
Share on other sites

I'm not an AI Programmer (or a good programmer in general, i suck) but there's no way to prevent kiting.

 

Kiters gonna kite, know what I'm sayin?

Would adding in enemies retreating at a certain level and possibly using disengage mechanics and also adding in some code that if the npc cant attack something in a tike frame of 10secs or so to disengage and target nearist enemy pc help out?

Link to comment
Share on other sites

I'm not an AI Programmer (or a good programmer in general, i suck) but there's no way to prevent kiting.

 

Kiters gonna kite, know what I'm sayin?

 

In turn-based, preventing kiting is easy, there are a number of options. Strategy games usually employ the "zone of control", for example, to prevent fast units running around enemy units.

 

The Gold Box games, the first of which came out almost a decade before Baldur's Gate, had melee disengagement attacks. They were ADnD games, and they used disengagement attacks. The idea that you need to prevent kiting and this particular method is not new, it's old. In fact, when I first played Baldur's Gate, the bastard child of an RTS engine and a turn-based RPG, the whole kiting thing was one of the first things that popped out as 'really lame and cheesy', compared to the turn-based ADnD adaptations, which I was used to (now who's the grognard? :p).

 

GCkvWYE.png

 

But!

 

Preventing kiting in a real-time game is much more complicated. Disengagement attacks don't feel "natural" like they do in turn-based. And most other methods feel forced, too, like MReed illustrated. So you're mostly right, I just wanted to explain that having disengagement attacks is an old and proven idea in ADnD games. Just not in IE games, and PoE is supposed to be IE-like.

  • Like 2

The Seven Blunders/Roots of Violence: Wealth without work. Pleasure without conscience. Knowledge without character. Commerce without morality. Science without humanity. Worship without sacrifice. Politics without principle. (Mohandas Karamchand Gandhi)

 

Let's Play the Pools Saga (SSI Gold Box Classics)

Pillows of Enamored Warfare -- The Zen of Nodding

 

 

Link to comment
Share on other sites

I just wanted to explain that having disengagement attacks is an old and proven idea in ADnD games. Just not in IE games, and PoE is supposed to be IE-like.

I've posted many times that it's a turn-based mechanic. Although most of those threads are now old. This argument has strewn across probably 5-6 threads now.

Link to comment
Share on other sites

 

I just wanted to explain that having disengagement attacks is an old and proven idea in ADnD games. Just not in IE games, and PoE is supposed to be IE-like.

I've posted many times that it's a turn-based mechanic. Although most of those threads are now old. This argument has strewn across probably 5-6 threads now.

 

 

That however does not mean everyone is convinced.

 

Stop trying to assume that you are automatically correct just because you have ONE possible explanation. That makes you similar to people that you yourself dislike I think.

"The essence of balance is detachment. To embrace a cause, to grow fond or spiteful, is to lose one's balance, after which, no action can be trusted. Our burden is not for the dependent of spirit."

Link to comment
Share on other sites

Wait, actually no, I decided not to.

 

Nothing anyone says, and nothing I say will change anything for the people that have already made up their minds. I am not playing with Engagement, I will test the game with it on, but I am removing it and changing the abilities, spells and whatnot related to it. I will fight for things that make this better to play with - such as better AI targeting clauses and better attack animation interaction with moving targets.

 

Obsidian probably won't change it but that's on them, there are many people here that want a combat experience closer to the IE games. I know you don't and I know Shevek doesn't either. But don't expect me to stop arguing about it :p You won't find many people on this forum more persistent than I am.

  • Like 3
Link to comment
Share on other sites

I actually think kiting is a legitimate combat tactic for faster ranged combatants.    It's just I hate it when the NPC never switches agro and wanders around aimlessly after a party member while the rest of the team pummels it,  which is, coincidentally, how I passed the majority of boss fights in IW.  I like your timer approach ( um, I haven't attacked my target in 3 seconds,  maybe switch to the slowest/weakest enemy in range).  

 

And for silly things like single NPC aggro pulling,  why not have  a broadcast aggro range, where you pull one,  you pull them all (kobold pack tactics, anyone?)

 

 

I hope we can mod AI.

 

 

Unhappily, switching targets doesn't fix the problem, and generally makes matters worse. 

 

In the "stick with a single target even if it seems to be futile" scenario, you at least reduce the volume (and perhaps eliminate altogether) the attacks from the target that you are pursuing.  In a 1:1 scenario, this leads to a draw -- in a 1:many scenario (where "many" = NPCs), this may result in a win, if you can corner the PC.  Even in a many:1 scenario, the PCs other than the target are limited to ranged attacks only, which tend to be less damaging than melee attacks, at least drawing out the encounter.

 

In the "switch targets to the nearest foe if you aren't able to attack your initial target" results in "ping-pong" behavior in the many:1 scenario ("many" = PCs, here) -- PC "A" starts fighting opponent "Z", but when "A" is wounded he runs away.  "Z" switches to the nearest target (which the player can control with a high degree of accuracy -- "B"), "A" heals up, "B" runs away, and "Z" switches back to "A".  The net result is that neither "A" nor "B" is ever seriously threatened yet can still use their (more effective) melee attacks rather than being limited to ranged attacks.  I don't believe the inability to heal health (v stamina) damage is sufficient to change the math in this scenario, although it does make it somewhat less attractive.

 

Note that the second form of "kiting" is how the AI works in Infinity Engine games, and is exactly what Sensuki is looking for when he wants to engage a foe with two PCs, then withdraw one (for healing), re-engage, then withdraw the other for healing.

 

The "correct" solution requires an AI that is capable of the following:

1) It has to be able to position units under its control to make retreat unattractive (e.g. by engaging a foe so that you are between him and friendly units, ensuring that the most important targets end up in the "center" of a grand melee)

2) It has to be able to "pass off" responsibility for killing targets between units based on PC actions (a wounded unit that is attempting to disengage should be allowed to do so if and only if another unit will be able to engage).

3) It has to be able to predict (with some degree of accuracy) the movements and plans of the PC so that it can influence them (rather than always following the shortest path to the PC, it may be better to move away / perpendicular to the PCs predicted location to take advantage of terrain / other NPCs to pin the PC into place)

 

I'm not sure it is possible to write an AI that can do the above -- I'm very confident that Oblivion has no plans to attempt it in this game (if they had, some shadow of it would have been implemented by now).

  • Like 1
Link to comment
Share on other sites

 

I actually think kiting is a legitimate combat tactic for faster ranged combatants.    It's just I hate it when the NPC never switches agro and wanders around aimlessly after a party member while the rest of the team pummels it,  which is, coincidentally, how I passed the majority of boss fights in IW.  I like your timer approach ( um, I haven't attacked my target in 3 seconds,  maybe switch to the slowest/weakest enemy in range).  

 

And for silly things like single NPC aggro pulling,  why not have  a broadcast aggro range, where you pull one,  you pull them all (kobold pack tactics, anyone?)

 

 

I hope we can mod AI.

 

 

Unhappily, switching targets doesn't fix the problem, and generally makes matters worse. 

 

In the "stick with a single target even if it seems to be futile" scenario, you at least reduce the volume (and perhaps eliminate altogether) the attacks from the target that you are pursuing.  In a 1:1 scenario, this leads to a draw -- in a 1:many scenario (where "many" = NPCs), this may result in a win, if you can corner the PC.  Even in a many:1 scenario, the PCs other than the target are limited to ranged attacks only, which tend to be less damaging than melee attacks, at least drawing out the encounter.

 

 

I think this would be a legitimate AI for fast NPC's,  say wolves and such, which could pick and pin down back row squishes,

 

 

 

 

 

The "correct" solution requires an AI that is capable of the following:

1) It has to be able to position units under its control to make retreat unattractive (e.g. by engaging a foe so that you are between him and friendly units, ensuring that the most important targets end up in the "center" of a grand melee)

2) It has to be able to "pass off" responsibility for killing targets between units based on PC actions (a wounded unit that is attempting to disengage should be allowed to do so if and only if another unit will be able to engage).

3) It has to be able to predict (with some degree of accuracy) the movements and plans of the PC so that it can influence them (rather than always following the shortest path to the PC, it may be better to move away / perpendicular to the PCs predicted location to take advantage of terrain / other NPCs to pin the PC into place)

 

I'm not sure it is possible to write an AI that can do the above -- I'm very confident that Oblivion has no plans to attempt it in this game (if they had, some shadow of it would have been implemented by now).

 

 

  Some of these things would be pretty difficult to implement,  (ie prediction) .  I think with a varied set of semi-simplistic AI and decent combat mechanics, you could create some effective and fun AI combos that could give a lot of variety and replay.

Link to comment
Share on other sites

 

In the "switch targets to the nearest foe if you aren't able to attack your initial target" results in "ping-pong" behavior in the many:1 scenario ("many" = PCs, here) -- PC "A" starts fighting opponent "Z", but when "A" is wounded he runs away.  "Z" switches to the nearest target (which the player can control with a high degree of accuracy -- "B"), "A" heals up, "B" runs away, and "Z" switches back to "A".  The net result is that neither "A" nor "B" is ever seriously threatened yet can still use their (more effective) melee attacks rather than being limited to ranged attacks.  I don't believe the inability to heal health (v stamina) damage is sufficient to change the math in this scenario, although it does make it somewhat less attractive.

 

 

This to me is an argument in favor for engagement - discouraging melee kiting.   One could imagine crafting an encounter with large slow moving ogres operating on a switching non-pursuit AI, while you have fast wolves or archers that target-seek and lock fleeing low hp/squishy units.  

 

This to me would be challenging interesting combat,  without too sophisticated AI.   It should work with or without engagement, but I personally like the idea of engagement just because it adds another dimension.  

 

A standard AI could also go pursuit mode if it's faster,  switch mode if it's slower,  perhaps a never disengage mode  etc...  lot's of design room.  I'm not convinced IE games explored AI well.  

Edited by tdphys
Link to comment
Share on other sites

Also to answer your question Lephys, no, I don't have friendly fire on.  If I did I am sure it would work that way.  I am already playing on Nightmare, trust me, it is hard enough as it is.  Normal encounters can wipe me if I play poorly, not even kidding.

Oh, no worries. I wasn't judging you. If you were playing on EASY, I wouldn't even be judging you, :). But, definitely kudos for trying Nightmare. Like I said, in the ME games, I did all three on Insanity (although one or two missions in ME2 were RIDICULOUS on Insanity). But, after trying DA2 on anything above Normal (as a Mage), I can't bring myself to do my first playthrough of Inquisition on Nightmare, 8P. I am but a pansy, pansy Elf Mage, haha.

 

Anywho, yeah, their lore consistency is... a bit fragmented. I mean, as far as I can tell, if you even so much as PLAYED Awakening, automatically your Hero of Fereldan never perished. AND, Morrigan has a child with you no matter what, it seems? Or maybe she has a child with someone else no matter what, and it just doesn't tell you? I dunno. I saw an awful lot in the Tapestry at DragonAgeKeep.com that made me very, very puzzled, and I just remember things not making any sense as presented to the player about such things (Morrigan, you're aliveness in Awakening as the same person, etc.) when playing through the game, at the very least.

 

They've definitely changed their minds an awful lot.

  • Like 1

Should we not start with some Ipelagos, or at least some Greater Ipelagos, before tackling a named Arch Ipelago? 6_u

Link to comment
Share on other sites

This to me is an argument in favor for engagement - discouraging melee kiting.   One could imagine crafting an encounter with large slow moving ogres operating on a switching non-pursuit AI, while you have fast wolves or archers that target-seek and lock fleeing low hp/squishy units.  

 

This to me would be challenging interesting combat,  without too sophisticated AI.   It should work with or without engagement, but I personally like the idea of engagement just because it adds another dimension.  

 

A standard AI could also go pursuit mode if it's faster,  switch mode if it's slower,  perhaps a never disengage mode  etc...  lot's of design room.  I'm not convinced IE games explored AI well.  

 

 

With the engagement model that is implemented today (or anything resembling it), the only valid strategy for melee-only (or melee-dominated) foes is "Move towards the nearest foe and attack it continuously once engaged until it dies" (e.g. strategy 1).  Any attempt to engage an arbitrary foe ("squishies") will lead to engagement (& associated disengagement attacks) by the fighters, which will almost always block the straight-line path.  Avoiding this problem leads back to implementing the 3 critical functions that I mentioned earlier.

 

You are absolutely correct that the Infinity Engine AI is poor -- and remains poor (but better) with third party mods to improve it.  The reason is the scripting language -- you can't perform a simple loop in an IE script, much less determine the range between yourself and a particular foe.  I'm fairly confident (although I hope that I'm wrong) that the scripting language in PoE is going to be similarly limited -- certainly if it isn't, then none of the AI in the beta even makes a gesture at using the additional functionality.

 

Going way off topic (although, honestly, is there much left to say about the engagement implementation?):

 

The following features are absolutely essential to build halfway decent AI (& none of them exist in IE scripting):

 

1) Loops

2) Arrays (that you can loop over, that can be of arbitrary size and persist between script executions)

3) The ability to determine the range and bearing between any two objects in the area map.

4) The ability to generate a path to move an object between two arbitrary points, and the ability to modify that path after it has been generated by adding intermediate waypoints.

5) The ability to quickly and thoroughly evaluate the benefits and costs of using an AOE effect at some arbitrary X, Y target within the area based on standardized criteria.

6) The ability to quickly and thoroughly identify the arbitrary X,Y coordinates where an AOE should be activated based on standardized criteria ("most damage to foes", "most damage to foes - damage to friendlies", "most foes CC", "most friendlies healed - foes healed", "most foes killed - most friendly's killed", etc.)

7) The ability to designate an action as the "best found so far" (which will be executed if the script times out) while still allowing the script to run additional logic to search for a better action.

8) The ability to quickly and easily transmit complex (multi-variable) messages between different script instances, to allow co-ordination of activities.

 

3-6 need to be implemented as primitives, rather than allowing the AI designer to create their own, for performance reasons -- any interpreted langaugage (which a scripting language is going to be) will be very, very, very slow in comparison to the C++ / Java / C# that are compiled into the engine to begin with.  Since the above functions will be called many, many times during the course of a reasonable AI script, and time for executing the script will need to be tightly limited, it makes sense to "hard code" them.  #7 addresses this problem in a different way (by allowing a complex script to be interrupted if it is consuming too much CPU time).

 

Nice to haves:

 

* The ability to define user defined complex data structures and store them in arrays (e.g. C "structs" or even C# / Java "classes")

* The ability to spawn additional AI threads, with the script executed defined at runtime (for example, to coordinate the activity of an encounter group in a way that will persist even if any individual foe is killed)

 

Might be useful, but could live without:

 

* The ability to identify when the game has been paused (by the player) to allow more complex / deep analysis to be performed, with the results cached to be executed once the game is unpaused (very, very hard to leverage on the AI designer's part, but potentially very useful)

* The ability to "see" obstacles in the walkmesh for the area, so that the AI can take these into account in its decision making (again, this is very hard to implement)

* Implementation of the "fog of war" for the AI (where the AI's knowledge is limited to the information that is in the combat log -- it will only know that a foe is fire resistant after it has tried to use a fire effect on it, but afterwords will automatically take this knowledge into account).

  • Like 1
Link to comment
Share on other sites

 

This to me is an argument in favor for engagement - discouraging melee kiting.   One could imagine crafting an encounter with large slow moving ogres operating on a switching non-pursuit AI, while you have fast wolves or archers that target-seek and lock fleeing low hp/squishy units.  

 

This to me would be challenging interesting combat,  without too sophisticated AI.   It should work with or without engagement, but I personally like the idea of engagement just because it adds another dimension.  

 

A standard AI could also go pursuit mode if it's faster,  switch mode if it's slower,  perhaps a never disengage mode  etc...  lot's of design room.  I'm not convinced IE games explored AI well.  

 

 

With the engagement model that is implemented today (or anything resembling it), the only valid strategy for melee-only (or melee-dominated) foes is "Move towards the nearest foe and attack it continuously once engaged until it dies" (e.g. strategy 1).  Any attempt to engage an arbitrary foe ("squishies") will lead to engagement (& associated disengagement attacks) by the fighters, which will almost always block the straight-line path.  Avoiding this problem leads back to implementing the 3 critical functions that I mentioned earlier.

 

You are absolutely correct that the Infinity Engine AI is poor -- and remains poor (but better) with third party mods to improve it.  The reason is the scripting language -- you can't perform a simple loop in an IE script, much less determine the range between yourself and a particular foe.  I'm fairly confident (although I hope that I'm wrong) that the scripting language in PoE is going to be similarly limited -- certainly if it isn't, then none of the AI in the beta even makes a gesture at using the additional functionality.

 

 

I'd append a bit more to strategy 1:

-  If target disengages,  don't follow if other units are engaged with self.  

 

But seriously,  this seems to me a valid interesting component of an AI.     I agree that trying to engage *squishy/ low health foes* will probably lead to opposing fighters trying to engage to protect the dying/weak,  but isn't this what tactics are all about?    Even just this  * retarget squishy/low health  enemies * if possible seems like better AI then whats been talked about in BB and definitely whats in IE games. 

 

I did read the rest of your off-topic AI wish-list.  I'm just a little worried about shooting for high complexity in your AI scripts could possibly bringing the game to its knees, even if it's mostly compiled.  I'm not convinced varied relatively simple AI couldn't do the trick.

 

That being said,  yeah, loops might be nice.   I don't suppose anybody knows what scripting language POE using for AI? (Hint, Hint, Sensuki)

Link to comment
Share on other sites

First, I just wanna say that the act of kiting isn't bad. The ability to freely execute it without ever being touched is bad. Intelligently retreating and taking advantage of range and speed is a tactical choice in a given situation (namely one where you have both a range and speed advantage). It's always being able to do so pretty much whenever you want (basically, a lack of any manner of counter-tactics, and/or too frequent of a presence of both range and speed advantages, etc.) that's the problem. And this does have a lot to do with AI.

 

Second, you don't necessarily have to program AI to predict things and choose actions in the most efficient manner ever. In fact, when you do that, it tends to just be more complex, but still predictable (a la the comparison above of the foe never changing targets to the foe always reliably changing targets under certain conditions). The thing that separates humans from AI is "randomness," for lack of a better word. If two human generals are fighting a battle with their troops, one can say "Ahh, he's going to expect me to do A, so I'm actually going to do B." Or, to look at it another way, imagine you're in control of that example creature that's being kited by the player. Would you just switch targets every single time someone did a certain amount of damage to you? Or would you try to figure out a way to make it difficult for the player to know when you were actually going to change your course of action? The latter, most likely. Now, you'd think all that through, but the difference in action is basically that, when presented with various options (change targets versus stay the course, versus maybe use an ability, etc.), sometimes you're going to pick A, sometimes you'll pick B, and sometimes you'll pick C. One time, when you get hit with a huge attack, you might just bullrush that person who made the attack. And other times, you might switch to a ranged weapon and unload on the person with the lowest health, etc.

 

So, really, I think the most significant factor in AI is unpredictability. Maybe that one ogre you run into switched targets a lot, while this other one just keeps charging the same target, or does something different. Basically, you still write the AI to figure out a list of viable options (you wouldn't have it do stupid things that don't make any sense, basically), and then you'd have it roll to determine what to do. What this means for the player is, every time you try the same tactic twice against a given type of enemy, you won't really be certain how the enemy's going to react.

 

*shrug*

  • Like 3

Should we not start with some Ipelagos, or at least some Greater Ipelagos, before tackling a named Arch Ipelago? 6_u

Link to comment
Share on other sites

 

You are absolutely correct that the Infinity Engine AI is poor -- and remains poor (but better) with third party mods to improve it.  The reason is the scripting language -- you can't perform a simple loop in an IE script, much less determine the range between yourself and a particular foe.  I'm fairly confident (although I hope that I'm wrong) that the scripting language in PoE is going to be similarly limited -- certainly if it isn't, then none of the AI in the beta even makes a gesture at using the additional functionality.

 

I may have misheard, but didn't Josh say fairly recently that they wouldn't be implementing user-accessible scripting  in PoE?

 

No doubt it's possible to tweak such things by diving into the C code, but that's quite the same thing.

Link to comment
Share on other sites

First, I just wanna say that the act of kiting isn't bad. The ability to freely execute it without ever being touched is bad. Intelligently retreating and taking advantage of range and speed is a tactical choice in a given situation (namely one where you have both a range and speed advantage). It's always being able to do so pretty much whenever you want (basically, a lack of any manner of counter-tactics, and/or too frequent of a presence of both range and speed advantages, etc.) that's the problem. And this does have a lot to do with AI.

 

 

Absolutely

 

 

So, really, I think the most significant factor in AI is unpredictability. Maybe that one ogre you run into switched targets a lot, while this other one just keeps charging the same target, or does something different. Basically, you still write the AI to figure out a list of viable options (you wouldn't have it do stupid things that don't make any sense, basically), and then you'd have it roll to determine what to do. What this means for the player is, every time you try the same tactic twice against a given type of enemy, you won't really be certain how the enemy's going to react.

 

*shrug*

 

Yep,  Have a bunch of simple states (engage, pursuit, protect, etc)  with a Markov-Chain style random transition between them would be great and unpredictable.

  • Like 2
Link to comment
Share on other sites

Yep,  Have a bunch of simple states (engage, pursuit, protect, etc)  with a Markov-Chain style random transition between them would be great and unpredictable.

 

 

This is exactly how the Infinity Engine scripts work -- you have a long list of conditional blocks paired with action blocks + a chance to execute.  So you might have <pseduo-code> "If my health is greater than 75% and I'm not currently engaged in melee combat then 50% of the time attack the closest target".  You can have any number of conditions that you want, but only one of the action blocks will be performed (the script exits immediately if it finds a true conditional block and the RNG check passes).

 

To point out the obvious, we have just been discussing the inadequacies of the AI in the infinity engine games, so... :)

 

I tend to agree that trying to write overly complex AI scripts is counterproductive (although perhaps useful in certain cases -- enemy party AI, for example) -- but the simple <condition> -> <action> blocks that was used in the IE games is inadequate to implement tactics such as the following:

 

* If there are friendly melee units closer to the enemy than I am, then

    * Wait up to 10 seconds or until at least one friendly unit has engage a foe in melee combat, then

         * See if a path exists that will allow me to engage a currently unengaged target -- if so, start following that path

* If I haven't tried to cast an AOE damaging spell in more than 60 seconds, then

     * For each AOE damaging effect that I have (most powerful -> least powerful)

          * Find the best X,Y target for the current AOE effect, considering only damage to foes, then

                * Reevaluate that target taking into account damage to friendlies, then

                     * If revaluation results in a score reduction of more than than 25 %, and the damage to foes exceeds 100 points, then

                          * Check to see if the party contains an AOE spell that will mitigate the AOE's effects to friendly units.  If so, then

                               * Cast (or request another unit to case) the protection spell and re-evaluate the AOE after it has been cast.

                      * Cast the AOE spell

 

Obviously, these are incomplete fragments, but you get the picture -- these aren't by any means "genius-level" AI, but far more robust (and, just as importantly, easier to implement) than the simple scripts possible in the IE games.

Link to comment
Share on other sites

 

Yep,  Have a bunch of simple states (engage, pursuit, protect, etc)  with a Markov-Chain style random transition between them would be great and unpredictable.

 

 

 

Obviously, these are incomplete fragments, but you get the picture -- these aren't by any means "genius-level" AI, but far more robust (and, just as importantly, easier to implement) than the simple scripts possible in the IE games.

 

 

Yeah, this is exactly what I was thinking,  to me you've described 2 states of AI,  one focused on pursuit,  the other focused on AOE artillery.    Now add a random state transition that allows a shift from say, artillery AOE searching to.... 

 

Sniper:

    * Search for enemy with lowest stamina in range,  if stamina < 10% then

          *  target with single damage spell/attack

 

So say you have an AOE equipped wizard,  whose main state is the AOE one you described,  but every 5 seconds does a RNG markov process,  which has  a  10% chance to shift to the sniper AI with a chance to shift back.  

 

Maybe you have a AOE wizard with less powerful AOE spells, and some serious single spell damage,    you bump up the transition chance.  

 

Thus you end up with some interesting varied,  random  AI that can be easily tuned per NPC,  without having to combine all the states into a single massive if-then statement. 

Edited by tdphys
Link to comment
Share on other sites

Which leads me to the question of whether or not DA:I is an RPG at all which, based on my experience with the game so far, I seriously doubt.

 

I don't think there has been any "AAA" game that we could actually flag as RPG in years now, beside Hack n Slashes. That's not surprising.

Qu'avez-vous fait de l'honneur de la patrie ?

Link to comment
Share on other sites

Sniper:

    * Search for enemy with lowest stamina in range,  if stamina < 10% then

          *  target with single damage spell/attack

 

Except what you really meant to say was "Iterative over all visible foes and find the foe with the lowest stamina..." which requires a loop. Alternatively, "Find lowest stamina" could be a hard-coded function, but what if you want to look for the friendly unit with the lowest deflection bonus (to cast a buff on them)?

 

You don't need much more than if ... then ... blocks to implement a reasonable AI, but you do need a bit more.

  • Like 1
Link to comment
Share on other sites

 

Sniper:

    * Search for enemy with lowest stamina in range,  if stamina < 10% then

          *  target with single damage spell/attack

 

Except what you really meant to say was "Iterative over all visible foes and find the foe with the lowest stamina..." which requires a loop. Alternatively, "Find lowest stamina" could be a hard-coded function, but what if you want to look for the friendly unit with the lowest deflection bonus (to cast a buff on them)?

 

You don't need much more than if ... then ... blocks to implement a reasonable AI, but you do need a bit more.

 

 

  But wait,  let's just have simple lambdas and do everything recursively... Ahah!!! loops begone

 

J/K

 

Yes, I agree loops are necessary (And I'm astounded the older IE games didn't have them, but I guess compute power might have been an issue).

 

From some of the other responses, sounds like the AI's going to be done in Engine,  so there'll be no lack of logic/operations/control .   I did look into some of the Unity scripting,  they seem to have their own *javascript* like language, but I don't know if POE is using it..

Link to comment
Share on other sites

×
×
  • Create New...