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

Add Scene_Settings - Config 3 of N #2730

Merged
merged 61 commits into from
Feb 24, 2023
Merged

Add Scene_Settings - Config 3 of N #2730

merged 61 commits into from
Feb 24, 2023

Conversation

Ghabry
Copy link
Member

@Ghabry Ghabry commented Feb 18, 2022

Fix #666
Fix #713
Fix #794
Fix #1134
Fix #1891
Fix #2721
Fix #2843
Fix #2844
Fix #2883


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

Input:

  • Add input remapping for keyboard
  • Add input remapping for gamepads

Audio:

  • BGM Volume
  • 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:

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

Access:

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

Persistence:

  • Load settings to user config file
  • Save settings

Others:

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

@Ghabry Ghabry mentioned this pull request Feb 18, 2022
25 tasks
@fdelapena fdelapena added Settings All about customizable features, storing and applying them Enhancement labels Feb 18, 2022
@lychees
Copy link
Contributor

lychees commented Feb 18, 2022

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

@Ghabry
Copy link
Member Author

Ghabry commented Mar 1, 2022

Jenkins: Test this please <3

@fdelapena
Copy link
Contributor

So far so good 👍 . 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: Settings All about customizable features, storing and applying them

@jetrotal
Copy link
Contributor

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

@Ghabry
Copy link
Member Author

Ghabry commented Mar 11, 2022

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 Ghabry force-pushed the sysmenu branch 2 times, most recently from 8adc426 to 278e784 Compare March 21, 2022 18:00
@fdelapena
Copy link
Contributor

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.

@Ghabry
Copy link
Member Author

Ghabry commented May 28, 2022

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

My remaining todo list:

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

Test implementations of features on the devices:

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

@TrunXGIT
Copy link

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.

@aleck099
Copy link

aleck099 commented Sep 6, 2022

@Ghabry How to modify global audio volume?

@Mimigris
Copy link

Mimigris commented Sep 6, 2022

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)

@aleck099
Copy link

aleck099 commented Sep 7, 2022

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

@Mimigris
Copy link

Mimigris commented Sep 7, 2022

@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.

@Ghabry
Copy link
Member Author

Ghabry commented Oct 9, 2022

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
Copy link
Member Author

Ghabry commented Oct 16, 2022

Suggested input UI by Jetrotal:

unknown

@jetrotal
Copy link
Contributor

jetrotal commented Oct 16, 2022

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

Emergency reset loads the defaults for the last mapped button when 4 keys are held for 3 seconds.
After 3 seconds more all buttons are set to default.
This prevents that the Player becomes unusable.

Protection will prevent unmapping the last button for essential buttons.
Essential are: Directions, Confirm, Cancel and Settings menu
However this can still make the Player unusable, therefore the emergency reset.

When loading the configuration unmapped protected buttons get the default assigned.
@Ghabry Ghabry marked this pull request as ready for review January 20, 2023 17:26
@Ghabry
Copy link
Member Author

Ghabry commented Jan 20, 2023

Except for checking some ports this is now feature complete and ready for review. 🎉 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
Copy link
Member Author

Ghabry commented Jan 25, 2023

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

Only pending tests are Android and a retest on Windows

@Mimigris
Copy link

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

List multiple mapping at once if possible
- Add option to autosave on exit
- Add option to configure settings item location
Is like Window_Command but the items are layed out horizontal.

The state of the Window_Command items (enabled/disabled) is now remembered

Update layout of GameBrowser
@Ghabry
Copy link
Member Author

Ghabry commented Jan 27, 2023

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

@@ -2,41 +2,37 @@
* This file is part of EasyRPG Player
*
* Copyright (c) 2017 EasyRPG Project. All rights reserved.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At least this header still has the © year, a good chance to remove it

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and not touched since 6 years xD

For this use Ini4j.
That library is unmaintained with multiple CVEs but I could not find any other.
The CVEs are not exploitable as the INI is only writable through the app and adb.

The built-in settings scene is reachable through a new option in the sidebar.
@Ghabry Ghabry mentioned this pull request Feb 3, 2023
@fdelapena fdelapena merged commit 55b1e67 into EasyRPG:master Feb 24, 2023
@Ghabry Ghabry deleted the sysmenu branch June 12, 2023 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment