Project

General

Profile

Bug #4036

Weird behaviour of AI packages if package target has non-unique ID

Added by Andrei Kortunov 4 months ago. Updated 6 days ago.

Status:
In Progress
Priority:
Normal
Category:
AI
Target version:
Start date:
08/22/2017
% Done:

0%

Reproducibility:
Always
Operating system:
Other
Severity:
Normal

Description

Just attack a telvanni guard and resist arrest.
The guard will summon some creatures, but usually they do not attack you.

Our current implementation of AiFollow and AiEscort stores only ID of leader, not pointer, so these creatures can get an another guard as leader.
Is it safe to store a pointer instead of ID?

History

#1 Updated by Andrei Kortunov 4 months ago

  • Subject changed from Weird behaviour of followers if leader has non-unique ID to Weird behaviour of AI packages if package target has non-unique ID

This problem might be wider: looks like for all AI packages we store only target ID, and search for target pointer via searchPtr() or searchPtrViaActorId().

If target has a non-unique ID, a current implementation can cause unintended behaviour.

#2 Updated by Andrei Kortunov 4 months ago

  • Description updated (diff)

#3 Updated by Andrei Kortunov 4 months ago

Looks like we can take AiCombat as example. AiCombat uses CreatureStats::getActorId() (an integer) instead of non-unique string ID.
But changes can require savegame format change.

#4 Updated by Andrei Kortunov 4 months ago

FYI: in AiPursue and AiCombat OpenMW use an integer target actor ID, but in AiFollow and AiEscort - non-unuque string ID. This is a bug or feature?

#5 Updated by Miroslav Remák 4 months ago

Sounds like a bug to me.

#6 Updated by Alexei Dobrohotov 3 months ago

  • Status changed from New to Confirmed

#7 Updated by Alexei Dobrohotov 23 days ago

  • Target version set to openmw-1.0
  • Operating system changed from Linux to Other

#8 Updated by Andrei Kortunov 21 days ago

  • Status changed from Confirmed to In Progress
  • Assignee set to Andrei Kortunov
  • Target version changed from openmw-1.0 to openmw-0.44

#9 Updated by August Avatar 6 days ago

Recently I came across a Clannfear attacking a guard who defensively summoned a Greater Bonewalker, which proceeded to do nothing. Looks like the same issue you describe here.

Also available in: Atom PDF