Player icon indicating copy to clipboard operation
Player copied to clipboard

Add Scene_Settings - Config 3 of N

Open Ghabry opened this issue 3 years ago • 12 comments

This is a WIP to add a settings menu. Early feedback is welcome on the general layout and feature set this should have.

Input:

  • [x] Add input remapping for keyboard
  • [x] Add input remapping for gamepads

Audio:

  • [x] BGM Volume
  • [x] SFX Volume

Not planned:

  • [ ] Configure Midi backend to use
  • [ ] Configure Midi soundfont to use
  • [ ] Configure which system audio device to output to.
  • [ ] Number of output channels
  • [ ] Output sample rate
  • [ ] Output bit depth
  • [ ] Bit-perfect output toggle?

Video:

  • [x] Show which renderer is active and leave future support for multiple renderers
  • [x] Fullscreen
  • [ ] Screen Resolution
  • [ ] Vsync
  • [ ] Frame Limiter
  • [x] Show FPS

Access:

  • [x] Game Browser
  • [ ] Title Screen
  • [x] Menu Scene
  • [x] OpenVideoOption event command
  • [x] Add a key to open the settings menu

Persistence:

  • [x] Load settings to user config file
  • [ ] Save settings

Others:

  • [ ] Refresh UI if video options changed by key press
  • [x] Show title screen in background

Ghabry avatar Feb 18 '22 18:02 Ghabry

FYI, there is a setting menu in the yumebooru's multiplayer mode which already include some features (i.e. SFX Volume). https://github.com/CataractJustice/ynoclient/blob/master/src/game_multiplayer_settings_scene.cpp

lychees avatar Feb 18 '22 19:02 lychees

Jenkins: Test this please <3

Ghabry avatar Mar 01 '22 23:03 Ghabry

So far so good :+1: . In games without title scene, is it showing the default pixel background color? What about games skipping title scene?

Fullscreen does not toggle on Emscripten yet, likely expected (disabling it on emscripten for now might be worth).

Regarding the checklist, output channels is relative to single sample output channels? (16 unique samples, 4 exclusive same-sample channel, total up to 64) or midi poliphony? (fluidsynth default is 256) or just global output channels meaning mono (1) / stereo (2) / surround (n)?.

Additional ideas, for this or for later (config 4 of N), e.g. toggle pause on focus lost and other: Click here: https://github.com/EasyRPG/Player/labels/Settings

fdelapena avatar Mar 02 '22 01:03 fdelapena

Hey guys, silly suggestion: what about making the look of it like this: image

It's a mockup based on the game select window: image

I just saw the Yumebooru multiplayer menu and it's closer to in-game menus as in my suggestion. image

jetrotal avatar Mar 11 '22 04:03 jetrotal

I actually thought about the opposite: Moving the options from the game browser in a single top row to win more horizontal space for text (game names in the list) 😅.

Ghabry avatar Mar 11 '22 12:03 Ghabry

Aligning values to the right as in Yumebooru modification keeps the content cleaner and more readable for both keys and values. The selectable line cursor helps reading the key-value association when the separation is significant.

fdelapena avatar Mar 22 '22 04:03 fdelapena

I decided to not implement most of the planned functionality by fmatthew because this is too much work to do.

My remaining todo list:

  • [x] Proper storage location for all the stuff (emscripten needs a new mount here to ensure it is remembered on the entire domain)
  • [x] Numeric inputs should use the number input window
  • [x] Frame limiter support
  • [x] Vsync ON/OFF (Restart required)
  • [x] Audio: Global BGM & SE Volume
  • [x] Input: Swapping Primary & Secondary Analog Stick (for Lefties)
  • [x] Input: Swapping AX with BY without remapping manually (for Nintendo fans)
  • [x] Configuration option where the config scene access appears, e.g. Menu and Title screen
  • [x] Input: Reset feature (button combination) for input when it is messed up

Test implementations of features on the devices:

  • [x] SDL2
  • [x] SDL1
  • [x] Android (SDL2 but yeah...)
  • [x] emscripten (SDL2 but special ;))
  • [x] Wii (SDL)
  • [x] 3DS
  • [x] PSVita
  • [x] Switch

Ghabry avatar May 28 '22 08:05 Ghabry

Regarding the Video Options: In Windowed Mode it would be great if you could choose between all integer scalings (x1,x2,x3,x4,x5...) up to the biggest possible that fits inside the display resolution. In Fullscreen it might be enough to give the option between the biggest possible integer scaling and one that fills the (vertical) screen space completely even if that means uneven/blurred pixels. The icing on the cake would be an option for shader effects like CRT/LCD ones. But might be out of scope.

TrunXGIT avatar May 29 '22 12:05 TrunXGIT

@Ghabry How to modify global audio volume?

aleck099 avatar Sep 06 '22 14:09 aleck099

Ghabry How to modify global audio volume?

There does not seems to have currently a global audio volume, just BGM or SFX, so you have to manually edit both. Seems to be planned though.

This is a WIP to add a settings menu. Early feedback is welcome on the general layout and feature set this should have.

Was thinking, maybe adding an option to choose a translation for Easy RPG Menu and settings + translation to load if it exist for a game could be added to the menu ? (and if this is something that can't be edited while in-game exceptions for options could be added)

Mimigris avatar Sep 06 '22 18:09 Mimigris

@Mimigris I saw when playing bgm there is a volume parameter, but how can I modify its volume when the bgm is playing?

aleck099 avatar Sep 07 '22 01:09 aleck099

@Mimigris I saw when playing bgm there is a volume parameter, but how can I modify its volume when the bgm is playing?

Not sure if you are really talking here about the setting implementation planned for Easy RPG Player or just talking in terms of coding for a RPG Maker game, so: Easy RPG Player: Not currently available directly as a build, but this should be available in the settings menu of the Player. Coding in RPG Maker: You have to manually edit each song that play to edit the volume.

If all you want is making your game being less loud when playing you can still change the volume setting of the app in the Volume Mixer of your OS I guess.

Mimigris avatar Sep 07 '22 16:09 Mimigris

Well, imo this is "feature complete" now on Linux if you want to test.

Have to unbreak the build now for the other platforms and provide a config directory everywhere.

Well and the code needs cleanup & documentation at some parts :)

Ghabry avatar Oct 09 '22 21:10 Ghabry

Suggested input UI by Jetrotal:

unknown

Ghabry avatar Oct 16 '22 20:10 Ghabry

That suggestions requires always having a system2 hand-icon png.


Maybe the grayed out up text could be default input: keyboard up?


About naming the options, i would call them: Controls for the button mapping screen Command for what is the action perfomed when a button is pressed (decision, cancel, up, etc) input for the button (keyboard enter, joystick 05, touch button 01, etc)


I'd also suggest limitting the inputs quantity or testing single page per command, for cases when the inputs are all huge text chunks like the JOY_STICK_PRIMARY_UP

image

jetrotal avatar Oct 16 '22 21:10 jetrotal

Not as colorful as the suggested one but at least fits on one screen ;)

screenshot_13


Also pretty close to finishing this (finally!). Only missing is adopting certain homebrew port features to the config scene (stretch, touch ui).

Ghabry avatar Dec 05 '22 00:12 Ghabry

Was just thinking, maybe an action to reset all the keys mapped outside of the menu could be added (like an action triggered by holding several keys)? Just made an attempt by editing very dumbly my configuration on purpose and without manually resetting the game you might end up with a useless configuration. image

Mimigris avatar Dec 06 '22 22:12 Mimigris

Just found an issue while testing this too: Opening the settings menu (F1/assigned key - Open Video Options command) while the screen should be hidden will make the screen be shown to the player once said menu has been closed, while this should not be the case. Seems to be a leftover from opening the default menu.

