Page 1 of 2

Posted: Sun Nov 07, 2010 9:13 pm
by Micha
Switeck wrote:
I expect some (but not all!) traders to take shots at "targets of opportunity"...though I don't yet know how hard that will be to do.
That would be very nice - sometimes when I am flying a very down-and-out ship, I lead pirates through groups of traders in the vain hope that the pirates will switch targets (yes, nasty, I know), or that the traders will attack the pirates.

Unfortunately, as much as everybody keeps harping on about the non-player-centricity, in this respect, Oolite is very player centric. I have yet to see a pirate switch targets away from the player!

Posted: Sun Nov 07, 2010 9:31 pm
by another_commander
Micha wrote:
Unfortunately, as much as everybody keeps harping on about the non-player-centricity, in this respect, Oolite is very player centric. I have yet to see a pirate switch targets away from the player!
ShipEntity.h, line 45. Change YES to NO in the PIRATES_PREFER_PLAYER define for making the player less important in the Ooniverse. I don't know if this should be changed in the future, but I trust it's been around like this for a reason.

Posted: Sun Nov 07, 2010 9:46 pm
by Micha
another_commander wrote:
ShipEntity.h, line 45. Change YES to NO in the PIRATES_PREFER_PLAYER define for making the player less important in the Ooniverse. I don't know if this should be changed in the future, but I trust it's been around like this for a reason.
Ta! Hmm... Maybe make it a config file switch?

And the reason is probably the same as making the Player Cobra 3 faster than normal Cobby 3's - to make Oolite a -little- bit Player Centric and possibly more 'fun' (for whatever value of 'fun') ;) Possibly to emphasize combat a bit more?

Anyway, sorry for hijacking thread. Back to your normal program! (We could discuss this further, if interested, in a new thread?)

Posted: Sun Nov 07, 2010 10:00 pm
by another_commander
Thread unhijacked. Pirates' preference for player split to Discussion.

Posted: Sun Nov 07, 2010 10:04 pm
by Kaks
I strongly suspect that the 'fun' bit was trying to keep the action closer to the player than it would otherwise be the case - some oxps add a lot more ships than would otherwise be in any average system, making PIRATES_PREFER_PLAYER a lot less of a necessity than in vanilla Oolite.

Making it a 'hidden' setting sounds like a pretty good idea - even better if we could make it a percentage, rather than just an on/off switch! :D

PS: very deft un-hijacking, A_C! :D

Posted: Sun Nov 07, 2010 10:15 pm
by SiriusCG
Could "PIRATES_PREFER_PLAYER" be randomized?

Posted: Sun Nov 07, 2010 10:17 pm
by another_commander
SiriusCG wrote:
Could "PIRATES_PREFER_PLAYER" be randomized?
That's essentially what Kaks proposed. We can make it a fuzzy boolean, meaning a percentage (user-defined) representing the chance of the setting being TRUE.

Posted: Sun Nov 07, 2010 10:18 pm
by Micha
Well, I just hacked the setting in, compiled, set breakpoint, started game, and.... nothing.

Turns out that 'scanForNearestMerchantman', which is the -only- place where this setting was being used, is not actually used in any standard AI (anymore?) and not called from any code.

Rather, 'scanForRandomMerchantman' is used, which, as the name implies, scans for a random pirate victim. There may yet be sections in the code which specifically check for the player which are not guarded by PIRATES_PREFER_PLAYER.

So as far as I can tell, this setting does nothing in vanilla Oolite. Possibly in some OXPs.

Oh well. :)

Posted: Sun Nov 07, 2010 10:22 pm
by another_commander
Good thing that someone checks out the fine details before we go ahead and implement a do-nothing setting :P

Posted: Sun Nov 07, 2010 10:24 pm
by Micha
Well, I kinda trusted you to know whether or not the setting actually did anything!! :-D You sounded rather authoritative when you mentioned it *g*

Posted: Sun Nov 07, 2010 10:49 pm
by Eric Walch
Micha wrote:
I have yet to see a pirate switch targets away from the player!
When you watch carefully, you'll see it happening occasionally. Pirates are added in groups. When one of the group members is hit by another ship, the pirate that was after you might decide to leave you alone for now and help his mate.

Posted: Mon Nov 08, 2010 5:50 am
by Switeck
Micha wrote:
That would be very nice - sometimes when I am flying a very down-and-out ship, I lead pirates through groups of traders in the vain hope that the pirates will switch targets (yes, nasty, I know), or that the traders will attack the pirates.
I go 1 further. I've "hid" behind an Anaconda trader so it and its 6 escort Cobra 1's would get all ugly on a pirate on my butt...and I did that just for fun rather than any need at all.

When I go up against Pirate Coves, I sometimes don't ECM missiles fired at me...and instead let the Pirate Cove take the hit, and watch the friendly fire pandemonium that sometimes/rarely causes. :twisted:

Pirates will return fire even if shot by another pirate. Once you realize which pirate the other pirates all hate...leave him alone, as he'll be an ok shot distract for a little while.

Posted: Sat Nov 13, 2010 2:39 pm
by Baza
Is it possible for this decision to be made using something like a cargo value or armament value ? So a pirate will go for the ship with the most valuable cargo if a choice is to be made or the ship which poses the least threat.

Posted: Sat Nov 13, 2010 3:03 pm
by Commander McLane
A ship script can check possible targets for whatever you want. However, from an in-game perspective, how would the pirate know which cargo his target has loaded? He will know the ship stats, and therefore be able to go after the weakest (or strongest) opponent. But the cargo? Only in obvious exceptions, like a fuel tanker or an armoured transport, I'd say.

Posted: Sat Nov 13, 2010 3:15 pm
by Kaks
Well, they could somehow have obtained one of those police scanners that can tell if you have contraband on board, or have an accomplice who was hanging around in the marketplace when we last went there, or...

Still, it's a good point. Maybe if you just increase the likelihood of attacks by 60% or so if carrying xyz, instead of making it 100% certain...


Personally, I think it'd be really good if we end up with at least 4 different types of pirateAI/js script, each with their own priority.

Hopefully one of the guys over in the Player reputations and AI thread will pick up the challenge, and deliver us such an oxp! :D