Page 2 of 2

Re: Peaceful Thargoids Bug

Posted: Sat Mar 09, 2013 4:51 pm
by Eric Walch
Thargoid wrote:
I would guess probably by being scanClass CLASS_THARGOID.
Yes, the whole internal code is:

Code: Select all

- (void) checkOwnLegalStatus
{
	if (scanClass == CLASS_THARGOID)
	{
		[shipAI message:@"SELF_THARGOID"];
		return;
	}
	int ls = [self legalStatus];
	if (ls > 50)
	{
		[shipAI message:@"SELF_FUGITIVE"];
		return;
	}
	if (ls > 20)
	{
		[shipAI message:@"SELF_OFFENDER"];
		return;
	}
	if (ls > 0)
	{
		[shipAI message:@"SELF_MINOR_OFFENDER"];
		return;
	}
	[shipAI message:@"SELF_CLEAN"];
}
And it is in use since 1st August 2009 (That is Oolite 1.74 when I remember well).
Nice that 'Blame' function in XCode that gives the last modifying author for each line. Much easier that blame from the commandline. :D

Re: Peaceful Thargoids Bug

Posted: Sat Mar 09, 2013 5:16 pm
by Commander McLane
Ah, thanks!

The only question then is why it wasn't happening.

Anyway, the dying Thargoid Carrier now switches all its escorts to thargoidAI (and sets their primary role to "thargoid") via script. This enables them to go about their Thargoid business more immediately. Also, it prevents them from ending up as escorts of a trader. :wink:

Re: Peaceful Thargoids Bug

Posted: Sat Mar 09, 2013 6:34 pm
by cim
Commander McLane wrote:
Anyway, the dying Thargoid Carrier now switches all its escorts to thargoidAI (and sets their primary role to "thargoid") via script. This enables them to go about their Thargoid business more immediately. Also, it prevents them from ending up as escorts of a trader. :wink:
It always gave the interesting behaviour that the Carrier's escorts were the only thargoid ships which would run away if under heavy fire.

Re: Peaceful Thargoids Bug

Posted: Sat Mar 09, 2013 7:49 pm
by Commander McLane
cim wrote:
Commander McLane wrote:
Anyway, the dying Thargoid Carrier now switches all its escorts to thargoidAI (and sets their primary role to "thargoid") via script. This enables them to go about their Thargoid business more immediately. Also, it prevents them from ending up as escorts of a trader. :wink:
It always gave the interesting behaviour that the Carrier's escorts were the only thargoid ships which would run away if under heavy fire.
Not only those.

I just experimented with the new accuracy parameter for the Thargoid Plasma Accelerators. I spawned a Plasma Accelerator in the Aegis, gave it an accuracy of 8 (later I even raised to 10) and expected it to attack and kill mercilessly and quickly. Interestingly, that didn't happen. With the AI inspector I saw it go through all kinds of behaviour very quickly, but it rarely fired any shot at all. Most of the time was spent (wasted) in ATTACK_FLY_TO_TARGET_TWELVE, but in the other behaviours it wasn't much better. EVASIVE_ACTION was a close second. No shots fired during that one at all. Two or three defenders took shifts in firing at the warship, and I constantly restored its energy via the console to make it last one or two minutes. It fired not more than five or so shots in this time.

I don't know whether it makes a difference that the lasers are on subentities, not on the actual ship. Does in that case the accuracy have to be set for the subentities, not the main entity?

Re: Peaceful Thargoids Bug

Posted: Sat Mar 09, 2013 9:22 pm
by cim
Commander McLane wrote:
I don't know whether it makes a difference that the lasers are on subentities, not on the actual ship. Does in that case the accuracy have to be set for the subentities, not the main entity?
Does it have a standard Thargoid laser equipped on the main body? If so that might be confusing it.

(Accuracy on subents is basically ignored)

Re: Peaceful Thargoids Bug

Posted: Sat Mar 09, 2013 10:05 pm
by Commander McLane
cim wrote:
Does it have a standard Thargoid laser equipped on the main body? If so that might be confusing it.
No. No weapon at all on the main body, only through subents.