Mimigris avatar Jan 01 '23 20:01 Mimigris

@aleck099

In this PR is a new API on the Audio interface BGM_SetGlobalVolume. This writes in the configuration so it is preserved across sessions.

Right now there is no supported way to do it.

Ghabry avatar Jan 10 '23 10:01 Ghabry

(Not commited yet)

Added a backlight control setting for the 3DS. Yes. There is already one on the touchscreen. They are kept in sync and are saved in the configuration file.

Not tested yet as citra does not emulate this (???).

a

Custom names for the keys are now implemented:

b

c

Ghabry avatar Jan 11 '23 10:01 Ghabry

@Mimigris

Thanks. Screen fade-in is resolved. Missed that edge-case :)


Added the emergency reset sequence (I wanted this option anyway. As I want to prevent the typical RetroArch situation where the Ui becomes unusable due to a button mapping error). It is activated by holding 4 arbitrary keys at once. Is displayed in the input remapping as a hint.

There are still ways to make the Player uncontrollable (by leaving the settings while the input is broken) but this is already close to idiotic user error and you can fix it by (somehow) reentering the settings and doing the reset sequence.

Ghabry avatar Jan 11 '23 15:01 Ghabry

Jenkins: Test this please

Ghabry avatar Jan 12 '23 09:01 Ghabry

First test results:

  • ~~if you swap [AB], it'll swap them then quit the menu (probably because it then consider the "new" input right after), not a major thing but a funny quirk~~
  • ~~The window size is not preserved right now (maybe add this?)~~ SDL2 only
  • ~~vsync not saved (?)~~ Likely system issue
  • ~~If you put garbage on config.ini none of the keys works~~
  • ~~submenu for key mapping should be a good idea: game, developer/test, other~~
  • ~~mouse scroll cannot be mapped~~ Postboned Problem with how mouse & touch are handled

Ghabry avatar Jan 12 '23 11:01 Ghabry

Suggested by @jetrotal . This was simple to add

screenshot_3

Ghabry avatar Jan 13 '23 23:01 Ghabry

@Ghabry That's great

aleck099 avatar Jan 15 '23 11:01 aleck099

Getting close. Just few bug fixes and platform tests missing.

Redesigned the Game Browser to ensure all menu items fit. You will get used to it.

screenshot_1

New settings category "Engine" that contains a few entries that fit nowhere else:

screenshot_2

Ghabry avatar Jan 19 '23 01:01 Ghabry

Except for checking some ports this is now feature complete and ready for review. :tada: This took over a year to finish with multiple long breaks because this was so frustrating to program.

Sorry for so many LoC changes and 50+ commits. There was no existing code in the Player to handle persistent configurations so everything had to be written from scratch.

At least further additions of config options will be much less code...

There are so many things that could still be added. Almost all the ideas about audio config are missing and game specific configurations wasn't even started.

Ghabry avatar Jan 20 '23 17:01 Ghabry

Had to retest Vita and Switch to solve some final bugs.

Only pending tests are Android and a retest on Windows

Ghabry avatar Jan 25 '23 14:01 Ghabry

Only pending tests are Android and a retest on Windows

The only issue I've found on my side while re-testing the latest version on my Windows is that the cursor while in the Settings menu part where you can remap your keys "Input -> Key/Button mapping" and then Game / Engine / Developer is not properly tracked like the other menus (If your cursor is on the 22th item in the Engine part, when opening the Developer part your cursor will also be on the 22th slot although it is not possible normally). screenshot_1 screenshot_0

Mimigris avatar Jan 25 '23 18:01 Mimigris

Also finished Android now.

@Mimigris your reported bug should be resolved


I'm done with this. Please test and review.

As this is a large PR: 2 weeks

Screenshot_2023-01-27-02-51-44-181_org easyrpg player

Screenshot_2023-01-27-02-51-51-677_org easyrpg player

Ghabry avatar Jan 27 '23 01:01 Ghabry