I want to comment on that because I studied this shuttle behaviour half a year ago intensively. This bouncing behaviour already happened with 1.65. The reason is that in the approach to the surface the shuttle does a check for a free flight path with "checkCourseToDestination". This check is necessary to avoid collisions with other vehicles in the first part of the decent.Other than that, The adder never landed, it just bounched up from the surface, was heading for the station for a few seconds, then went down towards the planet again..
(To see this function in action fly towards a trader, estimate its flight-path and fly fast into this path and make a full stop. Now watch the trader. Every 10 seconds the trader does a check for a free path and when he detects you, he will deviate from his course and after some time resume his original course.)
The shuttles have two triggers that make him jump to the next state.
1) DESIRED_RANGE_ACHIEVED. This one is set et 50 meters from the surface.
2) APPROACHING_SURFACE. This one was set at 1 meter above the surface and in 1.71 raised to a higher value.
Problem with the shuttles is that they jump into a gotoWaypointAI before the messages arrive. When you leave out the free-path check, shuttles crashed in 50% of the cases, in the other 50% they "reached destination". This crashing problem is solved in 1.71 but last week I also noticed that the shuttles still "bump". Cause is still the free flight-path check. In a lot of cases it reacts on the surface and sends the AI in a gotoWaypointAI before the other triggers are reached. The AI only occasionally receives the "APPROACHING_SURFACE" message. (gotoWaypointAI is not scanning for this message).
Some time ago, I have been changing the AI on my computer and added a "AEGIS_LEAVING_DOCKING_RANGE" message. With this message I let the ship jump to the next state. I suggested this changed AI before, (see end of this message) but hoped the raised level for the "APPROACHING_SURFACE" would be enough. But it isn't.
Currently I am working on a new OXP, together with Svengali. This oxp also has a station around the planet and shuttle traffic to and from the surface. For this oxp I reinvestigated the shuttles under 1.71. But because it is not the main station, I could not use the "AEGIS_LEAVING_DOCKING_RANGE" message. I now use a JS message that actually calculates the real distance to the surface. By logging the distances I noticed that the AI jumps to a gotoWaypointAI between 1000 and 2000 meters from the surface. For this oxp I now use a distance of 2000 meters to the surface to change AI states. (distance = system.mainPlanet.position.distanceTo(this.ship) - system.mainPlanet.radius, whow I am appreciating the JS more and more)
Code: Select all
{
GLOBAL = {ENTER = ("setSpeedFactorTo: 0.25", "setStateTo: FLY_HOME"); EXIT = (); UPDATE = (); };
"FLY_HOME" = {
ENTER = (setCourseToPlanet, checkCourseToDestination);
"COURSE_OK" = ("setSpeedFactorTo: 1.0", performFlyToRangeFromDestination);
"WAYPOINT_SET" = ("setAITo: gotoWaypointAI.plist");
"APPROACHING_SURFACE" = ("setStateTo: LANDING");
"DESIRED_RANGE_ACHIEVED" = ("setStateTo: LANDING");
"AEGIS_LEAVING_DOCKING_RANGE" = ("setStateTo: APPROACH");
ATTACKED = (setTargetToPrimaryAggressor, broadcastDistressMessage);
"INCOMING_MISSILE" = (fireECM);
UPDATE = (setCourseToPlanet, checkCourseToDestination, "pauseAI: 10.0");
EXIT = ();
};
"APPROACH" = {
ENTER = (setCourseToPlanet, "setSpeedFactorTo: 0.7", performFlyToRangeFromDestination);
"APPROACHING_SURFACE" = ("setStateTo: LANDING");
"DESIRED_RANGE_ACHIEVED" = ("setStateTo: LANDING");
ATTACKED = (setTargetToPrimaryAggressor, broadcastDistressMessage);
"INCOMING_MISSILE" = (fireECM, "setSpeedFactorTo: 1.0");
UPDATE = ();
EXIT = ();
};
"LANDING" = {
ENTER = ("setSpeedFactorTo: 0.0", setTargetToSystemStation, setDestinationToTarget, performFaceDestination);
"FACING_DESTINATION" = (landOnPlanet);
UPDATE = ();
EXIT = ();
};
}