Opened 14 months ago

Last modified 14 months ago

#6757 new defect

[PETRA] TransportPlan onBoarding causes errors for units that are already on a boat

Reported by: Langbart Owned by:
Priority: Should Have Milestone: Alpha 27
Component: AI Keywords:
Cc: Patch:

Description (last modified by Langbart)

  • the issue starts to occur at turn 20371
    Turn 20370 (200)...
    Turn 20371 (200)...
    ERROR: JavaScript error: simulation/ai/petra/transportPlan.js line 384
    oldPos is undefined
      PETRA.TransportPlan.prototype.onBoarding@simulation/ai/petra/transportPlan.js:384:9
      PETRA.TransportPlan.prototype.update@simulation/ai/petra/transportPlan.js:290:8
      PETRA.NavalManager.prototype.update@simulation/ai/petra/navalManager.js:832:42
      PETRA.HQ.prototype.update@simulation/ai/petra/headquarters.js:2285:20
      PETRA.PetraBot.prototype.OnUpdate@simulation/ai/petra/_petrabot.js:118:11
      m.BaseAI.prototype.HandleMessage@simulation/ai/common-api/baseAI.js:64:7
    Turn 20372 (200)...
    
  • adding a debug message:
    • binaries/data/mods/public/simulation/ai/petra/transportPlan.js

      a b PETRA.TransportPlan.prototype.onBoarding = function(gameState)  
      379379
      380380            if (time - ent.getMetadata(PlayerID, "timeGarrison") > 2)
      381381            {
       382                API3.warn("timeGarrison" + ent.getMetadata(PlayerID, "timeGarrison"))
       383                API3.warn("posGarrison" + ent.getMetadata(PlayerID, "posGarrison"))
       384                API3.warn("ent" + ent)
      382385                let oldPos = ent.getMetadata(PlayerID, "posGarrison");
      383386                let newPos = ent.position();
      384387                if (oldPos[0] == newPos[0] && oldPos[1] == newPos[1])
WARNING: PlayerID 2 |   timeGarrison4071.2
WARNING: PlayerID 2 |   posGarrisonundefined
WARNING: PlayerID 2 |   ent[Entity 5531 units/pers/champion_cavalry_archer]

timeline

  • ~55min entity (5531) is spawned
  • ~57min it is loaded into a boat and transported to another island
  • unloaded
  • ~58min it is loaded into a boat and will remain in that boat till the errors get triggered, it is the only passenger
    • entity id of the boat is 2667
  • ~68min the errors appear
    • entity 5531 units/pers/champion_cavalry_archer has no position, because it is garrisoned within a ship

useful console commands

# get the position of the units/pers/champion_cavalry_archer
Engine.GuiInterfaceCall("GetEntityState", 5531).position

# get the position of the ship, where 5531 is garrisoned within
Engine.GuiInterfaceCall("GetEntityState", 2667).position

# jump to the action
Engine.CameraMoveTo(x,z)

to reproduce

  • the issue can be noticed in the latest dev [27570] version by starting a random/migration map with a Large map size in DeathMatch mode and ~5 AI players, start some simulations and wait ~20min

note

  • this bug seems to be unrelated to #6385

Attachments (2)

ai_error.png (390.4 KB ) - added by Langbart 14 months ago.
commands_20min_rP27570.txt (106.3 KB ) - added by Langbart 14 months ago.

Download all attachments as: .zip

Change History (3)

by Langbart, 14 months ago

Attachment: ai_error.png added

comment:1 by Langbart, 14 months ago

Description: modified (diff)
  • adding a shorter way to reproduce the issue

by Langbart, 14 months ago

Attachment: commands_20min_rP27570.txt added
Note: See TracTickets for help on using tickets.