Skip to content

Conversation

@sheepytina
Copy link
Contributor

@sheepytina sheepytina commented Aug 19, 2023

Adds new "Advanced Resolution Settings" UI controls and logic to give players greater control over the game image.

  • Option to force arbitrary aspect ratios, with some common presets included.
  • Option to override Internal Resolution scale with a static vertical pixel count.
  • "Pixel-perfect mode" to allow 1:1 pixel mapping and integer scaling.

Aspect ratio and pixel count settings are separate so they can be used independently, and fall back on window size if not being used.

The UI and certain logic is all on the Ship of Harkinian side. Image sizing and positioning is done in Libultraship's Gui functions.

This depends on the following Libultraship pull requests:

image

Debug.2023.08.16.19.43.10.02.1080p_60fps_H264-128kbit_AAC.mp4

This does not interfere with N64 Mode. N64 Mode (gLowResMode) will take priority over these settings.

Build Artifacts

first working version with most features implemented
Added auto-resizing logic for Pixel Perfect Mode.
Minor fixes.
Disable integer scale slider if automatic sizing is overriding it.
Don't offer these UI options on Apple.
Removed unused code.
Updated LUS.
@Malkierian
Copy link
Contributor

Just making note, requires Kenix3/libultraship#335

Copy link
Member

@PurpleHato PurpleHato left a comment

Choose a reason for hiding this comment

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

Seeing how frequently this feature has been requested, I'm genuinely excited to witness its implementation. Thank you, Tina!

I've noted a couple of small nitpicks I'd like to mention. Apart from those, everything is looking good

Filenames and folders now more closely match rest of project.
Tidied newlines/comments.
(SohMenuBar.cpp) Label of button changed to fit menu.
(ResolutionEditor.cpp) Default window size improved.
(However, I still need to make the GUI controls acknowledge the new constraints.)
(and changed the name of some cvars)
(Also removed the duplicated N64 Mode toggle.)
And one significant fix: Enhancement checkboxes in ResolutionEditor now default to off.
@sheepytina sheepytina marked this pull request as draft August 31, 2023 03:03
@sheepytina
Copy link
Contributor Author

Marking this as draft for now as I intend to go back through and polish it up more.

@sheepytina sheepytina deleted the branch HarbourMasters:develop September 4, 2023 05:43
@sheepytina sheepytina closed this Sep 4, 2023
@sheepytina sheepytina deleted the develop branch September 4, 2023 05:43
@sheepytina sheepytina restored the develop branch September 4, 2023 05:55
@sheepytina
Copy link
Contributor Author

you saw nothing

@sheepytina sheepytina reopened this Sep 4, 2023
There's still a few bugs with it that I haven't squashed, but I need to stop for now and just commit what I've got.

(This is honestly causing more problems than it solves, but i'm tired of getting questions about it.)
Additionally:
* Don't change settings if selecting "Custom" from preset dropdowns.
* Added a missing horizontal pixel count clamp check.
* Tidied up redundant behaviour.
@briaguya0 briaguya0 removed the do not merge Not ready or not valid changes label Nov 12, 2023
@briaguya0
Copy link
Contributor

removed "do not merge" (looks like that should have happened a month ago #3130 (comment))

Fixes an issue where default aspect ratio settings on a fresh SoH configuration weren't matching the defaults assigned in libultraship.
The default values are now 16:9, matching LUS.
Additionally, the combo box now defaults specifically to the 16:9 preset instead of "Custom".

(Fixing the defaults in LUS to be 4:3 isn't worth a LUS bump, so this slight workaround will do for the sake of this PR.)
by using pixel dimensions as the aspect ratio directly, since now this view hides the aspect ratio setting from the user anyway.
+ actually display it as a ratio.
+ remove non-functioning 'IsBoolArrayTrue' function.

(The countdown was an okay idea but I didn't implement it correctly. It's better to just keep it simple.)
@sheepytina sheepytina marked this pull request as draft November 21, 2023 15:09
sheepytina added a commit to sheepytina/Shipwright that referenced this pull request Nov 22, 2023
commit f4dcffc
Author: Tina H. (sheepytina) <[email protected]>
Date:   Tue Nov 21 01:17:49 2023 +1100

    Remove update flags from combo boxes + remove update countdown

    + remove non-functioning 'IsBoolArrayTrue' function.

    (The countdown was an okay idea but I didn't implement it correctly. It's better to just keep it simple.)

commit f5818f5
Author: Tina H. (sheepytina) <[email protected]>
Date:   Mon Nov 20 23:31:15 2023 +1100

    Correct aspect ratio visualiser to be un-inverted

    + actually display it as a ratio.

commit 61be6e8
Author: Tina H. (sheepytina) <[email protected]>
Date:   Mon Nov 20 23:12:55 2023 +1100

    Simplify "Show a horizontal resolution field" logic

    by using pixel dimensions as the aspect ratio directly, since now this view hides the aspect ratio setting from the user anyway.

commit 6407ce8
Author: Tina H. (sheepytina) <[email protected]>
Date:   Mon Nov 20 22:42:12 2023 +1100

    Use `SCREEN_HEIGHT` and `SCREEN_WIDTH` for constraints

commit fd36dbf
Author: Tina H. (sheepytina) <[email protected]>
Date:   Sun Nov 19 19:14:00 2023 +1100

    Small tweak to combo item saving

commit 5f1b405
Author: Tina H. (sheepytina) <[email protected]>
Date:   Sun Nov 19 16:14:19 2023 +1100

    Make resolution slider `disabled` condition a variable, for readability.

commit ab62a9e
Author: Tina H. (sheepytina) <[email protected]>
Date:   Sat Nov 18 18:11:11 2023 +1100

    Fix a minor oversight with default configuration.

    Fixes an issue where default aspect ratio settings on a fresh SoH configuration weren't matching the defaults assigned in libultraship.
    The default values are now 16:9, matching LUS.
    Additionally, the combo box now defaults specifically to the 16:9 preset instead of "Custom".

    (Fixing the defaults in LUS to be 4:3 isn't worth a LUS bump, so this slight workaround will do for the sake of this PR.)

commit c8fa2e4
Author: Tina H. (sheepytina) <[email protected]>
Date:   Tue Oct 31 17:34:40 2023 +1100

    Integer Scaling header is DefaultOpen if player has Pixel Perfect Mode active upon window creation.

    + Amend tooltips.

commit 520249b
Author: Tina H. (sheepytina) <[email protected]>
Date:   Tue Oct 31 17:28:09 2023 +1100

    Move some UI elements around.

    Add an extra MSAA slider to the editor window.

commit 5e38a9b
Author: Tina H. (sheepytina) <[email protected]>
Date:   Fri Oct 20 18:42:51 2023 +1100

    Add list of colours to use with TextColored elements.

commit 1bc5f5e
Author: Tina H. (sheepytina) <[email protected]>
Date:   Fri Oct 20 16:49:17 2023 +1100

    Change language of NeverExceedBounds checkbox description

    to be more affirmative, so it makes more sense.

    Add tooltip for NeverExceedBounds checkbox.
    Tweak some comments related to additional settings.

commit 880d48f
Author: Tina H. (sheepytina) <[email protected]>
Date:   Fri Oct 20 16:14:49 2023 +1100

    Save current ImGui Combo items as a console variable

    to improve user experience.

commit 94fd5cc
Author: Tina H. (sheepytina) <[email protected]>
Date:   Mon Oct 16 22:04:19 2023 +1100

    Tweak comments.

commit 8dc510e
Merge: 2f3a6ad 8c7786d
Author: Tina H. (sheepytina) <[email protected]>
Date:   Thu Oct 12 12:09:24 2023 +1100

    Merge branch 'develop' into develop-resolutioneditor

commit 2f3a6ad
Author: Tina H. (sheepytina) <[email protected]>
Date:   Fri Sep 22 21:23:46 2023 +1000

    Update libultraship with commits from main branch (up to e5df3a9)

commit 138e037
Author: Tina H. (sheepytina) <[email protected]>
Date:   Tue Sep 19 22:06:45 2023 +1000

    Well I suppose that's no-longer necessary.

commit a27f831
Author: Tina H. (sheepytina) <[email protected]>
Date:   Tue Sep 19 20:09:31 2023 +1000

    Add `(Select "Off" to disable.)` help text for the aspect ratio setting and hide UI elements accordingly.

    Only show the fields if user chooses Custom.
    Padding has been shifted accordingly too.

    Also fixed a long standing error with the Y field disappearing when modifying X.

commit 401f8b6
Author: Tina H. (sheepytina) <[email protected]>
Date:   Tue Sep 19 18:35:22 2023 +1000

    Update libultraship + Formatting pass on ResolutionEditor.cpp

commit ec7d926
Author: Tina H. (sheepytina) <[email protected]>
Date:   Tue Sep 19 15:34:38 2023 +1000

    Changed label for the Enabled advanced settings checkbox.

commit 6812d5d
Author: Tina H. (sheepytina) <[email protected]>
Date:   Tue Sep 19 15:23:43 2023 +1000

    Group "Integer Scaling" under its own collapsing header

commit 680ba9c
Author: Tina H. (sheepytina) <[email protected]>
Date:   Tue Sep 12 16:42:54 2023 +1000

    Remove unused and unnecessary variables.

commit ad2a902
Author: Tina H. (sheepytina) <[email protected]>
Date:   Tue Sep 12 15:37:43 2023 +1000

    Fix a typo that prevented `IsDroppingFrames()` from working

    (Maybe more than a mere typo, but a typo was involved.)

commit 34b3eff
Author: Tina H. (sheepytina) <[email protected]>
Date:   Tue Sep 12 15:31:02 2023 +1000

    Tidy up comments.

commit 8354dfd
Author: Tina H. (sheepytina) <[email protected]>
Date:   Mon Sep 11 18:51:54 2023 +1000

    Even more clever integer scaling behavior.

    "IntegerScale" is itself now a CVar group.

commit 443e06a
Author: Tina H. (sheepytina) <[email protected]>
Date:   Sun Sep 10 21:21:38 2023 +1000

    Swap to new branch for libultraship

commit 2988979
Author: Tina H. (sheepytina) <[email protected]>
Date:   Sun Sep 10 18:46:20 2023 +1000

    "Fit Automatically" has been moved to LUS and is now smarter.

    This will require another PR in LUS to be opened by me.

commit 2b9e7d8
Author: Tina H. (sheepytina) <[email protected]>
Date:   Sun Sep 10 16:58:48 2023 +1000

    Added a helpful button to cover a potential support issue.

commit 9ed4d51
Author: Tina H. (sheepytina) <[email protected]>
Date:   Sun Sep 10 16:23:37 2023 +1000

    Added missing CVarSave() calls where needed.

    Added a short update countdown for the numerical CVars. This is intended to prevent CVarSave() from being called too often.

commit e474f4b
Author: Tina H. (sheepytina) <[email protected]>
Date:   Fri Sep 8 13:15:13 2023 +1000

    More minor UI tweaks.

commit ae764c6
Author: Tina H. (sheepytina) <[email protected]>
Date:   Fri Sep 8 12:03:26 2023 +1000

    Change how frame rate threshold is calculated.

commit aed8c3d
Author: Tina H. (sheepytina) <[email protected]>
Date:   Thu Sep 7 20:05:04 2023 +1000

    Additional comments, and a checkbox to disable aspect correction on consoles.

commit 6678030
Author: Tina H. (sheepytina) <[email protected]>
Date:   Thu Sep 7 18:36:11 2023 +1000

    Don't show "Horiz. pixel count" field if not enforcing aspect ratio.

    Additionally:
    * Don't change settings if selecting "Custom" from preset dropdowns.
    * Added a missing horizontal pixel count clamp check.
    * Tidied up redundant behaviour.

commit 520965d
Author: Tina H. (sheepytina) <[email protected]>
Date:   Thu Sep 7 17:22:47 2023 +1000

    Horizontal Resolution field now properly acknowledges resolution bounds.

commit 7a42d21
Author: Tina H. (sheepytina) <[email protected]>
Date:   Thu Sep 7 16:05:56 2023 +1000

    Resolved many of the lingering bugs with the previous commit

commit c042a2f
Author: Tina H. (sheepytina) <[email protected]>
Date:   Wed Sep 6 20:14:09 2023 +1000

    Add Additional Settings and the accursed horizontal resolution field.

    There's still a few bugs with it that I haven't squashed, but I need to stop for now and just commit what I've got.

    (This is honestly causing more problems than it solves, but i'm tired of getting questions about it.)

commit cd06374
Author: Tina H. (sheepytina) <[email protected]>
Date:   Wed Aug 30 17:27:56 2023 +1000

    Update LUS, update CVar names, small tweaks

    And one significant fix: Enhancement checkboxes in ResolutionEditor now default to off.

commit f9784a3
Author: Tina H. (sheepytina) <[email protected]>
Date:   Mon Aug 28 16:06:26 2023 +1000

    Update libultraship

commit 06d995e
Author: Tina H. (sheepytina) <[email protected]>
Date:   Mon Aug 28 12:46:35 2023 +1000

    Enabled on Apple - For currently ongoing Retina DPI troubleshooting.

    (Also removed the duplicated N64 Mode toggle.)

commit 64c2a3e
Author: Tina H. (sheepytina) <[email protected]>
Date:   Sun Aug 27 13:17:41 2023 +1000

    Update libultraship

commit c0b5f44
Author: Tina H. (sheepytina) <[email protected]>
Date:   Fri Aug 25 23:25:15 2023 +1000

    Tweaks based on feedback

commit 5aa9af4
Author: Tina H. (sheepytina) <[email protected]>
Date:   Thu Aug 24 16:33:50 2023 +1000

    Added constraints to the inputs. Added a fps drop warning.

commit 8646af7
Author: Tina H. (sheepytina) <[email protected]>
Date:   Thu Aug 24 15:32:13 2023 +1000

    Update libultraship

    (and changed the name of some cvars)

commit 0bf9579
Author: Tina H. (sheepytina) <[email protected]>
Date:   Mon Aug 21 18:07:07 2023 +1000

    Update libultraship

    (However, I still need to make the GUI controls acknowledge the new constraints.)

commit 2241429
Author: Tina H. (sheepytina) <[email protected]>
Date:   Mon Aug 21 14:57:37 2023 +1000

    Filenames and style fixes

    Filenames and folders now more closely match rest of project.
    Tidied newlines/comments.
    (SohMenuBar.cpp) Label of button changed to fit menu.
    (ResolutionEditor.cpp) Default window size improved.

commit 5832db5
Author: Tina H. (sheepytina) <[email protected]>
Date:   Sat Aug 19 17:46:31 2023 +1000

    Update libultraship

commit b853612
Author: Tina H. (sheepytina) <[email protected]>
Date:   Sat Aug 19 15:27:18 2023 +1000

    Tweaks and tidying up.

    Disable integer scale slider if automatic sizing is overriding it.
    Don't offer these UI options on Apple.
    Removed unused code.
    Updated LUS.

commit 07f19aa
Merge: 48c946a 8872a59
Author: Tina H. (sheepytina) <[email protected]>
Date:   Sat Aug 19 13:59:55 2023 +1000

    Merge branch 'develop' of https://github.com/sheepytina/Shipwright into develop

commit 48c946a
Author: Tina H. (sheepytina) <[email protected]>
Date:   Sat Aug 19 13:59:37 2023 +1000

    Update advancedResolutionEditor.cpp

    Added auto-resizing logic for Pixel Perfect Mode.
    Minor fixes.

commit 082b47e
Author: Tina H. (sheepytina) <[email protected]>
Date:   Wed Aug 16 22:07:32 2023 +1000

    Advanced Resolution Settings

    first working version with most features implemented
@sheepytina sheepytina marked this pull request as ready for review November 22, 2023 08:32
This looks like a lot but it's mostly just re-arranging a cluttered area of the code for clarity.
Actual changes to functionality are:
* Help text now "disabled" along with the checkbox.
* The NeverExceedBounds checkbox will now reset the unused ExceedBoundsBy cvar if it's been changed.
@briaguya0
Copy link
Contributor

loving the disable functionality! noticed one slight oddity with the window exceeded warning

reset

Copy link
Contributor

@briaguya0 briaguya0 left a comment

Choose a reason for hiding this comment

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

:shipit:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants