Reverse up-down control when looking astern?

An area for discussing new ideas and additions to Oolite.

Moderators: winston, another_commander

cag
Deadly
Deadly
Posts: 202
Joined: Fri Mar 17, 2017 1:49 am

Re: Reverse up-down control when looking astern?

Post by cag »

hoqllnq wrote: Sun Oct 22, 2017 10:25 pm
I don't think you can remap what controls do on the fly.
No but it would open up some possibilities. But for this, all I need is to dectect them. I suppose I could monitor the delta V in each axis frame to frame to infer it ...
hoqllnq wrote: Sun Oct 22, 2017 10:25 pm
Now, if ship.pitch and ship.roll were writable, then you could flip the motion on view change (i.e. ps.roll = -ps.roll; for aft view, ps.roll = ps.pitch; for left, ps.roll = -ps.pitch; for right, etc.. ) so that the combined effect would be that the ship keeps rotating in the same direction, but they aren't, according to the wiki.
They're not writable, I just tried - it would simplify things immensely. But as you saw, he's inverting the angular motion each frame, so it's doable, except for the previous point. I'll let this roll around my attic for a while and see if I get hit w/ an 'ahaa!' moment.
"Better to be thought a fool, boy, than to open your trap and remove all doubt." - Grandma [over time, just "Shut your trap... fool"]
"The only stupid questions are the ones you fail to ask." - Dad
How do I...? Nevermind.
User avatar
hoqllnq
Commodore
Commodore
Posts: 154
Joined: Sun Jan 08, 2006 7:32 pm

Re: Reverse up-down control when looking astern?

Post by hoqllnq »

Diziet Sma wrote: Mon Oct 23, 2017 6:05 am
You can always submit a request that they be made writable..
This is in todays nightly.
cag
Deadly
Deadly
Posts: 202
Joined: Fri Mar 17, 2017 1:49 am

Re: Reverse up-down control when looking astern?

Post by cag »

hoqllnq wrote: Sun Oct 22, 2017 1:03 pm
There is something about the reverse control thing that doesn't feel right..
(I play on keyboard. I guess this is not really an issue when using a joystick?)

When you dive/climb or rotate (diving/climbing is really also rotating) and then let go of the keys, you don't stop rotating immediately.
This is actually a good thing. It would be horrible if it would. It is really 'control damping' but it _feels_ like momentum.

If you switch view while the controls are still on their way back to neutral, you immediately and abruptly start rotating in the opposite direction.
Now I guess this is technically correct, since it is control damping and not momentum, but it feels unnatural. It feels like it is reverse physics instead of reverse control.
If you want 'horrible', try holding down a key and press its opposite one. :shock: Same thing if you immediately switch to the opposite direction: no momentum.

The game treats joysticks differently than keyboard controls; the time it takes you to physically move the stick from one limit to the other gives it time to slow down and move in the opposite direction. For keyboards, it just sets your rate to zero!

Also, the damping times differ. If you let go of the stick when it's at max, it takes about 0.5 sec to stop - this time is equal for all axes. But on a keyboard, the damping time is about 1 sec for pitch & yaw and 2 sec for roll (actually, it's whatever your ship.max<Axis> value is). So the 'reverse physics' is more apparent.

I've added a new component, inertia, which I think is what you're looking for. Give it a try and let me know what you think.

https://www.dropbox.com/s/4609bj3d2btwz ... l.oxz?dl=0

You can toggle both reverse control & inertia using 'Config for AddOns' on the F4 screen. They operate independently, so there are 4 possible configurations.

The inertia feature is meant for keyboard controls and (probably ...) won't affect joysticks, so those players should probably turn if off (for a tiny performance gain).
hoqllnq wrote: Sun Oct 22, 2017 10:25 pm
I don't think you can remap what controls do on the fly. When I look left or right, my roll controls make the ship pitch, but they still move the roll indicator in the same direction. That is what you would really want: Have the same key/control move the pitch/roll indicators in the opposite direction, or have the same control move the other indicator.
I've never done any work on a HUD. Does anyone know if the pitch/roll indicators are HUD specific? It would be nice if they reflected the change in controls but it's not something I'd want to invest a lot of time in.
"Better to be thought a fool, boy, than to open your trap and remove all doubt." - Grandma [over time, just "Shut your trap... fool"]
"The only stupid questions are the ones you fail to ask." - Dad
How do I...? Nevermind.
User avatar
Norby
---- E L I T E ----
---- E L I T E ----
Posts: 2577
Joined: Mon May 20, 2013 9:53 pm
Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
Contact:

Re: Reverse up-down control when looking astern?

Post by Norby »

Inertia is working well so I uploaded it as ReverseControl v1.7. Thank you cag!
Algernon
Mostly Harmless
Mostly Harmless
Posts: 2
Joined: Tue Jul 17, 2018 7:49 pm

Re: Reverse up-down control when looking astern?

