missile reactions...

An area for discussing new ideas and additions to Oolite.

Moderators: winston, another_commander

another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6683
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

Screet wrote:
I'll leave that line in for my version...now it's just the question wether this should be included in the trunk version.
I would not add this to trunk. It gives an unfair advantage to the player's turrets, while NPCs can still not target missiles. Making them somehow switch to targetting the incoming missiles would change their behaviour and the combat dynamics in a way that I personally don't consider profitable. I prefer leaving it as it is: turrets cannot target missiles.
User avatar
Cmdr Wyvern
---- E L I T E ----
---- E L I T E ----
Posts: 1649
Joined: Tue Apr 11, 2006 1:47 am
Location: Somewhere in the great starry void

Post by Cmdr Wyvern »

another_commander wrote:
It gives an unfair advantage to the player's turrets, while NPCs can still not target missiles.
Oh yeah? Mind telling that to the many Griff Boas, Dragon Ms, Cadeceuses, ect, that shot down my missiles using their turrets? They seem to have missed the memo.
NPC turrets do fire at missiles, and they're damn good at knocking your missiles out of the sky. Meanwhile, YOUR turrets happily ignore incoming missiles. Now who's got the advantage here?

All in favor of Screet's turret fix, say aye.

Aye!
Running Oolite buttery smooth & rock stable w/ tons of eyecandy oxps on:
ASUS Prime X370-A
Ryzen 5 1500X
16GB DDR4 3200MHZ
128GB NVMe M.2 SSD (Boot drive)
1TB Hybrid HDD (For software and games)
EVGA GTX-1070 SC
1080P Samsung large screen monitor
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 »

