Opened 3 months ago

Closed 3 months ago

#6899 closed defect (fixed)

Player kills hostile animal owned by AI - errors about orderData undefined

Reported by: Norse_Harold Owned by: Freagarach
Priority: Should Have Milestone: Alpha 27
Component: AI Keywords: fauna, hostile, Petra, AI, orderData, undefined, animal, bear, wolfhound, error, warning
Cc: Patch:

Description (last modified by Norse_Harold)

Summary: If a player kills a wild animal that is hostile and owned by an AI-controlled player then a large amount of warnings and errors appear.

Versions known to be affected: release version alpha 0.0.26, dev a27 version r27624, dev a27 version rc1 r27645.

Expected results: Either it is not possible for the scenario editor to create a map that causes these symptoms, or the errors do not occur when an AI-owned hostile animal is killed.

Actual results: A large amount of warning and error messages appear. Excerpts are attached.

Steps to reproduce the symptoms:

  • Extract the "Flatland with player-owned bears.zip" file to the mods/user/maps/scenarios folder in your 0ad game data folder.
  • Load the scenario "Flatland with player-owned bears". Slot yourself as player 1, and slot 1 AI in the remaining slots.
  • Use the cheat "gift from the gods" (type it in chat) to get p3, a lot of resources, and fast building.
  • Build a stable and produce 50 cavalry.
  • Send the cavalry to attack AI-controlled player 2, toward the east (3 o'clock).
  • After fighting with an AI-controlled opponent and killing one of its bears, the error should appear continuously until the AI player is neutralized.

Computing Environnment (OS brand and version, hardware, relevant driver version and other software versions): The OS I have used for testing is Linux. The problem does not seem to be hardware dependent, as others have observed the same symptoms.

Relevant logs, files that reproduce the symptoms, screenshots, etc.: (attached)

Credits: First reported by seregadushka and Alexandra in this forum post.

Attachments (4)

Flatland with player-owned bears.zip (3.6 KB ) - added by Norse_Harold 3 months ago.
The map "Flatland with player-owned bears"
Flatland with player-owned bears error messages.txt (1.4 KB ) - added by Norse_Harold 3 months ago.
Errors when using "Flatland with player-owned bears" map
Winter Is Coming(5).zip (395.6 KB ) - added by Norse_Harold 3 months ago.
The map "Winter Is Coming" with AI player-owned bears and wolfhounds
Winter Is Coming warnings and error messages.txt (7.3 KB ) - added by Norse_Harold 3 months ago.
Errors when using "Winter Is Coming" map (with AI player-owned bears and wolfhounds)

Download all attachments as: .zip

Change History (6)

by Norse_Harold, 3 months ago

The map "Flatland with player-owned bears"

by Norse_Harold, 3 months ago

Errors when using "Flatland with player-owned bears" map

by Norse_Harold, 3 months ago

Attachment: Winter Is Coming(5).zip added

The map "Winter Is Coming" with AI player-owned bears and wolfhounds

by Norse_Harold, 3 months ago

Errors when using "Winter Is Coming" map (with AI player-owned bears and wolfhounds)

comment:1 by Norse_Harold, 3 months ago

Description: modified (diff)

comment:2 by Freagarach, 3 months ago

Owner: set to Freagarach
Resolution: fixed
Status: newclosed

In 28025:

[PetraAI] - Fix resources (dead animals) coming in the defense army.

When a wild animal was in a defenseArmy and it was killed, its resource got into the army as well. This caused a call to GetUnitAIOrder data which was undefined for the resource.
Fixed by checking for UnitAI-ness and also for attack-ability whilst at it.

Reported by @seregadushka at the forums: https://wildfiregames.com/forum/topic/110098-petra-error-winter-is-coming5/.

Investigated and MWE by @Norse_Harold.
Fixes #6899

Note: See TracTickets for help on using tickets.