Post by Algernon »

I just updated from V1.6 to V1.7 and it no longer works: pitch is not reversed and left and right roll controls both cause roll in the same direction in aft view (Oolite V1.86)
User avatar
Norby
---- E L I T E ----
---- E L I T E ----
Posts: 2577
Joined: Mon May 20, 2013 9:53 pm
Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
Contact:

Re: Reverse up-down control when looking astern?

Post by Norby »

Welcome Algernon!

I tested in trunk (aka Oolite 1.87) where it is working well, but now I checked in 1.86 where I got the same problems as you.

So now I uploaded ReverseControl_1.6.oxz also and renamed v1.7 to "Reverse control with inertia".

If you want the new inertia feature then you must use trunk version of Oolite, otherwise please remove the v1.7 then install back the v1.6 in the manager.
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4830
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Reverse up-down control when looking astern?

Post by phkb »

Welcome to the boards, Algernon.

(Irrelevant side note) Whenever I see the name "Algernon" I'm always reminded of "Biggles", who had a side-kick with that name. :D
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16081
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: Reverse up-down control when looking astern?

Post by Cody »

phkb wrote: Tue Jul 17, 2018 9:57 pm
Whenever I see the name "Algernon" I'm always reminded of "Biggles", who had a side-kick with that name.
With me, it's Algernon Blackwood, author of many a ghostly tale.
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
User avatar
Disembodied
Jedi Spam Assassin
Jedi Spam Assassin
Posts: 6885
Joined: Thu Jul 12, 2007 10:54 pm
Location: Carter's Snort

Re: Reverse up-down control when looking astern?

Post by Disembodied »

For me, it's the mouse with enhanced intelligence from Daniel Keyes' "Flowers for Algernon". It's a name with a fine literary pedigree!
cag
Deadly
Deadly
Posts: 202
Joined: Fri Mar 17, 2017 1:49 am

Re: Reverse up-down control when looking astern?

Post by cag »

I've updated it to be version aware (d'Oh)

IF it checks out, you won't have to continue with 2 versions ...

https://www.dropbox.com/s/4609bj3d2btwz ... l.oxz?dl=0
"Better to be thought a fool, boy, than to open your trap and remove all doubt." - Grandma [over time, just "Shut your trap... fool"]
"The only stupid questions are the ones you fail to ask." - Dad
How do I...? Nevermind.
User avatar
Norby
---- E L I T E ----
---- E L I T E ----
Posts: 2577
Joined: Mon May 20, 2013 9:53 pm
Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
Contact:

Re: Reverse up-down control when looking astern?

Post by Norby »

Thank you cag, now the fixed Reverse control with inertia v1.8 is available.
Algernon
Mostly Harmless
Mostly Harmless
Posts: 2
Joined: Tue Jul 17, 2018 7:49 pm

Re: Reverse up-down control when looking astern?

Post by Algernon »

Thanks for the responses. How about Algernon Moncrieff?
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16081
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: Reverse up-down control when looking astern?

Post by Cody »

<grins> As Big D said, it's a name with a fine literary pedigree.
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
User avatar
Milo
---- E L I T E ----
---- E L I T E ----
Posts: 462
Joined: Mon Sep 17, 2018 5:01 pm

Re: Reverse up-down control when looking astern?

Post by Milo »

