Page 2 of 3

Posted: Tue Aug 10, 2010 11:11 pm
by caracal
Smivs wrote:
Caracal, you may not realise it but the above post was the 100,000th on the BB. Congrats on helping us pass this milestone.
Wowzah! I've been accused of logorrhea before, but ... ten myriads? One lakh? I'm a madman, I tellya, a maaaadmaaaaan!! :shock:

Oh, you didn't mean single-handedly. Well never mind, then. ;)

(I saw your thread on Outworld and knew we were coming up on 100k, but didn't realize my post would roll the counter. I'm honored to have been the one, though, and am happy this is an active forum and not some slough of despond like a lot of apps have.)

Posted: Wed Aug 11, 2010 7:01 am
by Switeck
Eric Walch wrote:

Code: Select all

		ENTER = (getWitchspaceEntryCoordinates, setDestinationFromCoordinates, "setDesiredRangeTo: 100.0",
			"setSpeedFactorTo: 0.75", performFlyToRangeFromDestination, "pauseAI: 5");
Clear Station, Enter seems to be setting a new destination move point. I question the 100 distance though -- even the witchspace buoy might get hit if the Viper/s are injecting as they near it. And the station definitely would be.

Posted: Wed Aug 11, 2010 7:11 am
by Kaks
Setting setSpeedFactorTo: 0.75 is specifically telling them not to inject.

Posted: Wed Aug 11, 2010 7:21 am
by Eric Walch
caracal wrote:
And it's always a trader hitting the buoy after launching from a constore too, though I haven't taken the time to look at its code to see why.
This is strange, because exiting traders have explicit code to make a 90 degree turn shortly after launch. And in my system that does happens with the constores (and main stations were the same AI is used)

Posted: Wed Aug 11, 2010 7:35 am
by caracal
Eric Walch wrote:
caracal wrote:
And it's always a trader hitting the buoy after launching from a constore too, though I haven't taken the time to look at its code to see why.
This is strange, because exiting traders have explicit code to make a 90 degree turn shortly after launch. And in my system that does happens with the constores (and main stations were the same AI is used)
I see that with normal traders exiting the main station. Not with the code I posted, though. I don't hang around constores that much, so I'm not sure if any traders do it there too.

Are you saying that the procedure I posted does not result in a buoy crash? If not, how can we explain that? Something Linux-specific, perhaps?

Posted: Wed Aug 11, 2010 7:52 am
by Eric Walch
caracal wrote:
Eric Walch wrote:
One thing is missing:

Code: Select all

newShip.target=PS;
Because the ship is expecting to have a target.
Yes, I think all the "interceptor" AIs (intercept, policeIntercept, and traderIntercept) expect to have a target set, since they all start out by doing a performAttack. The example code I posted was intended to reproduce the buoy crash, not to present an example of good AI code.
Yes but giving it a code that is predestinated to lead to a buoy crash is hardly telling anything about normal launches. :lol:

When you let them launch with an interceptAI without target, it will hit the following line:

Code: Select all

"TARGET_LOST" = (performIdle, switchLightsOff, exitAI);
And performIdle just makes a ship maintaining speed an stop with all course corrections. And that way you just have programmed a launching ship to ram the buoy.

Posted: Wed Aug 11, 2010 10:01 am
by Commander McLane
Smivs wrote:
Caracal, you may not realise it but the above post was the 100,000th on the BB. Congrats on helping us pass this milestone.
Hmmm. According to its direct link it was actually the 116,293th. Number 100,000 must have been a couple of weeks (or months) ago.

https://bb.oolite.space/viewtopic.php?p=116293#116293

You have to take into account that due to the original setup of some of the forums (most notably the Outworld forum) many old posts have been auto-deleted by the BB-software and are lost in the maelstrom of time.

Posted: Wed Aug 11, 2010 4:32 pm
by caracal
Commander McLane wrote:
Smivs wrote:
Caracal, you may not realise it but the above post was the 100,000th on the BB. Congrats on helping us pass this milestone.
Hmmm. According to its direct link it was actually the 116,293th. Number 100,000 must have been a couple of weeks (or months) ago.
Back in January, to be precise: The 100,000th post.

I feel so ... deflated. :cry: (Not really! ;))

Posted: Wed Aug 11, 2010 4:53 pm
by caracal
Eric Walch wrote:
Yes but giving it a code that is predestinated to lead to a buoy crash is hardly telling anything about normal launches. :lol:
Quite true. If the normal launches led to a lot of crashes, I'm sure we'd have heard about it long before now!
Eric Walch wrote:
When you let them launch with an interceptAI without target, it will hit the following line:

Code: Select all

