harfang3d / dogfight-sandbox-hg2

Air to air combat sandbox, created in Python 3 using the HARFANG 3D 2 framework.
GNU General Public License v3.0
162 stars 47 forks source link

The missiles fail to hit the target. #71

Closed KevinGrey closed 1 year ago

KevinGrey commented 1 year ago

Hello,

I encountered an issue while configuring the dogfight on the new workstation. When the target device locks onto the opponent and the missile device launches a missile, the missile consistently deviates from the target, continuously circling around it, even when the opponent is flying at a constant speed without any turns. However, when I configured it on my personal laptop, it worked fine.

I would like to inquire about the possible solutions to resolve this issue. Could it be related to the hardware configuration? The GPU on my device is Nvidia GeForce RTX 3090.

Thank you for your assistance in advance.

KevinGrey commented 1 year ago

Additionally, I would like to provide further information. The provided link contains a video recording made by me, where it can be observed that the missiles, which fail to hit the target, continuously circle around the aircraft without ceasing. https://streamable.com/1bs7sa

astrofra commented 1 year ago

Hi Kevin! Thanks for taking the time to record this video (you might upload it on the conversation thread, btw). From what I see, it looks like one of the missiles will hit the target (the first one ?), then the two other will indeed circle around (that even wouldn't be possible in real life, it shows the limitation of the missile guidance code).

Do you share this diagnostic ?

ErkMkd commented 1 year ago

In your video, the planes are falling, they are not flying. Missiles are intended for aerial targets moving at a significant speed. If their target moves too slowly, the direction change speed of the missiles is too low: they turn around without being able to reach it.

ErkMkd commented 1 year ago

You can change the angular frictions of Sidewinders missiles here for example: https://github.com/harfang3d/dogfight-sandbox-hg2/blob/main/source/missile_Sidewinder.py#L21