Page 1 of 2

Pirate Cove bug when using oolite trunk ?

Posted: Sat Mar 14, 2009 6:43 pm
by Cmdr James
I suspect that this may be an oolite bug, rather than pirate coves.

Each time I see a Pirate Cove, (Pirate_coves 1.1b.oxp) it launches one (Offender) defense-ship with me as its target. The launched ship sits outside the docking slot and does nothing until attacked.

The pirate cove rewards 10Cr bounty when destroyed, which is funny, I think it should be 100 from memory, and by inspecting the plist?

A couple of questions: does anyone else get this behavior?

Does anyone know of existing issues which could be to blame?

Re: Pirate Cove bug when using oolite trunk ?

Posted: Sat Mar 14, 2009 7:13 pm
by Screet
Cmdr James wrote:
I suspect that this may be an oolite bug, rather than pirate coves.

Each time I see a Pirate Cove, (Pirate_coves 1.1b.oxp) it launches one (Offender) defense-ship with me as its target. The launched ship sits outside the docking slot and does nothing until attacked.

The pirate cove rewards 10Cr bounty when destroyed, which is funny, I think it should be 100 from memory, and by inspecting the plist?
I also get the 10Cr reward, but then the cove has no defenses...and it's even possible to do some highly rewarding trading with them before shooting them down :twisted:

I don't have the inactive ships until I use the cloak and switch it off again - then the defenders behave like you said, sometimes they begin to dock again and won't even return fire. Without cloak usage, they do attack me...but I believe that I need to be closer than within the range in which they are launched.

Screet

Re: Pirate Cove bug when using oolite trunk ?

Posted: Sat Mar 14, 2009 9:04 pm
by Eric Walch
Cmdr James wrote:
The pirate cove rewards 10Cr bounty when destroyed, which is funny, I think it should be 100 from memory, and by inspecting the plist?
Its in playerEntity that anything with scanclass rock (and cargo or buoys) gives a reward of 10% of the bounty. :

Code: Select all

		if ((killIsCargo) || (killClass == CLASS_BUOY) || (killClass == CLASS_ROCK))
		{
			if (![other hasRole:@"tharglet"])	// okay, we'll count tharglets as proper kills
			{
				score /= 10;	// reduce bounty awarded
				killAward = NO;	// don't award a kill
			}
		}
Only targlets are an exception of this rule and give full bounty. I don't know why the code is only giving 10% of the bounty. It could have defined the bounty itself smaller in the first place. Anyhow, I think the code should stay as it is and I set the bounty at 1000 for a next release to give the player a 100 cr. bounty.

That launching ships don't attack you could be a trunk error. They leave with a pirate AI. So they don't use the given target itself but should behave like any other pirate and search for a new target. are you sure you weren't cloaked? In that case the start a docking procedure and will stop scanning. They enter the dockingAI that almost all docking ships use.

Edit: It is also this code line that makes that when a pilot of a hostile ship with 80 cr bounty escapes, you only get 8.0 credits for killing the abandoned ship. In the past I found this a bug but now I see it more as a feature.

It is not the ship that is hostile, but its pilot is to blame for everything. When looking in the code I even see that the legal status of the ship is transferred to the escaping pilot. Pilot, not capsule, so you have to scoop the pod to collect your bounty. Shooting the ship gives you just a 10% bonus in this case.

Re: Pirate Cove bug when using oolite trunk ?

Posted: Sat Mar 14, 2009 9:41 pm
by Eric Walch
Looking for awarding bounty in the code I found something else I never knew. When you attack a pirate that is busy attacking an innocent trader or police, you do get a reward for helping. 8)

Or better formulated: When the pirate switches his attention to you and the other ship sends you a "thank you" message, the bounty of the hostile ship is raised by a random value. This bounty is collected when you shoot it down, so you still have to work for your money. I just never noticed this during play as a normal player has no real clue about the targets bounty. (except when using Frame's bounty scanner of course) :)

Re: Pirate Cove bug when using oolite trunk ?

Posted: Sat Mar 14, 2009 9:50 pm
by Screet
Eric Walch wrote:
Looking for awarding bounty in the code I found something else I never knew. When you attack a pirate that is busy attacking an innocent trader or police, you do get a reward for helping. 8)
That's nice! I did notice that ships attacking police had an increased reward, but I thought that would have been because of their attack on the police, not because of me fighting them.

This thing can especially be seen by fighting thargoids which attack a station or bar - their reward is noticeably higher! Maybe the mechanism with thargoids is a bit different though, as I often saw the same levels of bounty, as could not be expected by pure random increases.

Screet

Re: Pirate Cove bug when using oolite trunk ?

Posted: Sat Mar 14, 2009 10:23 pm
by Eric Walch
Screet wrote:
That's nice! I did notice that ships attacking police had an increased reward, but I thought that would have been because of their attack on the police, not because of me fighting them.
Killing ships attacking police even gives better awards. Besides above reward, ever hit on a police increases the ships legal status. You can see it very good when installing the bounty scanner.

I once kept watching a pirate shooting a police. On every hit its bounty rose. So I decided not to help but wait until the bounty became interesting. Then, after a few minutes I killed the pirate and collected the big award (over 200 credits when I remember well). In this case the police even thanked me, while I let the pirate do its attacks for several minutes.

When I was that police I would have killed that player for starting to help so late. :roll:

Posted: Sat Mar 14, 2009 10:33 pm
by Cmdr James
On my system, the bounty scanner does not show the bounty for pirate coves. Im pretty sure it does in 1.72, doesnt it?

