Pirate Cove bug when using oolite trunk ?

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

User avatar
Cmdr James
Commodore
Commodore
Posts: 1357
Joined: Tue Jun 05, 2007 10:43 pm
Location: Berlin

Post by Cmdr James »

It turns out that the reason the pirate dont work is that FLY_TO_LURK_AREA isnt working properly, and the AI just gets FRUSTRATED but never makes any progress.

I have changed the following in pirate ai

Code: Select all

	"TRAVEL_TO_LURK_AREA" =
	{
		ENTER = (setDestinationToCurrentLocation, "setDesiredRangeTo: 1500.0", performFlyToRangeFromDestination);
		ATTACKED = (setTargetToPrimaryAggressor, "setStateTo: ATTACK_SHIP");
		"DESIRED_RANGE_ACHIEVED" = ("setStateTo: LURK");
		"GROUP_ATTACK_TARGET" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP");
		"INCOMING_MISSILE" = (fightOrFleeMissile, "setStateTo: FLEE");
		"ENTER WORMHOLE" = ("setStateTo: ENTER_WORMHOLE");
		"EXITED WITCHSPACE" = ("switchAITo: enteringPirateAI.plist");	// Unreachable? If so, enteringPirateAI and enteringTraderAI are unused.
		"FRUSTRATED" = ("setStateTo: LURK");
	};
this change works, i nso far as it makes pirates behave more sensibly when they are unable to reach the target lurk area, however, there is something funny going on with

Code: Select all

(setDestinationToCurrentLocation, "setDesiredRangeTo: 1500.0", performFlyToRangeFromDestination);
User avatar
Cmdr James
Commodore
Commodore
Posts: 1357
Joined: Tue Jun 05, 2007 10:43 pm
Location: Berlin

Post by Cmdr James »

And it seems setDestinationToCurrentLocation is failing, because when the pirate is launched it almost immediately reches approx 2000 distance, and so neeeds to fly closer to the pirate cove, but cannot do so.

I plan to look into it some more soon
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Post by Kaks »

Considering that the scanner range is a sphere of about 25km radius, moving 1.5km away doesn't sound too much like lurking to me... It's more likely to be a typo: moving 15km (approx. 2/3 of scanner range) would probably make a lot more sense! :)

With that in mind, I'd change the line in question to:

Code: Select all

(setDestinationToCurrentLocation, "setDesiredRangeTo: 15000.0", performFlyToRangeFromDestination);
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post by Eric Walch »

Kaks wrote:
Considering that the scanner range is a sphere of about 25km radius, moving 1.5km away doesn't sound too much like lurking to me... It's more likely to be a typo: moving 15km (approx. 2/3 of scanner range) would probably make a lot more sense! :)
No is must be 1500. It is just to spread the lurkung pirates a bit. The player still has to see them as a group when he finds them on scanner. Pirates use all kind of group messages that makes them act as a group.

---
Maybe the TRAVEL_TO_LURK_AREA state could use a line like:

Code: Select all

"LAUNCHED OKAY" = ("setStateTo: TRAVEL_TO_LURK_AREA");
This way forcing the ENTER state to run again.

Or maybe:

Code: Select all

"LAUNCHED OKAY" = ("setStateTo: CLEAR_STATION");
But I currently don't see what a special launch state has to add to the AI.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post by Eric Walch »

I uploaded my test version to the box: Pirate Cove 1.73wip version It makes use of a new feature in 1.73. On 1.72 it will behave like the old one, with 1.73 the launching pirates will switch to a new custom pirateAI. I added the above launch detection. This one should behave well on 1.73. I just can't test the new stuff myself and do a public upload when 1.73 is released and it really does what I planned.
Post Reply