cim wrote:Hmm... I think I know what's happening there: side-effect from fixing a previous bug which rammed the ships into the station if the docking routine was interrupted.
I saw a ship do this whilst the trader I'd just escorted to the station was actively engaged in the process of docking.. a new bug, or part of the old one?
cim wrote:Should only happen if a ship gets a launch-then-immediately-dock loop in its AI, which also shouldn't happen... Unfortunately the entity dumps are basically useless for debugging the JS AI - you really need to use the debug console for that.
Ok.. got the debug console output for pretty much the exact same kind of event tonight.
First, a question.. is there a way to get ALL debug console output to be written to the log? Whilst I got the
behaviourLogging
info fine, output of other commands was not logged, and unfortunately, there is no way to copy/paste the output displayed on the Javascript console. I was forced to take a screenshot to record some of the output.
Once again, this was at Texebi (G2).
Looking over the results, it looks as if you're correct in thinking that the ship is attempting to dock immediately after launching. In the middle of the output from
PS.target.AIScript.oolite_priorityai.setParameter("oolite_flag_behaviourLogging",true);
I entered
PS.target.dockingInstructions
on a hunch, and got the following result:
Code: Select all
PS.target.dockingInstructions
{
docking_stage: -1,
ai_message: "TRY_AGAIN_LATER",
match_rotation: 0,
speed: 0,
destination: {
x: 28389.936069868992,
y: -105360.17358157296
z: 615279.4937729794
},
range: 100,
station: [Station "Coriolis Station" "Coriolis Station"position: (28284.9, -107689, 614737) scanClass: CLASS_STATION status: STATUS_ACTIVE]
}
PS.target.AIScript
returned
[Script "Oolite Trader AI" version 1.80]
PS.target.destinationSystem
returned
215
PS.target.homeSystem
returned
182
The output for the
behaviourLogging
is as follows:
Code: Select all
03:24:51.370 [Python Blackdog]: Considering branch with 10 entries
03:24:51.372 [Python Blackdog]: Considering: entry 0
03:24:51.374 [Python Blackdog]: Considering: entry 1
03:24:51.374 [Python Blackdog]: Considering: entry 2
03:24:51.374 [Python Blackdog]: Considering: entry 3
03:24:51.376 [Python Blackdog]: Entering falsebranch
03:24:51.376 [Python Blackdog]: Considering branch with 3 entries
03:24:51.377 [Python Blackdog]: Considering: Jump outbound
03:24:51.381 [Python Blackdog]: Considering: entry 1
03:24:51.382 [Python Blackdog]: Considering: entry 2
03:24:51.382 [Python Blackdog]: Considering: entry 4
03:24:51.382 [Python Blackdog]: Considering: entry 5
03:24:51.382 [Python Blackdog]: Conditions met
03:24:51.383 [Python Blackdog]: Executing behaviour
03:24:51.383 [Python Blackdog]: function () {
"use strict";
var station = this.getParameter("oolite_dockingStation");
this.ship.target = station;
var handlers = {};
this.responsesAddStandard(handlers);
this.responsesAddDocking(handlers);
this.ship.requestDockingInstructions();
if (!this.ship.dockingInstructions) {
this.ship.performIdle();
this.reconsiderNow();
return;
}
switch (this.ship.dockingInstructions.ai_message) {
case "TOO_BIG_TO_DOCK":
case "DOCKING_REFUSED":
this.setParameter("oolite_dockingStation", null);
this.ship.target = null;
this.reconsiderNow();
break;
case "HOLD_POSITION":
this.communicate("oolite_dockingWait", {}, 4);
this.ship.destination = station.position;
this.ship.performFaceDestination();
break;
case "APPROACH_COORDINATES":
if (this.ship.escortGroup && this.ship.escortGroup.count > 1) {
if (this.ship.dockingInstructions.docking_stage >= 2) {
this.communicate("oolite_dockEscorts", {}, 3);
this.ship.dockEscorts();
}
}
case "APPROACH":
case "BACK_OFF":
case "TRY_AGAIN_LATER":
this.ship.performFlyToRangeFromDestination();
break;
default:;
}
this.applyHandlers(handlers);
}
03:25:21.786 [Python Blackdog]: Considering branch with 10 entries
03:25:21.786 [Python Blackdog]: Considering: entry 0
03:25:21.786 [Python Blackdog]: Considering: entry 1
03:25:21.787 [Python Blackdog]: Considering: entry 2
03:25:21.787 [Python Blackdog]: Considering: entry 3
03:25:21.787 [Python Blackdog]: Entering falsebranch
03:25:21.787 [Python Blackdog]: Considering branch with 3 entries
03:25:21.787 [Python Blackdog]: Considering: Jump outbound
03:25:21.794 [Python Blackdog]: Considering: entry 1
03:25:21.794 [Python Blackdog]: Considering: entry 2
03:25:21.795 [Python Blackdog]: Considering: entry 4
03:25:21.796 [Python Blackdog]: Considering: entry 5
03:25:21.796 [Python Blackdog]: Conditions met
03:25:21.796 [Python Blackdog]: Executing behaviour
03:25:21.797 [Python Blackdog]: function () {
"use strict";
var station = this.getParameter("oolite_dockingStation");
this.ship.target = station;
var handlers = {};
this.responsesAddStandard(handlers);
this.responsesAddDocking(handlers);
this.ship.requestDockingInstructions();
if (!this.ship.dockingInstructions) {
this.ship.performIdle();
this.reconsiderNow();
return;
}
switch (this.ship.dockingInstructions.ai_message) {
case "TOO_BIG_TO_DOCK":
case "DOCKING_REFUSED":
this.setParameter("oolite_dockingStation", null);
this.ship.target = null;
this.reconsiderNow();
break;
case "HOLD_POSITION":
this.communicate("oolite_dockingWait", {}, 4);
this.ship.destination = station.position;
this.ship.performFaceDestination();
break;
case "APPROACH_COORDINATES":
if (this.ship.escortGroup && this.ship.escortGroup.count > 1) {
if (this.ship.dockingInstructions.docking_stage >= 2) {
this.communicate("oolite_dockEscorts", {}, 3);
this.ship.dockEscorts();
}
}
case "APPROACH":
case "BACK_OFF":
case "TRY_AGAIN_LATER":
this.ship.performFlyToRangeFromDestination();
break;
default:;
}
this.applyHandlers(handlers);
}
03:25:51.794 [Python Blackdog]: Considering branch with 10 entries
03:25:51.795 [Python Blackdog]: Considering: entry 0
03:25:51.795 [Python Blackdog]: Considering: entry 1
03:25:51.795 [Python Blackdog]: Considering: entry 2
03:25:51.795 [Python Blackdog]: Considering: entry 3
03:25:51.796 [Python Blackdog]: Entering falsebranch
03:25:51.796 [Python Blackdog]: Considering branch with 3 entries
03:25:51.796 [Python Blackdog]: Considering: Jump outbound
03:25:51.804 [Python Blackdog]: Considering: entry 1
03:25:51.804 [Python Blackdog]: Considering: entry 2
03:25:51.804 [Python Blackdog]: Considering: entry 4
03:25:51.804 [Python Blackdog]: Considering: entry 5
03:25:51.805 [Python Blackdog]: Conditions met
03:25:51.805 [Python Blackdog]: Executing behaviour
03:25:51.805 [Python Blackdog]: function () {
"use strict";
var station = this.getParameter("oolite_dockingStation");
this.ship.target = station;
var handlers = {};
this.responsesAddStandard(handlers);
this.responsesAddDocking(handlers);
this.ship.requestDockingInstructions();
if (!this.ship.dockingInstructions) {
this.ship.performIdle();
this.reconsiderNow();
return;
}
switch (this.ship.dockingInstructions.ai_message) {
case "TOO_BIG_TO_DOCK":
case "DOCKING_REFUSED":
this.setParameter("oolite_dockingStation", null);
this.ship.target = null;
this.reconsiderNow();
break;
case "HOLD_POSITION":
this.communicate("oolite_dockingWait", {}, 4);
this.ship.destination = station.position;
this.ship.performFaceDestination();
break;
case "APPROACH_COORDINATES":
if (this.ship.escortGroup && this.ship.escortGroup.count > 1) {
if (this.ship.dockingInstructions.docking_stage >= 2) {
this.communicate("oolite_dockEscorts", {}, 3);
this.ship.dockEscorts();
}
}
case "APPROACH":
case "BACK_OFF":
case "TRY_AGAIN_LATER":
this.ship.performFlyToRangeFromDestination();
break;
default:;
}
this.applyHandlers(handlers);
}
03:26:21.807 [Python Blackdog]: Considering branch with 10 entries
03:26:21.808 [Python Blackdog]: Considering: entry 0
03:26:21.809 [Python Blackdog]: Considering: entry 1
03:26:21.809 [Python Blackdog]: Considering: entry 2
03:26:21.809 [Python Blackdog]: Considering: entry 3
03:26:21.810 [Python Blackdog]: Entering falsebranch
03:26:21.810 [Python Blackdog]: Considering branch with 3 entries
03:26:21.810 [Python Blackdog]: Considering: Jump outbound
03:26:21.817 [Python Blackdog]: Considering: entry 1
03:26:21.817 [Python Blackdog]: Considering: entry 2
03:26:21.817 [Python Blackdog]: Considering: entry 4
03:26:21.818 [Python Blackdog]: Considering: entry 5
03:26:21.818 [Python Blackdog]: Conditions met
03:26:21.818 [Python Blackdog]: Executing behaviour
03:26:21.818 [Python Blackdog]: function () {
"use strict";
var station = this.getParameter("oolite_dockingStation");
this.ship.target = station;
var handlers = {};
this.responsesAddStandard(handlers);
this.responsesAddDocking(handlers);
this.ship.requestDockingInstructions();
if (!this.ship.dockingInstructions) {
this.ship.performIdle();
this.reconsiderNow();
return;
}
switch (this.ship.dockingInstructions.ai_message) {
case "TOO_BIG_TO_DOCK":
case "DOCKING_REFUSED":
this.setParameter("oolite_dockingStation", null);
this.ship.target = null;
this.reconsiderNow();
break;
case "HOLD_POSITION":
this.communicate("oolite_dockingWait", {}, 4);
this.ship.destination = station.position;
this.ship.performFaceDestination();
break;
case "APPROACH_COORDINATES":
if (this.ship.escortGroup && this.ship.escortGroup.count > 1) {
if (this.ship.dockingInstructions.docking_stage >= 2) {
this.communicate("oolite_dockEscorts", {}, 3);
this.ship.dockEscorts();
}
}
case "APPROACH":
case "BACK_OFF":
case "TRY_AGAIN_LATER":
this.ship.performFlyToRangeFromDestination();
break;
default:;
}
this.applyHandlers(handlers);
}
03:26:28.694 [setup.ship.badEntry.subentities]: Failed to set up entity griff_normalmapped_boa_eng
03:26:51.815 [Python Blackdog]: Considering branch with 10 entries
03:26:51.815 [Python Blackdog]: Considering: entry 0
03:26:51.816 [Python Blackdog]: Considering: entry 1
03:26:51.816 [Python Blackdog]: Considering: entry 2
03:26:51.816 [Python Blackdog]: Considering: entry 3
03:26:51.816 [Python Blackdog]: Entering falsebranch
03:26:51.817 [Python Blackdog]: Considering branch with 3 entries
03:26:51.817 [Python Blackdog]: Considering: Jump outbound
03:26:51.824 [Python Blackdog]: Considering: entry 1
03:26:51.825 [Python Blackdog]: Considering: entry 2
03:26:51.825 [Python Blackdog]: Considering: entry 4
03:26:51.825 [Python Blackdog]: Considering: entry 5
03:26:51.825 [Python Blackdog]: Conditions met
03:26:51.826 [Python Blackdog]: Executing behaviour
03:26:51.827 [Python Blackdog]: function () {
"use strict";
var station = this.getParameter("oolite_dockingStation");
this.ship.target = station;
var handlers = {};
this.responsesAddStandard(handlers);
this.responsesAddDocking(handlers);
this.ship.requestDockingInstructions();
if (!this.ship.dockingInstructions) {
this.ship.performIdle();
this.reconsiderNow();
return;
}
switch (this.ship.dockingInstructions.ai_message) {
case "TOO_BIG_TO_DOCK":
case "DOCKING_REFUSED":
this.setParameter("oolite_dockingStation", null);
this.ship.target = null;
this.reconsiderNow();
break;
case "HOLD_POSITION":
this.communicate("oolite_dockingWait", {}, 4);
this.ship.destination = station.position;
this.ship.performFaceDestination();
break;
case "APPROACH_COORDINATES":
if (this.ship.escortGroup && this.ship.escortGroup.count > 1) {
if (this.ship.dockingInstructions.docking_stage >= 2) {
this.communicate("oolite_dockEscorts", {}, 3);
this.ship.dockEscorts();
}
}
case "APPROACH":
case "BACK_OFF":
case "TRY_AGAIN_LATER":
this.ship.performFlyToRangeFromDestination();
break;
default:;
}
this.applyHandlers(handlers);
}
03:28:46.828 [Python Blackdog]: Considering branch with 10 entries
03:28:46.828 [Python Blackdog]: Considering: entry 0
03:28:46.828 [Python Blackdog]: Considering: entry 1
03:28:46.829 [Python Blackdog]: Considering: entry 2
03:28:46.829 [Python Blackdog]: Considering: entry 3
03:28:46.829 [Python Blackdog]: Entering falsebranch
03:28:46.829 [Python Blackdog]: Considering branch with 3 entries
03:28:46.829 [Python Blackdog]: Considering: Jump outbound
03:28:46.834 [Python Blackdog]: Considering: entry 1
03:28:46.834 [Python Blackdog]: Considering: entry 2
03:28:46.835 [Python Blackdog]: Considering: entry 4
03:28:46.835 [Python Blackdog]: Considering: entry 5
03:28:46.835 [Python Blackdog]: Conditions met
03:28:46.835 [Python Blackdog]: Executing behaviour
03:28:46.836 [Python Blackdog]: function () {
"use strict";
var station = this.getParameter("oolite_dockingStation");
this.ship.target = station;
var handlers = {};
this.responsesAddStandard(handlers);
this.responsesAddDocking(handlers);
this.ship.requestDockingInstructions();
if (!this.ship.dockingInstructions) {
this.ship.performIdle();
this.reconsiderNow();
return;
}
switch (this.ship.dockingInstructions.ai_message) {
case "TOO_BIG_TO_DOCK":
case "DOCKING_REFUSED":
this.setParameter("oolite_dockingStation", null);
this.ship.target = null;
this.reconsiderNow();
break;
case "HOLD_POSITION":
this.communicate("oolite_dockingWait", {}, 4);
this.ship.destination = station.position;
this.ship.performFaceDestination();
break;
case "APPROACH_COORDINATES":
if (this.ship.escortGroup && this.ship.escortGroup.count > 1) {
if (this.ship.dockingInstructions.docking_stage >= 2) {
this.communicate("oolite_dockEscorts", {}, 3);
this.ship.dockEscorts();
}
}
case "APPROACH":
case "BACK_OFF":
case "TRY_AGAIN_LATER":
this.ship.performFlyToRangeFromDestination();
break;
default:;
}
this.applyHandlers(handlers);
}
03:29:16.858 [Python Blackdog]: Considering branch with 10 entries
03:29:16.859 [Python Blackdog]: Considering: entry 0
03:29:16.859 [Python Blackdog]: Considering: entry 1
03:29:16.859 [Python Blackdog]: Considering: entry 2
03:29:16.860 [Python Blackdog]: Considering: entry 3
03:29:16.860 [Python Blackdog]: Entering falsebranch
03:29:16.860 [Python Blackdog]: Considering branch with 3 entries
03:29:16.860 [Python Blackdog]: Considering: Jump outbound
03:29:16.868 [Python Blackdog]: Considering: entry 1
03:29:16.868 [Python Blackdog]: Considering: entry 2
03:29:16.868 [Python Blackdog]: Considering: entry 4
03:29:16.868 [Python Blackdog]: Considering: entry 5
03:29:16.869 [Python Blackdog]: Conditions met
03:29:16.869 [Python Blackdog]: Executing behaviour
03:29:16.869 [Python Blackdog]: function () {
"use strict";
var station = this.getParameter("oolite_dockingStation");
this.ship.target = station;
var handlers = {};
this.responsesAddStandard(handlers);
this.responsesAddDocking(handlers);
this.ship.requestDockingInstructions();
if (!this.ship.dockingInstructions) {
this.ship.performIdle();
this.reconsiderNow();
return;
}
switch (this.ship.dockingInstructions.ai_message) {
case "TOO_BIG_TO_DOCK":
case "DOCKING_REFUSED":
this.setParameter("oolite_dockingStation", null);
this.ship.target = null;
this.reconsiderNow();
break;
case "HOLD_POSITION":
this.communicate("oolite_dockingWait", {}, 4);
this.ship.destination = station.position;
this.ship.performFaceDestination();
break;
case "APPROACH_COORDINATES":
if (this.ship.escortGroup && this.ship.escortGroup.count > 1) {
if (this.ship.dockingInstructions.docking_stage >= 2) {
this.communicate("oolite_dockEscorts", {}, 3);
this.ship.dockEscorts();
}
}
case "APPROACH":
case "BACK_OFF":
case "TRY_AGAIN_LATER":
this.ship.performFlyToRangeFromDestination();
break;
default:;
}
this.applyHandlers(handlers);
}
I've spaced out the separate logging events slightly to make for easier reading. As can be seen, there was a significant pause of 30 seconds between each logging event, during which time the ship was stationary. Immediately the ship began moving, a set of new log entries was written. After the final entry, backed-up ships began launching from the station in quick succession.. I'm guessing the pending launch queue was the reason the Blackdog Python was unable to get back into the station.