"TARGET_LOST" = (performIdle, switchLightsOff, exitAI);
And performIdle just makes a ship maintaining speed an stop with all course corrections. And that way you just have programmed a launching ship to ram the buoy.
That makes sense. As I said earlier, you can make a ship do just about anything with the right (or in this case, wrong) AI code.

I guess the real question I've been chasing is, "Do NPC ships have anything in the way of short-range collision avoidance?" And the answer seems to be "no", or at least "not always". And if I'm not going to write the code for it myself, I have no right to ask you guys to do it. As you rightly point out, it's not normally an issue anyway. That pretty much settles the question for me.

Posted: Wed Aug 11, 2010 6:49 pm
by Eric Walch
caracal wrote:
I guess the real question I've been chasing is, "Do NPC ships have anything in the way of short-range collision avoidance?" And the answer seems to be "no", or at least "not always".
Actually they do! When the other entity comes within a certain percentage of the collision radius, all ships enter a collision avoidance behaviour. (old behaviour is put on ice, collision avoidance is executed and when ready the old behaviour is presumed.
However, this avoidance does not work in time when flying at high speed as in attacks.

Posted: Wed Aug 11, 2010 7:26 pm
by caracal
Eric Walch wrote:
caracal wrote:
I guess the real question I've been chasing is, "Do NPC ships have anything in the way of short-range collision avoidance?" And the answer seems to be "no", or at least "not always".
Actually they do! When the other entity comes within a certain percentage of the collision radius, all ships enter a collision avoidance behaviour. (old behaviour is put on ice, collision avoidance is executed and when ready the old behaviour is presumed.
However, this avoidance does not work in time when flying at high speed as in attacks.
So why doesn't it work when flying at relatively low speed into a buoy? I sat and watched a Python bounce off the buoy six or eight times before a cop finally came by and shot him up. I got the impression he'd have done it all day if not interrupted. Looked like a hippo trying to mate with a weather balloon. :lol:

And none of the other smaller traders who splashed against the buoy in my tests were going at top speed either. At least not so fast they couldn't have turned away. What am I missing?

Posted: Wed Aug 11, 2010 9:04 pm
by Switeck
I'd like to add a couple updated ai routines to my mod, if this doesn't get added directly to Oolite core. On top of this, is there any other quick-ai-fixes you can recommend?

Posted: Wed Aug 11, 2010 9:20 pm
by Eric Walch
caracal wrote:
Eric Walch wrote:
.....However, this avoidance does not work in time when flying at high speed as in attacks.
So why doesn't it work when flying at relatively low speed into a buoy? I sat and watched a Python bounce off the buoy six or eight times before a cop finally came by and shot him up. I got the impression he'd have done it all day if not interrupted. Looked like a hippo trying to mate with a weather balloon. :lol:

And none of the other smaller traders who splashed against the buoy in my tests were going at top speed either. At least not so fast they couldn't have turned away. What am I missing?
Avoidance only take place in behaviours that are allowed to change course. performIdle is excluded from that. And it makes sense, because when you send something away on a collision course you probably want the collision. Remember, performIdle is not supposed to change directions.
Avoiding the collision with the buoy probably would have worked when sending a ship at low speed in a performFly... towards the buoy.
But on the mac we have easier tools to follow such behaviour as the mac version of the debug console can set up a floating window that live monitors a ships behaviour. On other systems you can only make snapshots by constantly pressing shift-H and than looking in the log.

Posted: Thu Aug 12, 2010 12:35 am
by caracal
Eric Walch wrote:
Avoidance only take place in behaviours that are allowed to change course. performIdle is excluded from that. And it makes sense, because when you send something away on a collision course you probably want the collision. Remember, performIdle is not supposed to change directions.
Okay, that does make sense, and I thank you for enlightening me. It also opens up some intriguing OXP possibilities ... hmmm. :twisted:
Eric Walch wrote:
But on the mac we have easier tools to follow such behaviour as the mac version of the debug console can set up a floating window that live monitors a ships behaviour. On other systems you can only make snapshots by constantly pressing shift-H and than looking in the log.
Well ain't you Mac guys just sooooo special! You're just ... just ... pbbbbbbt! :P (Clearly I don't have any rational arguments to make. :oops:)

Posted: Thu Aug 12, 2010 12:59 pm
by Star Gazer
Ahh... I love it when non-Mac users are reduced to vulgar noises to express their contempt of the Mac OS!! :lol:

But seriously, it would be really nice if a solution could be found to this long-standing quirky behaviour. (the ships collision with inanimate objects, not PC vs.Mac flame wars!!) Maybe a check should be made of the immediate path ahead before accelerating to attack speed?