Mihara / RasterPropMonitor

Plugin for Kerbal Space Program. This repository is out of date and is primarily of historic interest. See https://github.com/JonnyOThan/RasterPropMonitor
http://forum.kerbalspaceprogram.com/threads/57603
Other
116 stars 68 forks source link

Offset HUD Ladder #418

Closed DeputyLOL closed 8 years ago

DeputyLOL commented 9 years ago

I know that the HUD ladder is always at the centre of the screen but is it possible to nudge it left or right?

image

I'm modelling my PFD off of a B737 NG. Problem is, I cant fit a very crucial bar in as there isn't enough space. The vertical speed bar and altitude bar are on the same side, the ladder is slightly offset to the left as the airspeed bar is the only bar on the left.

Please let me know if this is possible. (also, how are the sliding numbers for screens coming along? #365)

MOARdV commented 9 years ago

Yes, it looks like the HUD ladder could be changed to have its center point defined as a config variable. As for #365, I haven't started on it. I am slowing down my modding pace, since work has been busy and I don't want to burn out on coding during my off-work hours.

DeputyLOL commented 9 years ago

fair enough. enjoy your off-work hours.

DeputyLOL commented 9 years ago

Do you think you could add the ability to have an 'enable ladder' config like with the vertical bars?

MOARdV commented 9 years ago

Do you think you could add the ability to have an 'enable ladder' config like with the vertical bars?

So it could be switched off? Off-hand, I think that would be fairly easy to implement.

DeputyLOL commented 9 years ago

Cool, I'm start to make 'random failures' a thing in my cockpit. Every now and then a circuit breaker will pop and a certain system would be off line until you reset the braker.

DeputyLOL commented 9 years ago

I have a question about the acceleration variable. Can that only be positive or can it measure deceleration as well?

MOARdV commented 9 years ago

I have a question about the acceleration variable. Can that only be positive or can it measure deceleration as well?

Which acceleration variable? ACCEL measures current thrust over mass, so it's always positive (since thrust and mass can never be negative). EFFECTIVEACCEL is a KSP-derived value, and it measures the magnitude of a thrust vector (thus always positive).

DeputyLOL commented 9 years ago

I think I'm referring to EFFECTIVEACCEL. The problem I have with it is that it is always positive. Could we have a variable that is + when accelerating and - when decelerating?

DeputyLOL commented 9 years ago

Thank you for setting up request. I'm trying to make speed trend arrows (green arrow you see pointing up the speed display). It tells you the speed you will reach in 10 seconds with current acceleration. I can do all the equations needed, I just need the acceleration. Does that give me the ground speed acceleration or airspeed acceleration?

MOARdV commented 9 years ago

I'm trying to make speed trend arrows (green arrow you see pointing up the speed display). It tells you the speed you will reach in 10 seconds with current acceleration. I can do all the equations needed, I just need the acceleration. Does that give me the ground speed acceleration or airspeed acceleration?

Let's keep discussion of the needs of that variable with the new issue, so the discussion doesn't get lost.

DeputyLOL commented 9 years ago

ok

MOARdV commented 8 years ago

Okay, I'm finally getting this done. Sorry it took so long.

DeputyLOL commented 8 years ago

WOOOOOOOO!!!!!!!!!!!

MOARdV commented 8 years ago

Available in the current DropBox dev build, by the way.

DeputyLOL commented 8 years ago

I know, im trying it right now. Thank you!

DeputyLOL commented 8 years ago

Do you think you could add the ability to have an 'enable ladder' config like with the vertical bars?

So it could be switched off? Off-hand, I think that would be fairly easy to implement.

Did you get to the enable/disable ladder feature? :D

DeputyLOL commented 8 years ago

Doesn't work for me. I have this; horizonOffset = -400,-15 And the ladder is still in the exact same place as it was.

EDIT: never mind, didn't have most recent dev build!

DeputyLOL commented 8 years ago

The offset works but it doesn't affect the edges of the ladder. The centre of the ladder will move but the edges will not.

MOARdV commented 8 years ago

What do you mean by the edges? When I tested it, the ladder moved (the area where the ladder is, and the cropping box that contains it). The vertical strips (altitude, speed) are separate components, so they need to be moved, too. Or is it something else I missed (entirely possible, since I don't use a HUD very often).

DeputyLOL commented 8 years ago

The cropping box doesn't seem to be moving for me. I'm still testing it now.

DeputyLOL commented 8 years ago

monitor2016-05-09_16-00-30_-1549964_60

It might be a little tricky to tell (because its partly still in transition) but the ladder are not symmetrical. Ignoring the v/h bars. You see the left side of the ladder stops just before the aircraft symbol and the right one continues off the edge of the indicator. The ladder is centred but the middle of it is offset.

MOARdV commented 8 years ago

Okay. Very strange. Probably the problem I had is that I have a very simply HUD ladder to work with (the one that comes with stock RPM). Is your ladder texture available in your cockpit mod? Or can you put it somewhere I can download for testing?

DeputyLOL commented 8 years ago

it is in the cockpit mod. GameData\AdvancedCockpit\Displays\Textures\PFD_ladder.png

DeputyLOL commented 8 years ago

pfd_ladder

But i can put it here and you can copy it from here

MOARdV commented 8 years ago

I don't see the problem when I use this ladder on the stock HUD. The center of the ladder shifts over to the side with the rest of the texture. What are you using for the config values for the ladder?

DeputyLOL commented 8 years ago
        horizonTexture = AdvancedCockpit/Displays/Textures/PFD_ladder
        horizonOffset = -45,15
        use360horizon = false
        horizonSize = 299,309
        horizonTextureSize = 800,800
MOARdV commented 8 years ago

I took a look at it with your settings, and I still do not see anything unusual. The ladder is moved to the right a little ways, and I don't see anything else amiss. I double-checked, and the cropping shader is updating correctly.

DeputyLOL commented 8 years ago

seems strange. ill do more testing on my end to see if I missed something.

DeputyLOL commented 8 years ago

What do you think might be causing it?

DeputyLOL commented 8 years ago

I've just started testing. I have an idea about the cause. I have another separate monitor that doesn't have an offset ladder yet, do you think that RPM is getting the ladder centre from one monitor config and then confusing the cropping from the other monitor?

DeputyLOL commented 8 years ago

No luck. monitor2016-05-19_12-54-02_-715498_59 monitor2016-05-19_12-52-00_-715498_59

MOARdV commented 8 years ago

Oh, wait... you have more than one HUD monitor with different configurations? It might be because I set the crop bounds shader parameters once at start up, and maybe the second monitor (with no offset) is overwriting the first one's shader parameters. Let me make a change.

DeputyLOL commented 8 years ago

I'm sure you'll figure it out, let me know when you want me to test it. :D

MOARdV commented 8 years ago

Okay. I think this will do the trick.

DeputyLOL commented 8 years ago

No change sorry

DeputyLOL commented 8 years ago

I going to keep testing. I've tried putting hudOffset = 0,0 onto the displays that don't have an offset HUD, that didn't work. I've tried removing the monitor that doesn't have an offset hud from the IVA, that didn't work. I've tried removing the monitor that doesn't have an offset hud from the mod completely, that didn't work. I'm now out of ideas...

MOARdV commented 8 years ago

Can you put a ZIP of your IVA (or a simpler IVA with the appropriate MFDs) somewhere I can download? I am not seeing a problem here, so I don't know what is going on.

DeputyLOL commented 8 years ago

Dev Version: https://www.dropbox.com/s/lxs398gjlyuaws3/KSP_AdvancedCockpit_DEV001.zip?dl=0 Put the "AdvancedCockpit" folder into GameData. To avoid having to go through the startup procedure I have put in a dev switch (on overhead panel, should be labelled). This should make the plane think it has power when it doesn't. But.... its untested so I'm not sure it will work. If it doesn't I included a walkthrough to starting the plane up. I hope this helps.

There are 3 separate monitor configs with HUDs. 2 of them are identical. These can be found in AdvancedCockpit/Displays/MainInstrumentPanel/... PFD_MIP_CAP_Display PFD_MIP_FO_Display ISFD_MIP_Display

DeputyLOL commented 8 years ago

Was this fix implemented in the latest dev build?

MOARdV commented 8 years ago

I have not reproduced the problem here yet. I will try to work on it this weekend.

DeputyLOL commented 8 years ago

Thank you.

DeputyLOL commented 8 years ago

horizon offset

I've been digging deeper into this and I may have found something that should help you pin point the cause of my problem. I noticed that even though the cropbox wasn't where it should be, it didn't stay in the centre either which meant it was offset as-well. I put a screenshot of my HUD into paint and did some measuring. I also labelled on the screenshot the centre of the texture, centre of the ladder and centre of the cropbox. BUT WE MUST LOOK DEEPER! (ignore the '2069') (sorry if its difficult to see)

When the Offset HUD feature was first impletemented I noticed that something was off with the y-coordinate. I always use that 'y being positive = UP', but that's because I'm from the UK. I'm assuming that you use the 'y being positive = DOWN' as that is how everything else works. :) The exception to that is the horizonOffset. In the texture above you can see my config and the results of it.

Long story short; The y axis is reversed. The cropbox offset is half of the ladder offset and the y axis is reversed... again.

DeputyLOL commented 8 years ago

Does this help you?

MOARdV commented 8 years ago

Does this help you?

It does. I will get back to this once I get the docking / undocking problems sorted out. They have consumed all of my time this week.

DeputyLOL commented 8 years ago

nice. hope you get it sorted.

quick question. I recall you saying that the round monitor gauges would be very hard to implement. So instead of making something that functions like a round version of the vertical and horizontal bars, do you think it would be possible to control a texture using the same kind of methods that we can use for props with JSIVariableAnimator? E.g. transform, rotate, scale, maybe even colour?. The only real difference would be that it is 2D and it uses a texture rather than a prop. It would give a lot more flexibility. I don't know how hard that would be to implement.

MOARdV commented 8 years ago

A texture on the screen? That'd be new functionality (that is, we don't currently), although I am pretty sure alexustas has expressed interest in something similar as well. I suspect it wouldn't be hard to do, really..

DeputyLOL commented 8 years ago

Noice!

Alexustas commented 8 years ago

although I am pretty sure alexustas has expressed interest in something similar as well.

I'm very interested in implementing this and this requests. This functionality will cover all my needs, I'm sure ))

MOARdV commented 8 years ago

By the way, @DeputyLOL , thank you for your sleuthing on the offsets. I think this update has it fixed (no promises - this evening is a bit chaotic).

DeputyLOL commented 8 years ago

thank you, ill test it now. I'm assuming that the y-offset will have to be -15 now. You should have seen me when I started figuring it out, I felt like a detective. :D