PapaJoesSoup / BDArmory

Gun turrets and other weapon systems for KSP
113 stars 56 forks source link

Guard mode and turret ai cannot accurately hit orbiting targets at long range #617

Closed gbem1113 closed 5 years ago

gbem1113 commented 5 years ago
ISSUE TYPE
KSP and BDA Version

KSP 1.5.1

BD 1.2.3

OS / ENVIRONMENT

windows 10

SUMMARY

any shot fired at targets 10km or beyond seem to miss the target despite the relatively high precision... high precision low accuracy situation vs orbiting targets turning off gravity seems to fix the problem but disabling bullet drop (for the turret itself) does not suspecting that the aiming system does not take account of orbital mechanics and aims using the linear motion of the target but not on the orbital motion

STEPS TO REPRODUCE
  1. send a ship to space with a gun range of 10km or beyond
  2. lock on and aim at a target or activate guard mode
  3. fire and miss every shot
Log Files

none needed

Gedas-S commented 5 years ago

@gbem1113 by how much would you estimate the shots miss at 10km?

A couple of versions back I've been debugging this, got somewhat similar results, but couldn't find the root cause. Could be floating point errors (or krakensbane issues) in gravity accumulation (i.e. KSP is less accurate than our trajectory calculation :D ), could be orbital trajectory misestimation due to trajectory convexity (doesn't look like this one to me, though), and I'm stumped how to fix it up perfectly, short of making bullets homing. :)

Though if you notice any more details on when this happens, they are very much welcome!

gbem1113 commented 5 years ago

hmm making dedicated homing bullets modules for dedicated spacecraft weapons may be a way to temporarily resolve the issue... anyways the missing usually occurs depending on velocity... higher velocity seems to fix the issue along with a shutdown of gravity... ive also noticed that the shells are high on precision (shots are generally close to each other) but low on accuracy (shots overshoot the target)....

flywlyx commented 5 years ago

Calculation of the final target doesn't support orbital object, https://github.com/PapaJoesSoup/BDArmory/blob/12ce58b1f07eed8c646e17a1543de7dab9069157/BDArmory/Modules/ModuleWeapon.cs#L1623

gbem1113 commented 5 years ago

^exactly what ive been thinking... anyways hopefully this bug can be fixed soontm and we can finally enjoy some good space combat expanse style in ksp

Gedas-S commented 5 years ago

665 should improve on this. For now I have only tested this at a range of 7km in LKO, but the accuracy seems promising.

Gedas-S commented 5 years ago

Should be significantly improved in 1.3.0.