Split: Pirates prefer player

General discussion for players of Oolite.

Moderators: winston, another_commander

User avatar
Micha
Commodore
Commodore
Posts: 815
Joined: Tue Sep 02, 2008 2:01 pm
Location: London, UK
Contact:

Post 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!
The glass is twice as big as it needs to be.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6682
Joined: Wed Feb 28, 2007 7:54 am

Post 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.
User avatar
Micha
Commodore
Commodore
Posts: 815
Joined: Tue Sep 02, 2008 2:01 pm
Location: London, UK
Contact:

Post 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?)
The glass is twice as big as it needs to be.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6682
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

Thread unhijacked. Pirates' preference for player split to Discussion.
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 »

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
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
SiriusCG
Dangerous
Dangerous
Posts: 73
Joined: Sat Mar 27, 2010 12:59 am

Post by SiriusCG »

Could "PIRATES_PREFER_PLAYER" be randomized?
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6682
Joined: Wed Feb 28, 2007 7:54 am

Post 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.
User avatar
Micha
Commodore
Commodore
Posts: 815
Joined: Tue Sep 02, 2008 2:01 pm
Location: London, UK
Contact:

Post 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. :)
The glass is twice as big as it needs to be.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6682
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

Good thing that someone checks out the fine details before we go ahead and implement a do-nothing setting :P
User avatar
Micha
Commodore
Commodore
Posts: 815
Joined: Tue Sep 02, 2008 2:01 pm
Location: London, UK
Contact:

Post 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*
The glass is twice as big as it needs to be.
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 »

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.
Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2411
Joined: Mon May 31, 2010 11:11 pm

Post 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.
Baza
Competent
Competent
Posts: 42
Joined: Wed Dec 05, 2007 7:52 pm

Post 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.
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Post 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.
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 »

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
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
Post Reply