ppsspp icon indicating copy to clipboard operation
ppsspp copied to clipboard

Control profiles

Open iota97 opened this issue 3 years ago • 14 comments

Implement control profiles.

Use cases:

  • One may want to share the same controls preset in a few game and have other different setting per game, this make it easier.
  • Run time change as different game area/situation may map better to different controls layout (mostly on touch controls).
  • More binding on the controller: you may bind a key to change the profile and then have all key bind to action as fast forward, screen shot and so on in that profile. (This also change touch control so you can add a touch control to tell in which state you are).

Look like when I implemented right analog setting I didn't notice the section separation, this will reset those settings (and gesture one) :/

If the key mapping have no entry save will create no section, so load will trigger this: https://github.com/hrydgard/ppsspp/blob/9bc6b965566b3d805275876def74397f18bfc103/Core/KeyMap.cpp#L676

This will make default key map to be loaded instead of empty binding, not sure if there was any reason for that check to be there so I'm asking first if I could just remove it. Or I should make save create the section always?

Fixes #14404 and fixes #13303.

iota97 avatar Feb 17 '22 08:02 iota97

So this essentially implements hot-swappable controller profiles. Initially I was imagining you'd assign custom game configs to specific profiles, but this seems more versatile.

The intent of that line was to allow for defaults on first startup, i.e. to avoid these lines: ControlMapping"

Otherwise, if I have no inis yet and start up, I would get no defaults. That said, I don't know of anything that would break if we allowed saving empty sections (though I'm not terribly sure how useful an empty controller profile is...?)

Personally, I feel like it'd be nicer to put all controller profiles in the same ini, just with different section names. Instead of [ControlMapping] it could be [ControlProfile1Mapping] etc. I feel like this could just go in controls.ini? SaveToIni could just take a section name.

We could also "port" the settings in the separate section on first startup with those settings missing from the new place. Otherwise there will definitely be people confused or thinking we removed features.

-[Unknown]

unknownbrackets avatar Feb 21 '22 19:02 unknownbrackets

will take a real look soon! sorry for the delay in reviewing.

hrydgard avatar Feb 27 '22 22:02 hrydgard

I had some spare time at last, changed the logic to leave all setting where they are avoiding possible compatibility issues. There is simply a list of setting that get saved in the profile that are from general.

iota97 avatar Aug 14 '22 20:08 iota97

This now has some conflicts due to the way too long review process, sorry :(

Could you rebase those out? Then I'll play around with this myself to get a feel for it. I do want this feature in in some form.

hrydgard avatar Nov 14 '22 16:11 hrydgard

Squashed the commit for my own sanity before rebasing, I have a local backup of the other versions if needed.

PS: any reason we are manually writing down VIRTKEYS enum values?

iota97 avatar Nov 14 '22 17:11 iota97

What do you mean by manually writing down virtkey values? Giving them the string names?

hrydgard avatar Nov 29 '22 18:11 hrydgard

I mean we write VIRTKEY_CONTROLLER_PROFILE_1 = 0x40000027. We could omit the value and it will auto increase anyway, this seems just more affected by typo and git conflict to me. Not sure if there is any pro in this ;)

iota97 avatar Nov 29 '22 18:11 iota97

Since those values are saved externally, it's kind of a good thing that it causes conflicts when two people use the same number. I don't think it's bad to be explicit in "exposed" values. I think it makes sense to let auto-numbering happen when you don't care if i.e. two compiler versions auto-number the same way.

-[Unknown]

unknownbrackets avatar Nov 30 '22 23:11 unknownbrackets

This fixes #16960?

ghost avatar Feb 27 '23 10:02 ghost

Tried this again. As before, i'm concerned with the UX.

While it's not too hard to understand what's going on:

image

it's gonna be hard to remember which is which. It's also not clear what happens when you have a game config - are all setups saved in the game specific config, or global? Also, it's unclear from the UI if this applies to bindings, touch screen UI, or both.

I'm just afraid it's too confusing.. But like I said, I do like the functionality...

hrydgard avatar Apr 02 '23 13:04 hrydgard

We could add a string on top explaining what get saved. More strings to traslate tho'.

About global vs game specific: this should be global to allow to "port" configs from one game to another.

We could possibly add a simple text input to add a little description to help remember.

I find this more useful than not, even if a bit confusing should be easy enough to understand if a few tries :)

iota97 avatar Apr 02 '23 13:04 iota97

The confusion over what belongs to game and what is global does really go beyond this particular thing.. I've been thinking for a long time for how to highlight what's what in the UI, and how to make it understandable... I have a few concepts in mind, but to make it managable, need to make as much as possible of the settings menus dynamically generated from tables (like if we add a little color flash to settings that are being modified for the specific game, don't want to manually add that to all of them...).

hrydgard avatar Apr 02 '23 14:04 hrydgard