Page 2 of 2

Posted: Tue Mar 17, 2009 11:18 pm
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);

Posted: Wed Mar 18, 2009 9:11 am
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

Posted: Wed Mar 18, 2009 11:50 am
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);

Posted: Wed Mar 18, 2009 12:33 pm
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.

Posted: Wed Mar 18, 2009 4:51 pm
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.