Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lead asisst aimer for fixed guns are broken #75

Closed
ghost opened this issue Nov 3, 2016 · 18 comments
Closed

Lead asisst aimer for fixed guns are broken #75

ghost opened this issue Nov 3, 2016 · 18 comments

Comments

@ghost
Copy link

ghost commented Nov 3, 2016

Since the fix @gomker made worked, the thread is now closed.

@SpannerMonkey
Copy link

Confirmed. Associated log error
[EXC 23:26:53.262] NullReferenceException: Object reference not set to an instance of an object BahaTurret.BDGUIUtils.DrawTextureOnWorldPos (Vector3 worldPos, UnityEngine.Texture texture, Vector2 size, Single wobble)

@gomker
Copy link
Collaborator

gomker commented Nov 5, 2016

I can get the leading indicator to display by using Radar Lock and Ground turret with "Slaved" turrets enabled.
Reviewing logic around aim prediction here https://github.com/PapaJoesSoup/BDArmory/blob/master/BahaTurret/ModuleWeapon.cs#L1899

@ghost
Copy link
Author

ghost commented Nov 5, 2016

@gomker I'm talking about fixed guns like the hidden vuclan or .50 cal browning machine gun.
Also I noticed the other day that the lead indicator display with the Slaved Turrets looked... different. The line that was from the circle to the diamond didn't show up.

@SpannerMonkey Alright, thanks for the info.

@gomker
Copy link
Collaborator

gomker commented Nov 5, 2016

The notes are more for us to back track the issue in code. It's not very clear how this is triggered for fixed weapons and having a case in which we can make it work will allow us to get there faster.

@gomker
Copy link
Collaborator

gomker commented Nov 5, 2016

@MuricanJeb Just thought of something , since I had not used this feature much , can you tell me how it usually displayed, did it require a radar lock? If so was "slaved turret" enabled?
The AI does not seem to have an issue so target leading is getting triggered there.

@ghost
Copy link
Author

ghost commented Nov 5, 2016

@gomker Yes, it required a Radar Lock and Slave Turrets was enabled. I think the reason the AI is good at it is because heavily accurate.

@gomker
Copy link
Collaborator

gomker commented Nov 5, 2016

@jrodrigv
Not sure what this Krakensbane check is accomplishing
https://github.com/PapaJoesSoup/BDArmory/blob/master/BahaTurret/ModuleWeapon.cs#L1879

I can say during debug the difference in when the leading aimer "greenDotTexture" is not drawn as this check fails.

The Krakensbane.SqrThreshold = 25 and the velocity is usually a number like 13000f for a say for a plane going 120 m/s over surface.

@gomker
Copy link
Collaborator

gomker commented Nov 5, 2016

Update, taking out the Kranensbane check fixes the issue and I do not see any ill effects so far. From what I understand Krakensbane checks are about accounting for floating point errors and vessel velocities, not sure why we need it in the code that triggers aimer drawing.

@jrodrigv
Copy link
Collaborator

jrodrigv commented Nov 5, 2016

Nice one. I didn't know what was the Kranensbane check. I will test this solution

@ghost
Copy link
Author

ghost commented Nov 5, 2016

Alright, thanks for helping guys!

@jrodrigv
Copy link
Collaborator

jrodrigv commented Nov 5, 2016

@MuricanJeb Can you try this debug version of BDArmory https://1drv.ms/u/s!AixZLrjtqp-RgqcF97cp8mC2Oqg8CA ?

I will wait for your feedback. I have tried the fix suggested by @gomker

@gomker
Copy link
Collaborator

gomker commented Nov 5, 2016

@jrodrigv I have not been able to find anything recent on this, api is very thin and wiki is way out of date , apparently it was implemented in early pre 1.x releases

http://forum.kerbalspaceprogram.com/index.php?/topic/76772-more-object-nesting-in-active-scenes-object-consolidation-and-krakensbane/&do=findComment&comment=1239491

It's the technique used to tame the deep space Kraken. Before it was implemented, all coordinates in KSP were given in reference from the body a ship was orbiting; this was sufficient when tooling around in Kerbin's SOI but when orbiting Kerbol there wasn't enough precision in such long distances, so parts would flutter and the ship would shake apart.

The krakensbane solution was to make the ship the origin of the coordinate system, so the distances to the parts of the ship had sufficient precision, even in deep space, to avoid kraken effects. The tradeoff is that the orbital calculations become more difficult to implement and debug (the center of the SOI is the simplest origin, calculation-wise).

https://kerbalspaceprogram.com/api/class_krakensbane.html

http://wiki.kerbalspaceprogram.com/wiki/API:Krakensbane

I can see this being relevant in certain situations

@gomker
Copy link
Collaborator

gomker commented Nov 6, 2016

Issue #77 is corrected by this fix as well in my tests.

@ghost
Copy link
Author

ghost commented Nov 6, 2016

@jrodrigv Sorry for late reply, I didn't get the notifaction. But yes, I will test it right now.

@ghost
Copy link
Author

ghost commented Nov 6, 2016

I am proud to annoce that @gomker s fix worked.

Since the problem is solved, I will now close this.

@ghost ghost closed this as completed Nov 6, 2016
@ghost ghost changed the title Lead asisst aimer for fixed guns are broken Fixed and now closed Nov 6, 2016
jrodrigv added a commit that referenced this issue Nov 6, 2016
closes issue #75
@TangentFoxy
Copy link

(You really shouldn't change the title of an issue just because it was fixed. That ruins trying to search for it later. Just saying...)

@gomker gomker changed the title Fixed and now closed Lead asisst aimer for fixed guns are broken Nov 10, 2016
@gomker
Copy link
Collaborator

gomker commented Nov 10, 2016

@MuricanJeb Yeah, I switched back the title. We cross reference the git commits and pull requests notes for comprehensive change log docs. Github keeps track of it all and it makes for a nice view when checking history of changes, Visual studio even integrates them. I can see who made the changes, when and why.

@ghost
Copy link
Author

ghost commented Nov 10, 2016

Alright then.

Now all problems are taken care of here now.

illectro pushed a commit to illectro/BDArmory that referenced this issue Oct 14, 2020
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants