Ideas from trying out 4.1.1.0, slow motion button, vsysnc, descriptions, etc...

Got a cool idea that should be in R'n'D? Let's hear it!

Moderators: Zomis, Flumminator

Post Reply
BryanFRitt
Posts: 47
Joined: Mon Nov 13, 2017 4:16 pm

Ideas from trying out 4.1.1.0, slow motion button, vsysnc, descriptions, etc...

Post by BryanFRitt » Mon Nov 05, 2018 3:06 am

In versions <= 4.1.0.0. 'keyboard button 3' could be used as a slow motion toggle. (confusing to use this way, but it worked) This may have been a software fluke since 'keyboard button 3' in the setup is set to pause/unpause tape.
SETUP -> KEY SHORTCUTS -> TAPE BUTTONS -> PAUSE / UNPAUSE TAPE
It'd be nice to be able to set up an intentional slow motion button like this keyboard button 3 used to do, as well as other keyboard shortcuts to control the speed without having to go through the menu system.
-
SETUP -> GAME & MENU -> GAME SPEED/EXTENDED SPEED...
The order of these two should be reversed? EXTENDED SPEED then GAME SPEED, or better just have one GAME SPEED menu with everything in it.
-
It's weird that VSYNC MODE is in a different menu than the speed.
SETUP -> GRAPHICS -> VERTICAL SYNC (VSYNC) vs
SETUP -> GAME & MENU -> GAME SPEED/EXTENDED SPEED...
-
Not every monitor has 60Hz as it's VSync spot. (some have 60, 75, 85, 100, 120, 144, ...)
Just because a game is getting the same frame rate as the display Hz doesn't mean it's VSYNC, and just because a game is going at a different frame rate doesn't mean it's not VSYNC. Although, most of the time when VSYNC is used, frame rate should at least be the same. <-- look this up for a more technically accurate/detailed description.
Instead of FPS this is more like FPS Max, as not every system can get this high of frame rate at all times.

