Join us at the Oolite Anniversary Party -- London, 7th July 2024, 1pm
More details in this thread.

OOlite 1.73.4 - enemy missiles have a hard time hitting me

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

Moderators: winston, another_commander, Getafix

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 »

Hmmm.

Was a bit early this morning and have been looking at a bit wrong position in the code, missing the difference between attack state and attack behaviour :oops:

I think the problem with missiles might be that NPCs (and thus missiles) seemingly only know pitch/roll and not pitch/yaw/roll which might heavily affect missiles when they are very close.

Aside from that, the intercept behaviour does use the result of missileTrackPrimaryTarget in order to set it's speed. The return value there is maximum of 0 and dot_product(relPos, v_forward). The comment says that this would be the cosine of angle between angle to target and v_forward.

If the missile is circling, the target is around 90 degrees off of the missiles flight path. I fail to understand why the code does not even stop the missile instantly (as a result of 0 would lead to speed 0).

Sometimes it's really bad that I've never really managed to understand the language of mathematics :(

Screet
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 »

OK, I've had some more reading of that intercept thing which steers the missiles.

What confuses me is that the code does reduce pitch/roll depending upon the delta_t which was given during the call of that method. delta_t sounds to me as if this is the time interval since the last call. I fail to understand why a short interval would have to lead to reduced pitch/roll - doesn't that make missiles abilities machine-dependent (worse on faster machines)? The maximum pitch/roll for missiles is defined anyway and these values are passed to another method in order to apply the desired changes.

In my own version I've temporarily disabled that dampening code and it appears to me as if the missiles can hit a bit better now, although I still had some circling my Caduceus :?

I did just run some test to find a bug with OSE hardpirates...and for it I did cause OSE to add many more of these than usual. I did have the same type of testrun yesterday. The log does not count the missiles fired, but it did report many, many more missiles to hit their target than yesterday. That might indicate that the dampening really is no good choice.

Screet
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

Micha wrote:
A couple of missiles were fired at me, but instead of closing in on me they flew in formation with the ships which had fired them, at ~20km distance (I was flying away from the group).
This is, er, the secret missile standoff mode. Um.
What confuses me is that the code does reduce pitch/roll depending upon the delta_t which was given during the call of that method. delta_t sounds to me as if this is the time interval since the last call. I fail to understand why a short interval would have to lead to reduced pitch/roll - doesn't that make missiles abilities machine-dependent (worse on faster machines)?
No, exactly the opposite. If you apply roll x for one second, then at 100 FPS that becomes x/100 applied 100 times, and at 10 FPS it becomes x/10 applied 10 times, resulting in the same total. For non-linear relationships it doesn’t quite work, but it’s good enough for basic simulations like Oolite. For more depth, read up on numerical integration, but be prepared to experience those bleeding eyes firsthand…
User avatar
DaddyHoggy
Intergalactic Spam Assassin
Intergalactic Spam Assassin
Posts: 8512
Joined: Tue Dec 05, 2006 9:43 pm
Location: Newbury, UK
Contact:

Post by DaddyHoggy »

Ahruman wrote:
Micha wrote:
A couple of missiles were fired at me, but instead of closing in on me they flew in formation with the ships which had fired them, at ~20km distance (I was flying away from the group).
This is, er, the secret missile standoff mode. Um.
What confuses me is that the code does reduce pitch/roll depending upon the delta_t which was given during the call of that method. delta_t sounds to me as if this is the time interval since the last call. I fail to understand why a short interval would have to lead to reduced pitch/roll - doesn't that make missiles abilities machine-dependent (worse on faster machines)?
No, exactly the opposite. If you apply roll x for one second, then at 100 FPS that becomes x/100 applied 100 times, and at 10 FPS it becomes x/10 applied 10 times, resulting in the same total. For non-linear relationships it doesn’t quite work, but it’s good enough for basic simulations like Oolite. For more depth, read up on numerical integration, but be prepared to experience those bleeding eyes firsthand…
Ah, Simpson's Rule, one of the (many) things that helped me on my way to fail A-level Pure Maths...
Selezen wrote:
Apparently I was having a DaddyHoggy moment.
Oolite Life is now revealed here
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 »

Hmm. After some testing, I did go for enhancing pitch/roll of missiles. Looks like I should have tried that first.

It's MUCH better now, although occasionally it appears to me that a missile turns away from it's target for a short while. I don't understand why, as missiles do not have collision avoidance - I did verify that in the code.

Screet
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 »

Setting the missiles pitch/role higher helps stop the circling? How high did you set their values?
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:
Setting the missiles pitch/role higher helps stop the circling? How high did you set their values?
I used 8 as minimum and it seems that could even be raised to 10. I guess that especially those of OSE with higher speed really need higher pitch/roll to compensate...setting the accuracy only adjust their targeting skills (flightpath prediction) but not their turn rates. One problem also is that - as all NPCs - missiles do not have yaw control. Thus they need to roll and then use a high pitch in order to achieve and maintain a proper course.

Screet
Chrisfs
---- E L I T E ----
---- E L I T E ----
Posts: 433
Joined: Sun Sep 20, 2009 10:24 am
Location: California

Post by Chrisfs »

I'm not a coder, but wanted to mention something I thought of from a novice perspective. I think it's not hard to design a perfect missile.
One has access to all the data. You just set up the destination to always equal the target ships' position and give it enough speed and manuverability and it will hit the target everytime, fast enough so that there's no time to even hit the 'E'. But a perfect missile is a bad game feature.

The tough part is creating an imperfect missile that is still a threat.
That's what marvels me about the missile and ship AIs. It is that they could be written in such a way that it's automatic death, but they aren't.

So you really have to strike a balance between making missiles to tough and too easy and I would stray a little on the easy side, because I can see that it would be very easy to make a 100% deadly missile.
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 »

Chrisfs wrote:
I'm not a coder, but wanted to mention something I thought of from a novice perspective. I think it's not hard to design a perfect missile.
That does not sound very novice. And of course you are right. For missiles you can define an accuracy. That accuracy changes some values. e.g. pitch_tolerance. Part of the accuracy is random and part can de defined in shipdata. Missiles must be threatening not deadly.
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 »

Eric Walch wrote:
Missiles must be threatening not deadly.
Well...since I updated the values for my installation, I've only been killed once by a missile (photon torpedo)...and some hundred did miss, while a handful did kill some equipment. However, it wasn't this bad "being surrounded by missiles which won't hit" thing I previously had very often.

The most deadly things for me are
1) A Constitution sneaking up behind me or ramming me while I'm on injector approach for missile release
2) The turrets of Black Monk gunships

Screet
Post Reply