Falling Shuttle

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

Falling Shuttle

Post by Eric Walch »

Frame wrote in an other topic:
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..
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.

(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 = ();
	}; 
}
User avatar
Frame
---- E L I T E ----
---- E L I T E ----
Posts: 1477
Joined: Fri Mar 30, 2007 8:32 am
Location: Witchspace

Post by Frame »

i just witnessed something even more stupid, 3 sidewinders and 1 krait giving escort to an Adder, all the way down to the surface where all 4 escorts succesfully committed suicide...

Seems theire "mother" Warped out, then they looked for new business instead of following theire mother...

But theire mother did jump out rather fast though, like just before the nav buoy..


EDIT.

This is with no OXPs installed.. 1.7.1.2

i just came into station view to see what happens exactly..

An anaconda Launches from the station and flies in a straight line, a few seconds after, its first escort launches, a sidewinder, and crashes into the rear of the anaconda, leaving behind a metal alloy.. t

The anaconda survived, but im not sure what would happen if the escort vessel was say a mamba.. which is what i suspect is happend, when the before mentioned escorts escorted an Adder..

The anaconda jumped out, just before the bouy, and the next escorts flew right into the wormhole...

After That station launched Scavangers, when it detected the presence of loot 2 adders and 1 Cobra MKIII..

Now to my speculation, When the Wormhole closes to fast, or Scavengers take presedence in launching, or the mother dies, the Escorts starts to look for business... now why they choose to escort an Adder, is something you would have to look in the code to figure out..

I cant figure why they would escort an Adder, since i was under the impression that only regulary Traders would be possible escort-mothers. all that said, the adder going to the surface didnt behave like a shuttle as it took a zig zag route down to the surface, and never landed.

here is the entry for the Adder roles

roles = "hunter scavenger shuttle hermit-ship oolite-adder";

No trader roles...

Something is very ODD atm with AI

Since police do not protect the player

ASP pirate, do not attack you just wiggles around(i suspect thats because it got no cargohold and fuel scoop), therefore the AI gets confused when loot is around..

even then, when no loot is around, the ASP rarely attack you...

Sidewinder being offender while flying escort(not Ai i know)... ofcourse it could have hit a policeship, and lived to tell the tale.. i wouldnt know


EDIT 2:

sure enough, i just witnessed the whole thing again

Seems like when the Anaconda is launched, and the right after its first escort, My system takes a performance hit, like as if alot of collision checking is going on... drops from 100 fps to 12....

after the sidewinder dies, and bumps the anaconda out the way, the remaining escorts is launched, but they didnt go into the wormhole the anaconda created because it jumped out now.

like they used too, instead one of them headed for the sun (route2trader),
the mamba took up escort beside an adder(but didnt care about protecting it, while the station launched police to protect it from me,

Now there where like 1 cobra MK III going for the sun, 1 adder heading for the surface, 2 adders sitting idle in space with an escorting mamba right beside it, also sitting still...

So i stand to that something is severely broken in the AI code...
Bounty Scanner
Number 935
Post Reply