better docking AI from Eric Walch

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@2097 127b21dd-08f5-0310-b4b7-95ae10353056
This commit is contained in:
cmdrjames 2009-03-18 00:42:56 +00:00
parent 47213c7a5e
commit 8ac6b1dd3c

View File

@ -1,69 +1,78 @@
{
GLOBAL =
{
ENTER = ("setSpeedTo: 0.0", requestDockingCoordinates, "setStateTo: AWAIT_COORDS");
UPDATE = ("pauseAI: 2");
};
"AWAIT_COORDS" =
{
"APPROACH" = ("setStateTo: APPROACH");
"APPROACH_COORDINATES" = ("setStateTo: GO_TO_COORDS");
"BACK_OFF" = ("setStateTo: RETREAT");
"HOLD_POSITION" = ("setStateTo: STATIONKEEPING");
"DOCKING_ABORTED" = ("setStateTo: ABORT");
"TRY_AGAIN_LATER" = ("pauseAI: 30.0", "setStateTo: ABORT");
"COLLISION" = ("setStateTo: ABORT");
"RESTART_DOCKING" = ("setStateTo: GLOBAL");
DOCKED = ("setStateTo: EXIT_SYSTEM");
UPDATE = ("pauseAI: 2");
};
STATIONKEEPING =
{
ENTER = (performIdle, "setSpeedTo: 0.0", "pauseAI: 10.0");
ATTACKED = (abortDocking, broadcastDistressMessage, setTargetToPrimaryAggressor, "setAITo: interceptAI.plist");
RESTARTED = (performIdle, "setStateTo: GLOBAL");
UPDATE = (requestDockingCoordinates, "setStateTo: AWAIT_COORDS");
};
APPROACH =
{
ENTER = (recallDockingInstructions, "setSpeedFactorTo: 1.0", performFlyToRangeFromDestination);
"DESIRED_RANGE_ACHIEVED" = (requestDockingCoordinates, "setStateTo: AWAIT_COORDS");
"DOCKING_ABORTED" = ("setStateTo: ABORT");
"COLLISION" = ("setStateTo: ABORT");
"RESTART_DOCKING" = ("setStateTo: GLOBAL");
};
RETREAT =
{
ENTER = (recallDockingInstructions, "setSpeedTo: 0.0", setDestinationToDockingAbort, performFaceDestination);
"FACING_DESTINATION" = ("setSpeedFactorTo: 1.0", "setDesiredRangeTo: 500.0", performFlyToRangeFromDestination);
"DESIRED_RANGE_ACHIEVED" = ("setSpeedTo: 0.0", requestDockingCoordinates, "setStateTo: AWAIT_COORDS");
"DOCKING_ABORTED" = ("setStateTo: ABORT");
"COLLISION" = ("setStateTo: ABORT");
"RESTART_DOCKING" = ("setStateTo: GLOBAL");
};
"GO_TO_COORDS" =
{
ENTER = (performFaceDestination);
FRUSTRATED = ("setSpeedTo: 0.0", performFaceDestination);
"FACING_DESTINATION" = (recallDockingInstructions, performFlyToRangeFromDestination);
"DESIRED_RANGE_ACHIEVED" = (requestDockingCoordinates, "setStateTo: AWAIT_COORDS");
"DOCKING_ABORTED" = ("setStateTo: ABORT");
"COLLISION" = ("setStateTo: ABORT");
"RESTART_DOCKING" = ("setStateTo: GLOBAL");
DOCKED = ("setStateTo: EXIT_SYSTEM");
};
ABORT =
{
ENTER = (abortDocking, "setSpeedTo: 0.0", setDestinationToDockingAbort, "setDesiredRangeTo: 500.0", performFaceDestination);
"FACING_DESTINATION" = ("setSpeedFactorTo: 1.0", "setDesiredRangeTo: 500.0", performFlyToRangeFromDestination);
"RESTART_DOCKING" = ("setStateTo: GLOBAL");
"REACHED_SAFETY" = (performIdle, "setStateTo: GLOBAL");
"DESIRED_RANGE_ACHIEVED" = (performIdle, "setStateTo: GLOBAL");
ATTACKED = (setTargetToPrimaryAggressor, "setAITo: interceptAI.plist");
RESTARTED = (performIdle, "setStateTo: GLOBAL");
};
"EXIT_SYSTEM" =
{
ENTER = (exitAI);
};
}
GLOBAL =
{
ENTER = ("setSpeedTo: 0.0", requestDockingCoordinates, "setStateTo: AWAIT_COORDS");
UPDATE = ("pauseAI: 2");
};
"AWAIT_COORDS" =
{
"APPROACH" = ("setStateTo: APPROACH");
"APPROACH_COORDINATES" = ("setStateTo: GO_TO_COORDS");
"BACK_OFF" = ("setStateTo: RETREAT");
"HOLD_POSITION" = ("setStateTo: STATIONKEEPING");
"DOCKING_ABORTED" = ("setStateTo: ABORT");
"TRY_AGAIN_LATER" = ("pauseAI: 30.0", "setStateTo: ABORT");
"COLLISION" = ("setStateTo: ABORT");
"RESTART_DOCKING" = ("setStateTo: GLOBAL");
DOCKED = ("setStateTo: EXIT_SYSTEM");
UPDATE = ("pauseAI: 2");
};
STATIONKEEPING =
{
ENTER = (performIdle, "setSpeedTo: 0.0", "pauseAI: 10.0");
ATTACKED = ("setStateTo: ATTACK_SHIP");
"GROUP_ATTACK_TARGET" = ("setStateTo: ATTACK_SHIP");
UPDATE = (requestDockingCoordinates, "setStateTo: AWAIT_COORDS");
};
APPROACH =
{
ENTER = (recallDockingInstructions, "setSpeedFactorTo: 1.0", performFlyToRangeFromDestination);
"DESIRED_RANGE_ACHIEVED" = (requestDockingCoordinates, "setStateTo: AWAIT_COORDS");
"DOCKING_ABORTED" = ("setStateTo: ABORT");
"COLLISION" = ("setStateTo: ABORT");
"RESTART_DOCKING" = ("setStateTo: GLOBAL");
};
RETREAT =
{
ENTER = (recallDockingInstructions, "setSpeedTo: 0.0", setDestinationToDockingAbort, performFaceDestination);
"FACING_DESTINATION" = ("setSpeedFactorTo: 1.0", "setDesiredRangeTo: 500.0", performFlyToRangeFromDestination);
"DESIRED_RANGE_ACHIEVED" = ("setSpeedTo: 0.0", requestDockingCoordinates, "setStateTo: AWAIT_COORDS");
ATTACKED = ("setStateTo: ATTACK_SHIP");
"GROUP_ATTACK_TARGET" = ("setStateTo: ATTACK_SHIP");
"DOCKING_ABORTED" = ("setStateTo: ABORT");
"COLLISION" = ("setStateTo: ABORT");
"RESTART_DOCKING" = ("setStateTo: GLOBAL");
};
"GO_TO_COORDS" =
{
ENTER = (performFaceDestination);
FRUSTRATED = ("setSpeedTo: 0.0", performFaceDestination);
"FACING_DESTINATION" = (recallDockingInstructions, performFlyToRangeFromDestination);
ATTACKED = ("setStateTo: ATTACK_SHIP");
"GROUP_ATTACK_TARGET" = ("setStateTo: ATTACK_SHIP");
"DESIRED_RANGE_ACHIEVED" = (requestDockingCoordinates, "setStateTo: AWAIT_COORDS");
"DOCKING_ABORTED" = ("setStateTo: ABORT");
"COLLISION" = ("setStateTo: ABORT");
"RESTART_DOCKING" = ("setStateTo: GLOBAL");
DOCKED = ("setStateTo: EXIT_SYSTEM");
};
ABORT =
{
ENTER = (abortDocking, "setSpeedTo: 0.0", setDestinationToDockingAbort, "setDesiredRangeTo: 500.0", performFaceDestination);
"FACING_DESTINATION" = ("setSpeedFactorTo: 1.0", "setDesiredRangeTo: 500.0", performFlyToRangeFromDestination);
"RESTART_DOCKING" = ("setStateTo: GLOBAL");
"REACHED_SAFETY" = (performIdle, "setStateTo: GLOBAL");
"DESIRED_RANGE_ACHIEVED" = (performIdle, "setStateTo: GLOBAL");
ATTACKED = ("setStateTo: ATTACK_SHIP");
"GROUP_ATTACK_TARGET" = ("setStateTo: ATTACK_SHIP");
};
"ATTACK_SHIP" =
{
ENTER = (abortDocking, setTargetToFoundTarget, "setAITo: interceptAI.plist");
RESTARTED = (performIdle, "setStateTo: GLOBAL");
};
"EXIT_SYSTEM" =
{
ENTER = (performDocking, exitAI);
};
}