Submunitions do not award the player kills

For test results, bug reports, announcements of new builds etc.

Moderators: winston, another_commander, Getafix

Post Reply
User avatar
Nemoricus
---- E L I T E ----
---- E L I T E ----
Posts: 388
Joined: Mon May 18, 2009 8:51 pm

Submunitions do not award the player kills

Post by Nemoricus »

Exactly as the topic says.

If a player uses a weapon with submunitions like Thargoid's Trident missile, they will not be awarded a kill as Oolite does not register the player as the killer.

If this is something that can be sorted out in Oolite itself, well and good. If not, it may be necessary to write a script that can do that. However, I'm not sure how to do that myself.
Dream as if you'll live forever
Live as if you'll die tomorrow
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6683
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

Is it the trunk version you are referring to?
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Post by Thargoid »

I know this problem with the trident, I've been pondering the best way around it. It is not too difficult with a bit of script juggling to award a kill and the bounty to the player for a trident kill (presuming something like OSE doesn't give them to NPCs).

It will fall down a little for Thargoids in terms of bounty awarded (as the Captured Thargons, Escorts and Guardians already do), and won't deal with special awards like the constrictor mission, but there is no easy way around those.
User avatar
Cmdr James
Commodore
Commodore
Posts: 1357
Joined: Tue Jun 05, 2007 10:43 pm
Location: Berlin

Post by Cmdr James »

I thought this was fixed a few weeks ago.

I guess the problem is that the submunitions are not inheriting their parents owner?
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6683
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

I thought the same too. That is why I asked Nemoricus if this is the trunk we are talking about. I actually tested the submunitions earlier with Frame's submunition test oxp he posted a while ago and the owner of the submunitions is correctly reported as the player.
User avatar
Lestradae
---- E L I T E ----
---- E L I T E ----
Posts: 3095
Joined: Tue Apr 17, 2007 10:30 pm
Location: Vienna, Austria

..

Post by Lestradae »

@Nemoricus:

If I understand correctly what A_C & Cmdr James are saying here, then your & our problem with submunitions is solved the moment 1.73 comes out.

Then you could use everything on my roles list and ignore the "is submunition" header :wink:

@A_C & Cmdr James:

So the game - from future 1.73 onwards - will understand by itself when an entity "belongs" to the player, even if it was only spawned by something fired by the player, such as drones, missile racks, cluster bombs etc., yes?

If the above is correct, then my above statement towards Nemoricus should be correct ...

Cheers 8)

L
Screet
---- E L I T E ----
---- E L I T E ----
Posts: 1883
Joined: Wed Dec 10, 2008 3:02 am
Location: Bremen, Germany

Post by Screet »

Cmdr James wrote:
I thought this was fixed a few weeks ago.
I guess the problem is that the submunitions are not inheriting their parents owner?
I haven't tried submunitions, but with the current trunk version, Thargoids message is correct:
Kills and Bounty from guardians, captured thargons and the like are counted in a different way. For thargoids they even deliver a higher award (namely the same which the bounty scanner reads) and if it's a galactic navy mission, those kills are not counted for the player. I bet that it's the same with every oxp that requires the player to make a kill.

Screet
User avatar
Cmdr James
Commodore
Commodore
Posts: 1357
Joined: Tue Jun 05, 2007 10:43 pm
Location: Berlin

Post by Cmdr James »

Thats because thargons/drone ships do not count kills towards the player, but rather to themselves. The bounty is paid by a script, not by the normal mechanism.

My guess is that if they attack police you also do not get a criminal record.

I think for this to work as intended, we would need to change some stuff in the way kills are assigned internally in the game, but we need to be cautious as there may be unintended side-effects.
User avatar
Nemoricus
---- E L I T E ----
---- E L I T E ----
Posts: 388
Joined: Mon May 18, 2009 8:51 pm

Post by Nemoricus »

I just ran it with the trunk version. Turns out that this has already been sorted out, but I discovered another bug.

You're credited with blowing up your own submunitions! A Trident missile launches nine warheads. One detonates, all the rest are destroyed and detonate, and then the target ship is destroyed. A total of nine kills.

Seems a bit wrong, don't you think?
Dream as if you'll live forever
Live as if you'll die tomorrow
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Post by Thargoid »

For reference, the Trident performs this code when it gets near its target and the "main body missile" self-destructs to launch the tines (script function called by the AI):

Code: Select all

this.spawnTines = function() 
	{ 
	var loopCounter = 0 ; // reset the counter
	for(loopCounter = 0; loopCounter < 9; loopCounter++)
		{
		var Tine = this.ship.spawnOne("aquatics_tridentTine");
		this.xDistance = ((Math.random() * 40) - 20);
		this.yDistance = ((Math.random() * 40) - 20);
		Tine.setPosition(this.ship.position.add([this.xDistance, this.yDistance, 0]));
		Tine.setOrientation(this.ship.orientation); 
		Tine.target = this.ship.target;
		}
	}
And the tines themselves are essentially just small and very limited range missiles, except that they are defined with the submunitions flag set:

Code: Select all

	"aquatics_tridentTine" =
	{
		ai_type = "aquatics_tridentTineAI.plist";
		cargo_type = "CARGO_NOT_CARGO";
		energy_recharge_rate = 0;
		exhaust = ("0.0 0.0 -1.5 0.5 0.5 3.0");
		forward_weapon_type = "WEAPON_NONE";
		is_submunition = true;
		max_energy = 5;
		max_flight_pitch = 12;
		max_flight_roll = 16;
		max_flight_speed = 1000;
		missiles = 0;
		model = "aquatics_tridentTine.dat";
		name = "Trident Tine";
		roles = "aquatics_tridentTine";
		scanClass = "CLASS_MISSILE";
		thrust = 750;
		unpiloted = 1;
		weapon_energy = 3000;
	};
So essentially the main missile is launching 9 sub-missiles at its target from close range. The award of 9 kills is a glitch then, as those kills are awarded by the trunk code, the tines themselves have no ship scripting. The code above is from (and is the whole body of) the main missile's ships script.
User avatar
Nemoricus
---- E L I T E ----
---- E L I T E ----
Posts: 388
Joined: Mon May 18, 2009 8:51 pm

Post by Nemoricus »

I wasn't saying that your missile had a problem, but that Oolite did.

I'm sorry for the confusion.
Dream as if you'll live forever
Live as if you'll die tomorrow
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6683
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

Submunitions awarding kills when destroyed by same owner submunitions should now be fixed in SVN2215.
User avatar
Nemoricus
---- E L I T E ----
---- E L I T E ----
Posts: 388
Joined: Mon May 18, 2009 8:51 pm

Post by Nemoricus »

I've just taken a look and it appears to work.

Nice job.
Dream as if you'll live forever
Live as if you'll die tomorrow
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 »

another_commander wrote:
Submunitions awarding kills when destroyed by same owner submunitions should now be fixed in SVN2215.
I hadn't used my subminition oxp since I have trunk. It didn't work perfectly at start, but after a long search I found the bug in my own oxp. Submunition works!

Just to help others not making the same bug I made:

For testing purposes I just used a like_ship of splinters as sub munition. Firing it at a buoy worked perfectly but after firing it at an anaconda, half of the subs had the anaconda as owner. :?:
After a long search I found my mistake: Anaconda has fuel-scoops and splinters are scoopable. :!: And scooping changes owner. Splinters were a bad choice as test objects!
Post Reply