Project

General

Profile

Bug #3406

AI spell priority differs from Morrowind AI

Added by August Avatar over 1 year ago. Updated 12 days ago.

Status:
Confirmed
Priority:
Normal
Assignee:
-
Category:
AI
Target version:
Start date:
05/27/2016
% Done:

50%

Reproducibility:
Always
Operating system:
Windows
Severity:
Normal

Description

Should be easily reproducible by visiting Addamasartus on game start. In vanilla Melar Baram will usually attempt to use his ranged magic upon spotting the player (a simple Weakness to Common Disease spell, or "Wild Strain", a Drain Agility spell). It's possible for the player to dodge these and exhaust his magicka supply, in which case he'll resort to using a Chitin Dagger. In OpenMW he will immediately close in to use his on-touch Firefist spell (Fire Damage and Damage Health), which is far more devastating and will wipe out a new character in seconds. He will never attempt to use his ranged magic.

Tested on nightly 64fdc5a21a.


Related issues

Related to OpenMW - Bug #3405: Mulvisic Othril will not use her chitin throwing stars Closed 05/27/2016
Related to OpenMW - Bug #3855: AI sometimes spams defensive spells Confirmed 05/02/2017

History

#1 Updated by scrawl . over 1 year ago

  • Related to Bug #3405: Mulvisic Othril will not use her chitin throwing stars added

#2 Updated by scrawl . over 1 year ago

  • Category set to AI

#3 Updated by August Avatar over 1 year ago

The related issue has been resolved (Revision 256439f8 I believe?). A similar solution may be needed for ranged magic.

#4 Updated by Marc Zinnschlag about 1 year ago

  • Target version changed from openmw-0.40 to openmw-0.41

#5 Updated by August Avatar about 1 year ago

Update - in an inversion of the above, Ash Slaves in vanilla Morrowind make far more use of their Spark spell when in combat, while in OpenMW they will spam the much more benign Earwig spell. This may warrant an issue title change - I fear the actual problem here may be a jumbled spell priority across the board.

#6 Updated by Marc Zinnschlag 10 months ago

  • Target version changed from openmw-0.41 to openmw-0.42

#7 Updated by R. D. 10 months ago

  • Subject changed from Melar Baram will not use his ranged magic spell to AI spell priority differs from Morrowind AI

#8 Updated by Marc Zinnschlag 6 months ago

  • Target version changed from openmw-0.42 to openmw-0.43

#9 Updated by Miroslav Remák 5 months ago

  • Related to Bug #3855: AI sometimes spams defensive spells added

#10 Updated by Andrei Kortunov 3 months ago

Ash Slaves in vanilla Morrowind make far more use of their Spark spell when in combat, while in OpenMW they will spam the much more benign Earwig spell.

In this particular case Earwig has a higher priority because Earwig has 5 seconds duration, Spark has 1 second duration.

Does anyone know how vanilla Morrowind rates spell? As described in vanillaRateSpell() in aicombataction.cpp?
It seems Morrowind AI prefers to cast spells with higher magicka cost (Spark has 7 cost, Earwig has 3 cost, for example). That's why Morrowind AI do not use powers with 0 cost (according to MCP).

#11 Updated by Andrei Kortunov 3 months ago

Earwig has 3 cost

6 actually, I looked to base cost first.

#12 Updated by Andrei Kortunov 3 months ago

Conclusion: we can implement priority based by magicka cost or take in account spell area (almost the same since we already use base cost, magnitude and duration for rating calculation).

#14 Updated by R. D. 3 months ago

First, thank you for your work on the AI. For this, and for all AI combat decisions, I think it would be nice to at some point have a choice between smarter AI, and AI that copies original behavior. AI that copies original behavior is good to have because all content created for original Morrowind was tested using it. I think it would be fun if we could somehow even allow for mixing the two, so you could have original AI fight against smarter AI or something like that. Of course, it's more work to support multiple AIs.

As for a smarter AI, well, choosing spell by base cost seems like a kind of shortcut for decision-making, since in general more expensive spells should be more effective, but choosing by other factors would probably be smarter.

#15 Updated by R. D. 3 months ago

choosing spell by base cost

I don't know why I wrote "base cost." I meant spell cost.

#16 Updated by R. D. 3 months ago

I meant spell cost.

A correction to the correction. I mean "magicka cost."

#17 Updated by Andrei Kortunov 3 months ago

choosing by other factors would probably be smarter.

I suggest to use per-effect special cases for spell rating, and use magicka cost based rating as fallback (until 1.0, at least).

#18 Updated by Andrei Kortunov 3 months ago

An additional testing: I tried to set magicka cost of "fireball" spell to 0. Morrowind AI did not use this spell in this case.

#19 Updated by Andrei Kortunov 3 months ago

Ash Slaves in vanilla Morrowind make far more use of their Spark spell when in combat, while in OpenMW they will spam the much more benign Earwig spell.

Taking spell area in account allows to fix it.

But the problem with Melar Baram is still persists: he uses Weakness to common disease spell in Morrowind and Firefist in OpenMW.
In OpenMW combat AI does not use some effects include Weakness to common disease (because these effects are useless in combat).
I am not sure that we will fix it.

#20 Updated by Alexei Dobrohotov 3 months ago

  • Status changed from New to Confirmed
  • % Done changed from 0 to 50

#21 Updated by August Avatar 3 months ago

Andrei Kortunov wrote:

But the problem with Melar Baram is still persists: he uses Weakness to common disease spell in Morrowind and Firefist in OpenMW.
In OpenMW combat AI does not use some effects include Weakness to common disease (because these effects are useless in combat).
I am not sure that we will fix it.

Understandable. I have speculated whether the inclusion of such a useless spell was a conscious design choice, to teach new players the pros and cons of closing the distance on an enemy (Addamasartus is likely the first dungeon the player will be told about if they're interacting with NPCs in Seyda Neen). Such speculation is difficult to prove however, and it's hard to tell what the developers intended.

#22 Updated by Andrei Kortunov 3 months ago

I have speculated whether the inclusion of such a useless spell was a conscious design choice

A bad design of stats autocalculation, I think. Some of mages with have a lot of junk spells and no any useful spells and weapons. That's why they waste magicka for spells such as Drain Personality, Weakness to Common Disease, Burden, etc.

I do not know why Bethesda's game designers prefered to add these effects over Shield, Bound weapons, Poison, etc. useful effects.

For example, if you create an NPC with high Conjuration and Illusion skills and low Destruction skill, you should add Paralyze, Silence and summon spells to this character.
If you will add to him only Turn undead, Calm Humanoid and Charm spells, this character obviously will be helpless in combat.

#23 Updated by Andrei Kortunov 3 months ago

I think it would be nice to at some point have a choice between smarter AI

We can add an option to switch between vanilla-style combat AI and advanced combat AI.
For example, we can allow vanilla-style AI to cast spells with useless effects. In this case we will fix this bug.

#24 Updated by Andrei Kortunov about 2 months ago

A problem with Ash Slaves should be fixed now - AI not takes in account spell Range and Area.

#25 Updated by scrawl . 12 days ago

  • Target version changed from openmw-0.43 to openmw-1.0

Also available in: Atom PDF