Re: Peaceful Thargoids Bug

Posted: Sat Mar 09, 2013 10:35 pm
by cim
Commander McLane wrote:
cim wrote:
Does it have a standard Thargoid laser equipped on the main body? If so that might be confusing it.
No. No weapon at all on the main body, only through subents.
And all of those weapons are standard forward firing beam/military lasers? Hmm... maybe there's something checking scan class wrongly.

Re: Peaceful Thargoids Bug

Posted: Sun Mar 10, 2013 11:45 am
by Commander McLane
cim wrote:
Commander McLane wrote:
cim wrote:
Does it have a standard Thargoid laser equipped on the main body? If so that might be confusing it.
No. No weapon at all on the main body, only through subents.
And all of those weapons are standard forward firing beam/military lasers?
Yes, in case of the straight plasma accelerators. In case of the turreted plasma accelerators it's all standard thargoid lasers. Both were behaving equally reluctantly.

Re: Peaceful Thargoids Bug

Posted: Sun Mar 10, 2013 12:09 pm
by cim
Commander McLane wrote:
Yes, in case of the straight plasma accelerators. In case of the turreted plasma accelerators it's all standard thargoid lasers. Both were behaving equally reluctantly.
Right - definitely a bug somewhere then. I'll have a look at it.

Re: Peaceful Thargoids Bug

Posted: Mon Mar 11, 2013 11:39 am
by Commander McLane
Maybe I stumbled upon something:

I continued with my trials, spawning plasma accelerators in the Aegis. The result is always the same: some fire on the station, but once its defenders launch, they keep the Thargoid so busy between them, that it's practically not firing at all. I'm seeing a lot of switching between targets, depending on which station defender has landed the latest hits, and a lot of BEHAVIOUR_EVASIVE_ACTION, but without actually evading any incoming fire. The Thargoid's laser temperature doesn't really rise above 0.03, indicating that it hardly fires any shot. It's killed in mere seconds.

Then I wanted to compare the Thargoid Carrier OXP's plasma accelerators with ordinary warships, so for the next test I just spawned a "thargoid". Same behaviour, same result.

For the next test the spawned ship happened to be a Thargorn Battleship (from Thargorn Threat OXP). Now the picture was quite different: I didn't see any BEHAVIOUR_EVASIVE_ACTION, and the Thargorn's laser temperature rose well above 0.2 and usually remained there, indicating a constant firing rate with no big breaks.

All ships use the same thargoidAI, so this shouldn't make a difference. The only obvious difference is that the Thargorn Battleship has a max energy of 2000, while both the standard warship and the plasma accelerator have 600. So could it be that a standard warship is now feeling too weak for fighting and falling into an evasive, defensive behaviour? While the strong battleship simply doesn't care and fights? Ironically, the battleship's energy never sunk below 1400. So, while the defensive warships were killed quickly, the offensive battleship never lost as much energy as they lost in mere seconds.

Re: Peaceful Thargoids Bug

Posted: Mon Mar 11, 2013 12:41 pm
by cim
You can confuse any NPC by hitting them repeatedly with lots of different ships, and Thargoids have the disadvantage that they're really easy to hit, too. So that makes sense, I suppose, for the plasma accelerator ones with a standard directional weapon. Maybe in that case they'd actually do better with a lower accuracy around 4 or so - don't try to evade, just hammer the station (and tweak the AI so they don't switch targets on hits).

A standard Thargoid shouldn't be getting into that mess, though. Their omnidirectional weapon attack routine should be combining evasion and return fire to begin with, so they should never be ending up in EVASIVE_ACTION. Must be a loose case somewhere.

Re: Peaceful Thargoids Bug

Posted: Mon Mar 11, 2013 5:59 pm
by cim
There was a loose case, but thinking about it there's nothing wrong with Thargoids trying to dodge incoming fire. In r5649 ships will fire back in EVASIVE_ACTION behaviour, though unless they have a Thargoid laser (or several) the chances of them being on-target are minimal.