I saw the following error in my log (didn't notice anything in-game though):

Code: Select all

00:09:50.100 [script.javaScript.timeLimit] OperationCallback: ***** ERROR: Script "(nil)" ran for 0.18923 seconds and has been terminated.
00:09:50.100 [script.javaScript.stackTrace] OOJSDumpStack:  0 (reversecontrol.js:468) ReverseControl_FCB()
00:09:50.100 [script.javaScript.stackTrace] DumpVariable:     this: [Script "reversecontrol" version 1.8]
00:09:50.100 [script.javaScript.stackTrace] DumpVariable:     delta: 0.014999985694885254
00:09:50.100 [script.javaScript.stackTrace] DumpVariable:     view: "VIEW_FORWARD"
00:09:50.100 [script.javaScript.stackTrace] DumpVariable:     abs_yaw: 0
00:09:50.100 [script.javaScript.stackTrace] DumpVariable:     yaw: 0
00:09:50.100 [script.javaScript.stackTrace] DumpVariable:     abs_roll: 0
00:09:50.100 [script.javaScript.stackTrace] DumpVariable:     roll: 0
00:09:50.100 [script.javaScript.stackTrace] DumpVariable:     origRoll: 0
00:09:50.100 [script.javaScript.stackTrace] DumpVariable:     abs_pitch: 0
00:09:50.100 [script.javaScript.stackTrace] DumpVariable:     pitch: 0
00:09:50.101 [script.javaScript.stackTrace] DumpVariable:     origPitch: 0
00:09:50.101 [script.javaScript.stackTrace] DumpVariable:     ps: [PlayerShip "Cobra Mark IV" position: (287649, 1.18653e+006, -414659) scanClass: CLASS_PLAYER status: STATUS_IN_FLIGHT]
00:09:50.101 [script.javaScript.stackTrace] DumpVariable:     angle: undefined
00:09:50.101 [script.javaScript.stackTrace] DumpVariable:     YAW: 4
00:09:50.101 [script.javaScript.stackTrace] DumpVariable:     ROLL: 2
00:09:50.101 [script.javaScript.stackTrace] DumpVariable:     PITCH: 1
00:09:50.101 [script.javaScript.stackTrace] DumpVariable:     checkReversal: function checkReversal
00:09:50.101 [script.javaScript.stackTrace] DumpVariable:     copy_quaternion: function copy_quaternion
00:09:50.101 [script.javaScript.stackTrace] DumpVariable:     copy_vector: function copy_vector
00:09:50.101 [script.javaScript.stackTrace] DumpVariable:     rpRatio: 2.0081967437136314
00:09:50.101 [script.javaScript.stackTrace] DumpVariable:     axesWritable: true
00:09:50.101 [script.javaScript.stackTrace] DumpVariable:     lastView: "VIEW_FORWARD"
00:09:50.101 [script.javaScript.stackTrace] DumpVariable:     sumDelta: 1.0149999856948853
00:09:50.101 [script.javaScript.stackTrace] DumpVariable:     isInertial: 0
00:09:50.101 [script.javaScript.stackTrace] DumpVariable:     prevYaw: 0
00:09:50.101 [script.javaScript.stackTrace] DumpVariable:     prevRoll: 0
00:09:50.101 [script.javaScript.stackTrace] DumpVariable:     prevPitch: 0
00:09:50.101 [script.javaScript.stackTrace] DumpVariable:     prevVU: [0.46794453263282776, 0.36714208126068115, 0.8038873672485352]
00:09:50.101 [script.javaScript.stackTrace] DumpVariable:     prevVF: [-0.1874556690454483, -0.8476912975311279, 0.49626609683036804]
00:09:50.101 [script.javaScript.stackTrace] DumpVariable:     prevVR: [0.8636482357978821, -0.38291826844215393, -0.3278495669364929]
00:09:50.101 [script.javaScript.stackTrace] DumpVariable:     step2: [0.8193418435501651, -0.5091986825819536, -0.040944871499295335, 0.2602294001105862]
00:09:50.101 [script.javaScript.stackTrace] DumpVariable:     step1: [0.4371389256409305, -0.1947440559293936, -0.15338736071493347, -0.8645557598104007]
00:09:50.101 [script.javaScript.stackTrace] DumpVariable:     orient: [0.8256902098655701, -0.5000600218772888, -0.04250803589820862, 0.2576216757297516]
00:09:50.101 [script.javaScript.stackTrace] DumpVariable:     inertiaOn: true
00:09:50.101 [script.javaScript.stackTrace] DumpVariable:     revCtrlOn: true
00:09:50.101 [script.javaScript.stackTrace] DumpVariable:     nearZero: 0.000001
00:09:50.101 [script.javaScript.stackTrace] DumpVariable:     _inInertialMotion: function _inInertialMotion
00:09:50.101 [script.javaScript.stackTrace] DumpVariable:     _rotate_about_axis: function _rotate_about_axis
00:09:50.101 [script.javaScript.stackTrace] DumpVariable:     wr: [Script "reversecontrol" version 1.8]
00:09:50.101 [script.javaScript.stackTrace] DumpVariable:     that: function ReverseControl_FCB
cag
Deadly
Deadly
Posts: 202
Joined: Fri Mar 17, 2017 1:49 am

Re: Reverse up-down control when looking astern?

Post by cag »

Milo wrote: Wed Jul 01, 2020 5:11 am
I saw the following error in my log (didn't notice anything in-game though):

Code: Select all

00:09:50.100 [script.javaScript.timeLimit] OperationCallback: ***** ERROR: Script "(nil)" ran for 0.18923 seconds and has been terminated.
00:09:50.100 [script.javaScript.stackTrace] OOJSDumpStack:  0 (reversecontrol.js:468) ReverseControl_FCB()
00:09:50.100 [script.javaScript.stackTrace] DumpVariable:     this: [Script "reversecontrol" version 1.8]
...
Are you able to reproduce this?
If so, would you consider setting

Code: Select all

script.javaScript.timeLimit.debug = yes;
in \Oolite\oolite.app\Resources\Config\logcontrol.plist (line 302) and send me a link to download your Latest.log?
If not, well, any bug you cannot reproduce doesn't really exist! :D
"Better to be thought a fool, boy, than to open your trap and remove all doubt." - Grandma [over time, just "Shut your trap... fool"]
"The only stupid questions are the ones you fail to ask." - Dad
How do I...? Nevermind.
Post Reply