Project

General

Profile

Bug #4192

Archers in OpenMW have shorter attack range than archers in Morrowind

Added by Randy Davin 16 days ago. Updated 11 days ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
AI
Target version:
Start date:
11/07/2017
% Done:

100%

Reproducibility:
Always
Operating system:
Other
Severity:
Normal

Description

1. Go to Pelagiad Fort
2. Theres an Imperial Archer outside, startcombat the archer
3. Observe the attack range by going farther from the archer. He will have to come closer to you, just to shoot his arrows.

In Morrowind, the archer have significantly longer range, from my testing, even as far as 4x to 5x more than OpenMW.

Not only that, why do archers need to go to a specific range just to shoot his arrows? Clearly not intended.

ranged_test.omwsave (536 KB) Randy Davin, 11/07/2017 09:48 AM

Associated revisions

Revision a7fd27f4
Added by scrawl . 11 days ago

Merge pull request #1544 from rexelion/archerrangefix

use fProjectileMaxSpeed for ranged weapons distance (fixes #4192)

History

#1 Updated by Randy Davin 16 days ago

This also applies to throwing weapons and bolts.

#2 Updated by Chris Robinson 16 days ago

Jaynet Pogi wrote:

Not only that, why do archers need to go to a specific range just to shoot his arrows?

You want to be close enough for the enemy to have a difficult time dodging, but far enough so that the enemy will have a difficult time quickly getting to you.

In this particular case, I'd check to see if there are any GMSTs that specify the desired range(s) for ranged missile attackers. If so check if OpenMW uses them, or if vanilla ignores them (IIRC, there are some GMSTs that vanilla defines but doesn't actually use for their apparent purpose).

#3 Updated by Andrei Kortunov 16 days ago

  • Status changed from New to Confirmed
  • Operating system changed from Windows to Other

For now OpenMW uses the hardcoded 1000 game units distance for ranged weapons (ActionWeapon::getCombatRange() function).
Morrowind uses the fProjectileMaxSpeed GMST value as marksman weapons attack range (3000 game units by default, nearly 40 meters).
Should be easy to fix.

#4 Updated by Andrei Kortunov 16 days ago

Can you test also target spells combat range? OpenMW now uses the fCombatDistance * max(2, fHandToHandReach) * 4 combat distance.

#5 Updated by Randy Davin 16 days ago

Andrei Kortunov wrote:

Can you test also target spells combat range? OpenMW now uses the fCombatDistance * max(2, fHandToHandReach) * 4 combat distance.

Tested. The result seemed to be the same. Both spell and ranged weapon have similar distance.

In addition, I noticed that if the spell projectile hits the player, the npc casting the spell will come closer to the player, but if you dodge the projectile(by going sideways), the npc stays within distance. Is this another bug? Why would the npc go closer every time the spell projectile hits?

I attached a savegame file. There will be 2 npc attacking, one with bow another with a poison spell. You can see test this bug and see for yourself. Only using morrowind.esm.

The TAI console command could be handy here, to check the distance.

#6 Updated by Andrei Kortunov 16 days ago

I noticed that if the spell projectile hits the player, the npc casting the spell will come closer to the player

Just a guess:
1. NPC casts the spell
2. NPC selects the next combat action. AI will not cast the same spell - the spell is already applied to the victim.
So the NPC casts other spell, or switches to his melee weapon and comes closer to the player
3. When the spell expires, the NPC casts it again.
If the NPC has only one combat spell and melee weapon, there may be the spell->weapon->spell->weapon switch.

Please, try to reproduce this bug with magic items. IIRC, AI will use magic item again, if there is a remaining spell duration < 3 seconds.
We can use the similar fix for target spells, or search for a better solution.

#7 Updated by Randy Davin 16 days ago

Please, try to reproduce this bug with magic items. IIRC, AI will use magic item again, if there is a remaining spell duration < 3 seconds.

Yes, if the spell duration is <= 3 , the AI will use the magic item again, when I tried 5 seconds, the AI starts moving towards the player to fight. After 5 seconds, the AI will again use the magic item.

#8 Updated by Andrei Kortunov 16 days ago

Please, create a separate report for this bug.

#9 Updated by rexelion . 16 days ago

In vanilla Morrowind the range for target spells seems to be about 1050 units, in OpenMW it is roughly the same.

#10 Updated by Alexei Dobrohotov 16 days ago

  • Category set to AI
  • Status changed from Confirmed to Resolved
  • Assignee set to rexelion .
  • Target version set to openmw-0.44
  • % Done changed from 0 to 100

#11 Updated by Andrei Kortunov 15 days ago

In vanilla Morrowind the range for target spells seems to be about 1050 units, in OpenMW it is roughly the same.

But Morrowind can use GMST to determine it (something like fTargetSpellMaxSpeed, 1000 by default), so on the modded game results can be different.
OpenMW uses fCombatDistance * max(2.0, fHandToHandReach) * 4 distance.
Does vanilla game use the same formula?

#12 Updated by rexelion . 15 days ago

No, if I vary fFombatDistance, it doesn't go below ~1000, and I am not sure it is proportional to fCombatDistance after that, I'll do some more testing. And it didn't change with fTargetSpellMaxSpeed.

#13 Updated by rexelion . 15 days ago

For fCombatDistance between 10 and 1000, the distance was 1050 units, when I set fCombatDistance to 1001, NPC started casting spells at 4900 units from me.

#14 Updated by Alexei Dobrohotov 11 days ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF