View Single Post
Old 07-18-10, 10:29 AM   #201
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by BowfinSS287 View Post
i do think it may be a stock bug,but can the new heading have 3 inputs
is this the command line ?

newheading = ship : random (0, 360);

could it be changed to :

newheading = ship : random (0, 160, 200);

this might stop the DD from picking a course directly behind it
if you can use 3 inputs....what do you think?
Random function has only two inputs: min and max and it returns a real number between those two values.

I looked over my code for the AI searches. Here's how the AI picks a new location to search in:

Ship:WaitAction(waittime);

newheading = Ship:Random(0, 360);
Ship:TurnToHeading(newheading, 1.0);
rundist = Ship:Random(HK_MIN_NEXT_SPIRAL_DISTANCE, HK_MAX_NEXT_SPIRAL_DISTANCE);

it searched a place and now waits a random time (at all stop) then it chooses a new random heading, turns to that new heading at full throttle, then chooses a new random distance from it's curent spot to go to and search again.

Now maybe when it turns to it's new heading the game allows it to go backwards I'll update the code to force it to go forwards a small distance before executing the turn to the new heading. I'll release a new version here shortly with this change.
TheDarkWraith is offline   Reply With Quote