another_commander wrote:
[I prefer leaving it as it is: turrets cannot target missiles.
But that game should be set in the future...please have a look at nowadays standard technology:
http://en.wikipedia.org/wiki/Close-in_weapon_system
"A Close-in weapon system (CIWS) is a naval shipboard point-defense weapon for detecting and destroying incoming anti-ship missiles and enemy aircraft at short range"
"Nearly all classes of modern warship are equipped with some kind of CIWS device."

So if Wyvern is right that NPCs target missiles (I don't use missiles, so I never could see such a thing!), why not? And if they really don't target the missiles and those shots Wyvern saw were lucky shots while the ship tried to hit the player - hey, I could look into the NPC turret code which is different from player turret code anyway and see if I can get those to fire at missiles (and hostile ships?) without requiring target lock, both for NPC and player alike?

Screet
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6683
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

Cmdr Wyvern wrote:
another_commander wrote:
It gives an unfair advantage to the player's turrets, while NPCs can still not target missiles.
Oh yeah? Mind telling that to the many Griff Boas, Dragon Ms, Cadeceuses, ect, that shot down my missiles using their turrets? They seem to have missed the memo.
NPC turrets do fire at missiles, and they're damn good at knocking your missiles out of the sky. Meanwhile, YOUR turrets happily ignore incoming missiles. Now who's got the advantage here?

All in favor of Screet's turret fix, say aye.

Aye!
Let's talk code for a second, OK? ShipEntity's hasHostileTarget - on which turret firing depends - depends on the IsBehaviourHostile function, defined like this:

Code: Select all

OOINLINE BOOL IsBehaviourHostile(OOBehaviour behaviour)
{
	return 100 < behaviour && behaviour < 120;
}
So, any behaviour enumerated between 100 and 120 is what causes the turret to fire. Let's see what these behaviours are:

Code: Select all

BEHAVIOUR_ATTACK_TARGET					= 101,
	BEHAVIOUR_ATTACK_FLY_TO_TARGET			= 102,
	BEHAVIOUR_ATTACK_FLY_FROM_TARGET		= 103,
	BEHAVIOUR_RUNNING_DEFENSE				= 104,
	
// fleeing
	BEHAVIOUR_FLEE_TARGET					= 105,
	
// advanced combat...
	BEHAVIOUR_ATTACK_FLY_TO_TARGET_SIX		= 106,
	BEHAVIOUR_ATTACK_MINING_TARGET			= 107,
	
// further advanced combat...
	BEHAVIOUR_ATTACK_FLY_TO_TARGET_TWELVE	= 112,...snip
Now, missiles fired get a BEHAVIOUR_INTERCEPT_TARGET from their AI. What enumeration does this have?

Code: Select all

BEHAVIOUR_INTERCEPT_TARGET				= 350,
As you see, the missile attacking behaviour cannot be recognized as hostile.(Incorrect for NPCs, it's their own behaviour that decides hostility, not that of the target, contrary to what happens with player). I have no idea how your NPC turrets attack missiles, but I guess these are OXP missiles that behave differently or just coincidence.(No, they actually do fire at the missiles).

Until proof of the opposite, allow me to maintain my opinion of unfairness regarding this change. Player will have the advantage.See my next post.
Last edited by another_commander on Tue Apr 28, 2009 11:24 pm, edited 2 times in total.
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 »

another_commander wrote:
Until proof of the opposite, allow me to maintain my opinion of unfairness regarding this change. Player will have the advantage.
A suggestion. Would it be a big effort to script in that both NPC and player ships would have their turrets fire at incoming missiles?

If I understood correctly, this would "only" be a matter of defining the above cited variables a bit differently for NPC ships.

Another issue I would also throw into the equation that there should still be a possibility for missiles to get through after all. I am thinking about this in my oxp, too. There are many options for missile defence now - that's strategy, that's good imo - but, this should perhaps not lead to a situation where missiles do no longer play a role in combat.

Just my 0.2 Cr.
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 just realized there is a mistake in my analysis of the code above. Without going into too much detail, when an NPC ship goes in BEHAVIOUR_FLEE_TARGET, it is considered hostile behaviour. If a missile has been targetted at that time, then this would cause the turrets to fire at it. So, Wyvern is correct, the advantage is with the NPCs. In such case, it would be sensible to add Screet's change in. I will give it some testing and if it works as expected, then I will consider it for the trunk.
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Post by Thargoid »

On a slight tangent I've been playing with a new heavily-armed NPC ship (lots of missiles and lasers - it's a mission target) and had a couple of examples of the Hired Gun player escorts killing missiles (presumably with laser, as they were Viper Interceptors without turrets).

So it's some further proof that NPCs can target missiles, even with their guns too.
Screet
---- E L I T E ----
---- E L I T E ----
Posts: 1883
Joined: Wed Dec 10, 2008 3:02 am
Location: Bremen, Germany

Re: ..

Post by Screet »

Lestradae wrote:
Another issue I would also throw into the equation that there should still be a possibility for missiles to get through after all. I am thinking about this in my oxp, too. There are many options for missile defence now - that's strategy, that's good imo - but, this should perhaps not lead to a situation where missiles do no longer play a role in combat.
My ships turrets didn't so often get the missiles down, as turret balls are slow and missiles fast and small. While trying this with MASC off or with this strange weapon which does switch the MASC off due to low energy, I had several occasions where NPC missiles caused "press space" ;)

Screet
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6683
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

Those of you with access to trunk can build SVN2151 or later and try a new experimental feature: Ability to target the nearest incoming missile. You will need to edit the GNUmakefile and change the line that reads
TARGET_INCOMING_MISSILES = no
to
TARGET_INCOMING_MISSILES = yes
and clean-build the entire project. To target an incoming missile you either press Shift+T or you can assign a joystick button. Upon pressing the key/button, your targetting system will switch to the nearest missile fired against your ship, regardless of the position of the missile at the time. This means that you will not have to bring the missile in front of the crosshairs in order for it to be targetted.

This will give the player the ability to utilize their turrets for shooting down missiles and equalize things a bit with regards to NPC turrets. Oh, and now missiles are always considered having hostile behaviour (the very fact that a missile is airborne means that it has a hostile target to chase).

Please note that this is still experimental. The effect it will have on gameplay is to be determined so any feedback would be more than welcome.
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 »

another_commander wrote:
Please note that this is still experimental. The effect it will have on gameplay is to be determined so any feedback would be more than welcome.
Could it be that turrets no longer target missiles? If so, is this by decision or accident?

I recently noticed that my turrets no longer tried to shoot them (possibly they were simply too fast to track?) and had a look in the code...and it appears to me that it's no longer possible for turrets to target missiles.

Screet
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6683
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

Screet wrote:
another_commander wrote:
Please note that this is still experimental. The effect it will have on gameplay is to be determined so any feedback would be more than welcome.
Could it be that turrets no longer target missiles? If so, is this by decision or accident?

I recently noticed that my turrets no longer tried to shoot them (possibly they were simply too fast to track?) and had a look in the code...and it appears to me that it's no longer possible for turrets to target missiles.

Screet
Turrets target missiles (ECM-resistant or not) without problems both in trunk and 1.73.4, not sure why you say that in the code it appears it's not possible to do it anymore.

Here is a screenie showing a turret firing at a missile after I targeted it with 't' (ignore the misaligned hud):
Image
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 »

another_commander wrote:
Turrets target missiles (ECM-resistant or not) without problems both in trunk and 1.73.4, not sure why you say that in the code it appears it's not possible to do it anymore.
I had a look at where the definition is being used...and there was no occurence in playerentity.m. The turrets are in shipentity.m and perform hasHostileTarget before they shoot - for the player this seems to call that method from playerentity.m instead of shipentity.m - but in playerentity.m the target is required to be a ship (as opposed to the version in shipentity.m), thus not allowing to return true for missiles and thus not allowing to fire at them. Might be I'm just too sleepy.

I went looking because with turrets hot (I did check that!) I had my turrets sit inactive with missiles.

Screet
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6683
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

Screet wrote:
I had a look at where the definition is being used...and there was no occurence in playerentity.m. The turrets are in shipentity.m and perform hasHostileTarget before they shoot - for the player this seems to call that method from playerentity.m instead of shipentity.m - but in playerentity.m the target is required to be a ship (as opposed to the version in shipentity.m), thus not allowing to return true for missiles and thus not allowing to fire at them. Might be I'm just too sleepy.
Missiles are ships. They are taking their properties and methods from the ShipEntity class.
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 »

another_commander wrote:
Screet wrote:
I had a look at where the definition is being used...and there was no occurence in playerentity.m. The turrets are in shipentity.m and perform hasHostileTarget before they shoot - for the player this seems to call that method from playerentity.m instead of shipentity.m - but in playerentity.m the target is required to be a ship (as opposed to the version in shipentity.m), thus not allowing to return true for missiles and thus not allowing to fire at them. Might be I'm just too sleepy.
Missiles are ships. They are taking their properties and methods from the ShipEntity class.
behaviour_track_as_turret:

if(turret_owner && turret_target && [turret_owner hasHostileTarget])

Does this call hasHostileTarget from shipentity.m or playerentity.m when the turret owner is the player?

Screet
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6683
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

From PlayerEntity.m.
Post Reply