[ Note: I'm not saying vsync did or did not work in 4.1.1.0 here, just that the menu makes it looks like look like some assumptions were made that may not be true in all cases, even if assumptions were or were not made. ]

filbo
Posts: 312
Joined: Fri Jun 20, 2014 10:06 am

Re: Ideas from trying out 4.1.1.0, slow motion button, vsysnc, descriptions, etc...

Post by filbo » Mon Nov 05, 2018 5:44 am

Not sure if this is what you're talking about, but try ctrl-3 or alt-3 for slow mode. ctrl- or alt- any digit should select one of a bunch of speeds, up to ctrl-9 which is 'as fast as the hardware will manage'...

filbo
Posts: 312
Joined: Fri Jun 20, 2014 10:06 am

Re: Ideas from trying out 4.1.1.0, slow motion button, vsysnc, descriptions, etc...

Post by filbo » Mon Nov 05, 2018 5:55 am

Hmmm, now I am very confused.

I have my own personal setup, which I've recommended here a couple of times, including Holger having at one point sounded like he might implement them as standard shipping game config. But AFAIK that never actually happened.

My setup is basically 0-5 = tape buttons 0..5. So:

Setup > Key shortcuts > Tape buttons:

0 = Eject tape
1 = Warp / Single step
2 = Stop tape
3 = Pause / unpause tape
4 = Record tape
5 = Play tape

Meanwhile, 'modifier+digit' means select digit'th choice out of a table of speeds where '1' is very slow and '9' is fast as possible.

And these had been working until ... well, not sure when, but some recent version.

Now, in 4.1.1.0, I'm experiencing weird cross-behavior:

ctrl-1, 2, 6, 7, 8, 9 always seem to select one of the speed choices. (Hitting one of them twice puts you back to 'normal' speed, I believe whatever you configured in Setup > Game & Menu > Game speed.)

But ctrl-2, 3, 4, 5 seem different. 2, 4 and 5 sometimes do the speeds, and sometimes the tape functions, and function 4 'Record tape' seems to behave differently (stop current game, start recording a new one). And ctrl-3 seems to *always* do its tape function (pause/unpause), *never* a speed toggle.

The unmodified digits 0..5 continue to do what I set them up to do.

User avatar
Holger
Site Admin
Posts: 2981
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: Ideas from trying out 4.1.1.0, slow motion button, vsysnc, descriptions, etc...

Post by Holger » Thu Nov 08, 2018 8:44 am

In versions <= 4.1.0.0. 'keyboard button 3' could be used as a slow motion toggle.
Hmm, this should only work when the program was compiled with DEBUG defined in the Makefile (which is usually not the case with release versions). So either there is a bug in my packaging script, or you have used one of the compiled development versions for Windows...
This may have been a software fluke since 'keyboard button 3' in the setup is set to pause/unpause tape.
But only if you have defined it that way in the setup menu -- by default, this keyboard shortcut should be undefined.

So, if both this assignment was made in the setup menu, and the program runs in DEBUG mode, there might be unexpected behaviour when pressing the "3" key, yes.
It'd be nice to be able to set up an intentional slow motion button like this keyboard button 3 used to do, as well as other keyboard shortcuts to control the speed without having to go through the menu system.
This can be done with the following "internal" debug key settings:

Code: Select all

debug.frame_delay_0:                    20
debug.frame_delay_1:                    500
debug.frame_delay_2:                    250
debug.frame_delay_3:                    125
debug.frame_delay_4:                    60
debug.frame_delay_5:                    40
debug.frame_delay_6:                    30
debug.frame_delay_7:                    10
debug.frame_delay_8:                    5
debug.frame_delay_9:                    0
debug.key.frame_delay_0:                XK_0                # 0
debug.key.frame_delay_1:                XK_1                # 1
debug.key.frame_delay_2:                XK_2                # 2
debug.key.frame_delay_3:                XK_3                # 3
debug.key.frame_delay_4:                XK_4                # 4
debug.key.frame_delay_5:                XK_5                # 5
debug.key.frame_delay_6:                XK_6                # 6
debug.key.frame_delay_7:                XK_7                # 7
debug.key.frame_delay_8:                XK_8                # 8
debug.key.frame_delay_9:                XK_9                # 9
debug.frame_delay.use_mod_key:          false
debug.frame_delay.game_only:            true
debug.show_frames_per_second:           false
The first ten define the desired frame delay (20 is default speed), the next ten define the button to toggle that debug speed, "debug.frame_delay.use_mod_key" defines if any modifier key (Ctrl, Alt, ...) is required for this key, "debug.frame_delay.game_only" sets if this speed toggle is only used while playing, and "debug.show_frames_per_second" shows FPS on the screen.

Again, this all only works if compiled with DEBUG symbol defined. (Probably I should change this to enable it also when started with "--debug".)

User avatar
Holger
Site Admin
Posts: 2981
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: Ideas from trying out 4.1.1.0, slow motion button, vsysnc, descriptions, etc...

Post by Holger » Thu Nov 08, 2018 8:46 am

ctrl-1, 2, 6, 7, 8, 9 always seem to select one of the speed choices. (Hitting one of them twice puts you back to 'normal' speed, I believe whatever you configured in Setup > Game & Menu > Game speed.)

But ctrl-2, 3, 4, 5 seem different. 2, 4 and 5 sometimes do the speeds, and sometimes the tape functions, and function 4 'Record tape' seems to behave differently (stop current game, start recording a new one). And ctrl-3 seems to *always* do its tape function (pause/unpause), *never* a speed toggle.
Very strange, cannot remember any change that could have caused this.

Could you please check if this still worked fine when using the previous version? (Or, which was the last version without such problems, and which was the first version where you encountered this?)

User avatar
Holger
Site Admin
Posts: 2981
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: Ideas from trying out 4.1.1.0, slow motion button, vsysnc, descriptions, etc...

Post by Holger » Thu Nov 08, 2018 9:33 am

SETUP -> GAME & MENU -> GAME SPEED/EXTENDED SPEED...
The order of these two should be reversed? EXTENDED SPEED then GAME SPEED, or better just have one GAME SPEED menu with everything in it.
The intended order is "normal settings first, advanced settings following after it".

The reason for being able to choose between a "simple speed menu" and an "extended speed menu" is (a) to have a "simple" speed menu by default for those who don't know/care about things like FPS, debugging speeds or things like special speed values for vsync etc. and (b) to be able to deactivate it completely for game packages like "Mirror Magic" where it does not make no sense anyway.
It's weird that VSYNC MODE is in a different menu than the speed.
SETUP -> GRAPHICS -> VERTICAL SYNC (VSYNC) vs
SETUP -> GAME & MENU -> GAME SPEED/EXTENDED SPEED...
Hm, not sure about this one.

Vsync should not have much to do with game speed, but with the screen redrawing/refreshing technique, so I think it belongs to the "graphics settings", but not the "game settings". (That's why the corresponding setting from the other sub-menu is automatically set according to what you selected in the other sub-menu, so it's always consistent. The problem here is that most displays won't use vsync correctly when running the game with default frame refresh rate of 50 Hz)

But yes, maybe it can be a little bit confusing to see "vsync" in both sub-menus.
Not every monitor has 60Hz as it's VSync spot. (some have 60, 75, 85, 100, 120, 144, ...)
Just because a game is getting the same frame rate as the display Hz doesn't mean it's VSYNC, and just because a game is going at a different frame rate doesn't mean it's not VSYNC. Although, most of the time when VSYNC is used, frame rate should at least be the same. <-- look this up for a more technically accurate/detailed description.
Instead of FPS this is more like FPS Max, as not every system can get this high of frame rate at all times.

[ Note: I'm not saying vsync did or did not work in 4.1.1.0 here, just that the menu makes it looks like look like some assumptions were made that may not be true in all cases, even if assumptions were or were not made. ]
That's correct.

The problem with Vsync and R'n'D is that R'n'D does not work like most modern games using a physics engine. With those, you can just enable Vysnc (whatever refresh rate it may use on your graphics card and monitor), get the current time for the frame after screen refresh is done and calculate your physics for the next frame accordingly (which means that objects on your playfield might move in smaller or larger steps, depending on your Vsync refresh rate). However, R'n'D uses a game engine with a fixed frame rate (of usual 50 Hz), meaning that different screen refresh rates will cause the game to run slower or faster. Therefore, if you use Vsync, the screen refresh rate will be set to a certain value (which may usually be 60 Hz, but can also, as you mentioned, some other, usually higher, value), and R'n'D's frame rate will follow accordingly, making the game run faster or slower than it is usually the case.

Running R'n'D with correct speed and using Vsync would require something like G-Sync or Freesync, which, as far as I know, is currently not supported by the SDL library. Therefore, the game engine speed of R'n'D should not be lower than your system's Vsync speed, or your effective game speed will be much lower because of just missing the next frame, having to wait another full frame before the screen is updated again.

On the other hand, it may be possible that Vysnc just does not work on your system (regardless of what SDL is telling you), so just choosing maximum speed would indeed result in maximum game speed, which is probably not intended, while it would run with Vysnc speed on systems that support it (this happened on my Linux system (natively) and Windows virtual machine (running on Linux), which both do not support Vsync).

On the other hand, if your system would have a Vsync refresh rate of, say, 144 Hz, the game would run three times as fast as it should, which is probably not what you want, so it might be required to adjust this in your system's graphics settings for use with R'n'D anyway. (If you can set it to 50 Hz, it would be perfect, but I think most modern monitors require at least (or exactly) 60 Hz.)

So I'm not sure here what would be the best strategy for setting game speed when enabling Vsync... :-/

User avatar
Holger
Site Admin
Posts: 2981
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: Ideas from trying out 4.1.1.0, slow motion button, vsysnc, descriptions, etc...

Post by Holger » Sat Nov 17, 2018 10:08 am

Again, this one, which I was now able to reproduce:
ctrl-1, 2, 6, 7, 8, 9 always seem to select one of the speed choices. (Hitting one of them twice puts you back to 'normal' speed, I believe whatever you configured in Setup > Game & Menu > Game speed.)

But ctrl-2, 3, 4, 5 seem different. 2, 4 and 5 sometimes do the speeds, and sometimes the tape functions, and function 4 'Record tape' seems to behave differently (stop current game, start recording a new one). And ctrl-3 seems to *always* do its tape function (pause/unpause), *never* a speed toggle.
I've had a closer look at the code responsible for doing key shortcuts for tape control and for debugging speed control, and I have no idea how or why it apparently worked without problems for you before. It had the general problem of handling both tape control and speed debug keys, with the expectable results if those definitions overlap (like "Ctrl-3" and "3").

I've changed it as follows:

* debug keys for speed change have precedence over tape control (and other) keys
* if any valid debug key was detected and handled, this key is not processed again

This should fix that issue!

filbo
Posts: 312
Joined: Fri Jun 20, 2014 10:06 am

Re: Ideas from trying out 4.1.1.0, slow motion button, vsysnc, descriptions, etc...

Post by filbo » Mon Nov 19, 2018 10:50 am

I'm pretty sure I've poked at all the speeds from time to time -- but by far my most common speeds are:

(default) for normal play, which I believe is the 'fast' setting in the options menu;
ctrl-7 for 'this is easy'
ctrl-8 for 'man this level has a lot of long boring corridors'
ctrl-9 for 'that amoeba is configured to grow too damn slowly' or 'let's see whether the amoeba or the spaceships / bugs win after the end of the level'

... so if ctrl-[2..5] do something wrong, I might not have noticed for months or years.

I'm sure I did try all of them back when I first played with the debug speed keys (2-3y ago). It might have been before I defined my tape keys.

...

How I'd like it to work is,

My tape keys, which are [0..5], should activate only un-modified. '0' not 'ctrl-0' or any other combination.

The debug speed keys should activate only modified (with any modifier, I think is how they're defined).

User avatar
Holger
Site Admin
Posts: 2981
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: Ideas from trying out 4.1.1.0, slow motion button, vsysnc, descriptions, etc...

Post by Holger » Mon Nov 19, 2018 3:52 pm

Yes, that's how it should work now.

(At least with your tape and debug key definitions. Most key shortcuts don't care if they are pressed together with a modifier key at the moment, so if you have number keys defined for the tape recorder and debug keys disabled, they would also trigger with modifier keys held down.)

BryanFRitt
Posts: 47
Joined: Mon Nov 13, 2017 4:16 pm

Re: Ideas from trying out 4.1.1.0, slow motion button, vsysnc, descriptions, etc...

Post by BryanFRitt » Wed Dec 19, 2018 7:45 am

SETUP -> GAME & MENU -> GAME SPEED/EXTENDED SPEED...
The order of these two should be reversed? EXTENDED SPEED then GAME SPEED, or better just have one GAME SPEED menu with everything in it.
The intended order is "normal settings first, advanced settings following after it".
English reads left to right, top to bottom. This reverses the normal top to bottom reading level. It doesn't make much since to set the 'GAME SPEED' before the setting that controls what the 'GAME SPEED' options are, Also, if there's enough space in the 'EXTENDED LIST', the non-extended labels could be added. 'VERY SLOW', 'SLOW', 'NORMAL', 'FAST', 'VERY FAST'.
In versions <= 4.1.0.0. 'keyboard button 3' could be used as a slow motion toggle.
Hmm, this should only work when the program was compiled with DEBUG defined in the Makefile (which is usually not the case with release versions). So either there is a bug in my packaging script, or you have used one of the compiled development versions for Windows...
I'm using Linux instead of Windows. Anyway, compiling again with `make --debug` got the slow motion back. I don't remember compiling with 'make --debug' last time, but it's possible I did that, I don't remember. There could be some GUI to enable this without recompiling. Perhaps all the speed controlling options like this and vsync could be put together in a new menu and other GUI options in another?
(I'll switch to using the newer 4.1.1.0 version now that the speed control shortcuts are back)

So these debug shortcuts were overriding the tape shortcuts set for the tape, '3' was just one of the slower ones when compiled like this, instead of '3' being a weird pause acting as a slow motion.

How can the tape shortcuts be deleted?
Main menu > SETUP > KEY SHORTCUTS > TAPE BUTTONS > ...

Post Reply