Ship flying in the wrong direction

For test results, bug reports, announcements of new builds etc.

Moderators: winston, another_commander, Getafix

Post Reply
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Ship flying in the wrong direction

Post by Eric Walch »

I encountered a lone escort in fight with a pirate, so I went in to help him. After killing the pirate , the escort went on as a router1patrol. But I found it odd that it headed towards the planet because patrols always start heading to the witchpoint, so I started examining him more closely.

His AI state was "HEAD_FOR_WITCHPOINT" so he was clearly moving in the wrong direction. Logging AI showed:

Code: Select all

[ai.takeAction]: Mamba Escort 417 to take action setCourseToWitchpoint
[ai.takeAction]: Mamba Escort 417 to take action checkCourseToDestination
[ai.takeAction]: Mamba Escort 417 to take action scanForOffenders
[ai.takeAction]: Mamba Escort 417 to take action pauseAI: 10.0
[ai.message.receive]: AI route1patrolAI.plist for Mamba Escort 417 in state 'HEAD_FOR_WITCHPOINT' receives message 'NOTHING_FOUND'. Context: handling deferred message, stack depth: 0
[ai.message.receive]: AI route1patrolAI.plist for Mamba Escort 417 in state 'HEAD_FOR_WITCHPOINT' receives message 'COURSE_OK'. Context: handling deferred message, stack depth: 0
Every update he executed the instruction "setCourseToWitchpoint", meaning that its destination should be set to the zero vector [0,0,0].

But an entity dump showed:

Code: Select all

  [dumpState.shipEntity]: Type: neo-mamba-escort
  [dumpState.shipEntity]: Name: Mamba Escort
  [dumpState.shipEntity]: Display Name: Mamba Escort
  [dumpState.shipEntity]: Roles: <OORoleSet 0x11eb33cc0>{[neo-mamba-escort] escort oolite-mamba-escort shader-escort}
  [dumpState.shipEntity]: Primary role: escort
  [dumpState.shipEntity]: Script: <OOJSScript 0x1011f2430>{"oolite-default-ship-script" version 1.77}
  [dumpState.shipEntity]: Subentity count: 1
  [dumpState.shipEntity]: Behaviour: BEHAVIOUR_FLY_TO_DESTINATION
  [dumpState.shipEntity]: Target: <none>
  [dumpState.shipEntity]: Destination: (-17105.7, -16955.8, 239156)
  [dumpState.shipEntity]: Other destination: (0, 0, 0)
  [dumpState.shipEntity]: Waypoint count: 0

  [dumpState.shipEntity.ai]: AI:
    [dumpState.ai]: State machine name: route1patrolAI.plist
    [dumpState.ai]: Current state: HEAD_FOR_WITCHPOINT
    [dumpState.ai]: Next think time: 1428.83
    [dumpState.ai]: Next think interval: 0.125
Somehow the destination was never updated to (0, 0, 0). Its current position was (-17017.2, -17557.1, 214540), so the destination was probably the last position were his mother was attacked and he started fighting. Still strange and a bug somewhere. :(

EDIT:
After following it another few minutes, till it reached above destination, I noticed nothing happened. Making another entity dump, I noticed the mamba had a new destination:

Code: Select all

[dumpState.shipEntity]: Destination: (-17085.4, -16251.1, 269656)
I begin tho think that his original mother is still alive in the system and is updating its escort position.

Code: Select all

> PS.target
[Ship "Mamba Escort" position: (-23454.3, -18068.3, 245320) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT]
> PS.target.group
[OOShipGroup "escort group", 2 ships, leader: <ShipEntity 0x136ef6a00>{"Boa Class Cruiser"}]
Post Reply