Edit: and if I use the javascript console to check the bounty, it appears to be 0 (consistent with the bounty scanner)

Code: Select all

> player.ship.target.roles
pirate-cove,rockhermit,station
> player.ship.target.bounty
0
But, interestingly, shooting a pirate cove inside the station aegis does not result in legal changes, so I suspect that the bounty is set internally, but is not correctly exposed to javascript.

It seems that the reason the launched pirates just sit there doing nothing is that they are escorting the pirate cove. That is to say they are in a group containing several ships -- apparently up to 6, the leader of which is the pirate cove. All the members of the group, except for the launched ship and the pirate cove have an ID of 0. I think this means that they are the unlaunched defense-ships.

So, my analysis so far is that there is something funky in the escort code. Which is embarrasing, as I think it might have been me that broke it :( I think there is also something odd happening with bounty handling, which used to be ok.

Posted: Sun Mar 15, 2009 9:24 am
by Eric Walch
Cmdr James wrote:
On my system, the bounty scanner does not show the bounty for pirate coves. Im pretty sure it does in 1.72, doesnt it?...... does not result in legal changes, so I suspect that the bounty is set internally, but is not correctly exposed to javascript.
Has always been wrong: javascript exposes the legal status as bounty. In the code it are different things. Specially for scanclass thargoid and scanclass rock. Legal status for rock is always zero while it can have a bounty.
It seems that the reason the launched pirates just sit there doing nothing is that they are escorting the pirate cove. That is to say they are in a group containing several ships -- apparently up to 6, the leader of which is the pirate cove. .... So, my analysis so far is that there is something funky in the escort code.
Sounds buggy as mothers are supposed to only accept ships with the same scan class as itself as escort. This I definitely never saw in the normal 1.72 release.

Posted: Sun Mar 15, 2009 8:23 pm
by Cmdr James
OK, I have an easy fix for incorrect scan classes escorting each other. But If I commit that change, then what is to stop the pirates from attacking their own pirate-cove? Dont they need to be in the same group to stay friendly?

Posted: Sun Mar 15, 2009 9:33 pm
by Eric Walch
Cmdr James wrote:
OK, I have an easy fix for incorrect scan classes escorting each other. But If I commit that change, then what is to stop the pirates from attacking their own pirate-cove? Dont they need to be in the same group to stay friendly?
As far as I know that check for same scanclass for escorting has always been in the code. When remembering right it is part of the AI command "scanForFormationLeader". I would look more in why the launched pirates have the wrong AI. They should launch with a plain pirateAI. That AI will never perform an escort.

And pirates only attack traders and a station is never on their list. (only the random hits bar is on the pirate target list but LB explicit put the bar on that list.)

Posted: Sun Mar 15, 2009 10:59 pm
by Cmdr James
Its not the AI thats adding it to the group. I think this is caused by the station setting the group id for the ships it launches.

Posted: Mon Mar 16, 2009 1:26 pm
by Eric Walch
Cmdr James wrote:
Its not the AI thats adding it to the group. I think this is caused by the station setting the group id for the ships it launches.
Group ID for launching defenders was already set with Oolite 1.65 and never gave this result.

It must be the AI. To get a ship in performEscort behaviour, it needs an explicit command to do that. The only AI that contains this command is the escortAI. And even when the station would somehow pult launching ships in that behaviour, the pirateAI should almost immediately change that to a flyToRangeFromDestination behaviour. The code that launches pirates is almost identical to the code that launches defense ships from the main station. Is that also acting strange?

Posted: Mon Mar 16, 2009 2:41 pm
by Screet
I'm not sure if this is related, but it sounds to me like this could be part of the problem. I'm running 1.72.2 and have the OSE WIP installed.

I just encountered a pirate cove that did launch several pirates to intercept me, but those did stay doing nothing until I began shooting at them...and their friends did just watch.

I then decided to take out the pirate cove, which did cause it to launch another defender. Strangely, this was a constitution (OSE bug) as a military system vessel!!!

Screet

Posted: Mon Mar 16, 2009 4:41 pm
by Eric Walch
BTW. With 1.73 all stations will have a event handler for launching ships. My intention was always to do a new upload of Pirate Cove when 1.73 is released. With 1.73 and this handler it becomes possible to attach a custom AI to the launching pirates. The general pirateAI has a few disadvantages as station defenders. And with a customised AI I also can switch to a customised docking AI. Currently you can only give a custom role to predefined defence ships not to a general role as "pirate".
I already prepared the code but will have to wait until the 1.73 release to start testing it.

Screet: Pirate Coves should never launch police as defence ships. Rock hermits do however. Maybe there is a mixup? Actually rockhermits also don't launch police but defenders. When no defenders are defined as with hermits, the system defaults to police. I think this default for hermits is changed for 1.73.

Re: Pirate Cove bug when using oolite trunk ?

Posted: Tue Mar 17, 2009 12:24 am
by Screet
Eric Walch wrote:
Looking for awarding bounty in the code I found something else I never knew. When you attack a pirate that is busy attacking an innocent trader or police, you do get a reward for helping. 8)
I just had some experience which might be due to this. I had another black monk ship hunt a strange looking BCC...and I am very sure that both ships were clean. The black monk ship did some hits on the BCC and I decided that I don't like credit sharks, even when they are clean. Thus I did open fire on the black monk ship...and there was a thanks from the BCC and the black monk ship was an offender.

The code you did report about would explain this, as there was no police around.

Maybe that's a bug, but in this case, I believe it's a nice feature: if two clean ships agree on a third clean ship being the attacker, it does get an offender flag :twisted:

Screet