skyfloogle / red-viper

A Virtual Boy emulator for the 3DS
764 stars 17 forks source link

Adding left 3DS DPad mode option. #65

Closed nevumx closed 1 month ago

nevumx commented 2 months ago

Hi there!

In playing games like 3D Tetris and Red Alert on my old 3DS, I often found myself wanting to have 3DS hardware button/dpad access to both the VB's right dpad, and its A & B buttons, as I don't like using the touchscreen unless it's absolutely necessary.

I noticed that we have a hardware dpad on the lower left corner of the 3DS that Red Viper simply has mirroring the circle pad/VB left dpad throughout execution, but it's pretty rare that one will be using both of those to access the VB's left dpad during regular gameplay.

Therefore, I propose opening the 3DS left dpad open to user configuration. Specifically, I propose allowing it to be configured to map to the VB's right dpad as well as its left, but also to mirror the 3DS' ABXY buttons, so that for example, if an old 3DS user wants to have one VB dpad per hand, and doesn't mind assigning the VB's A and B buttons to the 3DS' left dpad, (using the same configuration that the ABXY normally gets) they can do that with no issue. The buttons on screen can just stay there for those who want to use that.

Example usage:

2024-05-05_20-19-12 460_bot

Allowable options are:

Tested locally on my old 3DS only.

nevumx commented 1 month ago

cc @skyfloogle any thoughts on this? This screen doesn't have a crazy amount of screen real estate, especially with the optional New3DS shoulder trigger button, but I think it would be a worthwhile change; let me know.

skyfloogle commented 1 month ago

I want to implement a proper control configurator fairly soon so you can map any button to anything, which would negate the need for this PR. Keep it open for now though.

nevumx commented 1 month ago

@skyfloogle Yeah, that would probably be better; if you have a basic wireframe in mind, feel free to share it, and I might be able to spend some time implementing it.

Were you thinking to do like a basic table like this? 3DS INPUT VB INPUT
Circle Pad Up Left D-Pad Up
Circle Pad Down Left D-Pad Down
Circle Pad Left Left D-Pad Left
Circle Pad Right Left D-Pad Right
A A
B B
X A
Y B
etc... etc...

Where users just tap on the right column (or left? 😬) to change the values? (Probably going to need some scroll functionality for that lol...) Or were you more thinking of a full-on controller diagram, dynamically updated for New 3DS? And how did you want to treat the touch screen buttons lol? I don't particularly like them, but I am sure that there are going to be folks that want them to stay as-is or even be expanded lol. Maybe a legacy control mode switch?

skyfloogle commented 1 month ago

I was thinking something more visual with controller diagrams yeah. Each 3DS button is assigned to a VB button, so maybe a sort of representation of the 3DS buttons on the touchscreen, where each one offers a dropdown, and you could (optionally) treat each diamond (circle pad, d-pad, face buttons) as a group and assign them to either D-pad. I was also considering a VB controller with buttons you could drag onto the 3DS buttons, but that doesn't feel very compatible with button controls, and would probably be a bit too dense for the screen size. The complexity involved probably does mean the current ability to switch the touchscreen buttons doesn't make much sense, so it probably makes sense to keep the legacy settings available. The concept of two separately configurable "modes" will be needed anyway for anaglyph mode, so the same could be done here. It's definitely not a small job, so no pressure, but if that's something you're willing to take a stab at, I'd greatly appreciate it :)

nevumx commented 1 month ago

@skyfloogle Okay, so if that is the route you want to take, I would recommend merging this first, and just calling this whole current scheme "Legacy Control Mode," because this PR would be good functionality to add for users who want to stick with it. Then, we can build a "Custom Mapped Control Mode" as a completely separate scheme, and the way I would do that is that I would replace the current "controls" screen with a screen that has two buttons:

As for the layout of the new "Custom" controls screen, I think a drag-and-drop UI might be a little optimistic, and assigning full diamonds also feels a bit heavy-handed, as I like the flexibility of being able to assign buttons willy-nilly, like for example mapping VB start and select to 3DS X and Y or something like that... Also, implementing a drop-down seems a bit much; I would first show all the 3ds buttons on their own screen, then tapping one of them would bring you to a new screen with all the VB buttons, and it will tell you which VB button the 3DS button you tapped on is currently mapped to, and you can tap a new VB button to re-map it, or tap "Back" to cancel, something like that. I can probably get some kind of prototype out in a week or so, maybe sooner. Let me know if you have other preferences on any of this before I get too far into it though. πŸ˜…

skyfloogle commented 1 month ago

I would recommend merging this first,

Fair point, will do.

I would replace the current "controls" screen with a screen that has two buttons [...]

This is simpler than what I had in mind, and it even works within the constraints of the current menu system. I like it! I think I'd probably call the legacy mode "Preset" or "Simple" rather than "Legacy", since its advantage is that it's easier to interact with.

I would first show all the 3ds buttons on their own screen, then tapping one of them would bring you to a new screen with all the VB buttons, and it will tell you which VB button the 3DS button you tapped on is currently mapped to, and you can tap a new VB button to re-map it, or tap "Back" to cancel, something like that.

I think I would like to be able to see at a glance what each 3DS button is mapped to. Maybe it could be like an outline of the 3DS buttons, but instead of the name of the 3DS button, it would show what it's mapped to, or something like that? Other than that I like the idea. Looking forward to seeing what you come up with!

nevumx commented 1 month ago

I think I'd probably call the legacy mode "Preset" or "Simple" rather than "Legacy", since its advantage is that it's easier to interact with.

I wish I read this before I started coding lol, no big deal, I can break out the old Find & Replace. πŸ˜›

I think I would like to be able to see at a glance what each 3DS button is mapped to.

So, here's the thing; I really don't think we are going to have the screen space to accommodate displaying the VB button names alongside the 3ds button names... The main issue is that there are too many similarly named buttons, and too many buttons overall to display it all on one screen, so for instance, here is a rough outline I messed around with in GIMP for the "New" 3DS Layout: 3ds_buttons So I haven't labeled them yet because I was going to just code in the buttons in source with the special 3DS input characters on the system font to see how it comes out on console, but we have both the circle pad and D Pad on the left there, and the C-Stick and ABXY on the right; L/ZL/ZR/R up top, and SELECT/START on the bottom, (and the "back" button, obviously) and I honestly think we are going to be lucky if we can label those with the 3DS button names, let alone the VB button names; users will have to tap into each button to get to the VB button screen, vb_buttons Where the currently mapped button will be underlined, and users can either tap a new VB button to map to, or tap back to leave the mapping as-is. (This diagram again with no labels yet, but R/L triggers up top, R/L Dpads in the middle, and SELECT/START/A/B below, "back" on the bottom left again)

gobbledygoober commented 1 month ago

So, here's the thing; I really don't think we are going to have the screen space to accommodate displaying the VB button names alongside the 3ds button names... The main issue is that there are too many similarly named buttons, and too many buttons overall to display it all on one screen, so for instance, here is a rough outline I messed around with in GIMP for the "New" 3DS Layout:

Intuitively, could you show an image with the detected 3DS/2DS model with available buttons labelled, then once one was pressed, transition to a second screen with the Virtual Boy controller, highlighting the mappable buttons?

skyfloogle commented 1 month ago

I don't think the buttons necessarily need to be that big. A while ago, I threw together a prototype for a drag-and-drop system in Game Maker: image The Z buttons and start/select are missing, but I think you get the picture. Each of these button icons is 24x24, and thanks to the background graphics, it looks enough like a 3DS that you can tell what the buttons are without them needing labels.

nevumx commented 1 month ago

Intuitively, could you show an image with the detected 3DS/2DS model with available buttons labelled, then once one was pressed, transition to a second screen with the Virtual Boy controller, highlighting the mappable buttons?

So, I actually thought of that, but ultimately, I think that would take the hardware buttons away from their primary focus, which is navigating the menus, which I think is a good thing for accessibility for people with no stylus/big fingers/broken touch input. (IIRC, most of the program is currently operable without the touchscreen, before loading a rom, at least? If we had a configurable input to pause the emulator in-game, then that would make the touchscreen completely unnecessary, I think...)

I don't think the buttons necessarily need to be that big. A while ago, I threw together a prototype for a drag-and-drop system in Game Maker:

So again on the topic of accessibility, the current menu scheme may look a little "blocky," but ultimately I think it achieves its usability/accessibility objectives wonderfully with big buttons and hardware navigation, and I really don't want to break that. Making this new input mapping system accessible to no stylus/big fingers/broken touch input would be really nice.

Maybe some cosmetic upgrades like rounded corners and more noticeable "current button" indicators could do some good, but I am hesitant to fix what isn't broken in this case, and a drag-and-drop

skyfloogle commented 1 month ago

I think the main thing really is I'd like for there to be some kind of +/O/⁘ shape so it's immediately obvious which 3DS buttons they refer to, and you only need to label them with VB button names. It's fair enough to consider 24x24 too small, but maybe it's possible to have these additional shapes visible in the final menu somehow?

nevumx commented 1 month ago

Okay, @skyfloogle so here is how it looks in-app currently; after tapping "controls," you go here: 2024-05-20_11-02-16 113_bot Then if your control scheme is "Custom," and you tap "Configure Scheme," you go here: 2024-05-20_11-02-33 269_bot (Obviously, if you have an old 3DS, you won't see the c-stick/ZL/ZR, and I'll center the ABXY buttons.) Then, tapping on a 3DS button like "L" will bring you to the VB screen where the currently mapped button will be highlighted: 2024-05-20_11-02-47 298_bot So, personally, I think the 3DS system font icons do a great job of conveying the buttons, but if you really want a + shape, I can probably draw some more shapes to make them look more like this in the end? 3DS: 2024-05-20_11-02-33 269_bot_alt VB: 2024-05-20_11-02-47 298_bot_alt And I also want to see if there is room for adding some dynamic text like, "Currently mapped to X" and or "Tap to reassign" on the 3DS/VB screen; not quite sure how I want that to work/look or where I am going to fit it exactly, but wanted to get your thoughts on what I have so far?

skyfloogle commented 1 month ago

To be honest, this doesn't look as intuitive as I'd hoped. It's more important to me that you can see all your inputs at a glance than that they have a controller-like arrangement. Even then, now that we've tried the latter, it looks like it would really require alternative button shapes to look right, so I think I would probably rather just have a table that shows the VB input for each 3DS button, and clicking on each one lets you change it (the current VB screen is fine for this). With the current button size, you could probably get all of them on-screen at the same time with labels without needing scrolling code. Here's a very low effort mockup I threw together in GIMP: image If you need more space, you could abbreviate Select/Start to SL/ST or SEL/STA or something like that. Also, you could use the Classic Controller ZL/ZR icons (E054/E055).

nevumx commented 1 month ago

😬 I have to be honest in saying that I really don't like the way that looks... I can foresee confusion between what is a 3DS button and what is a VB button and therefore needing column labels, etc... 😭 While I could conceivably stomach something like it if there is really no other option, would you be open to considering displaying the currently mapped button in the center, like so? colon Or a little more descriptively with some text? maps_to I will admit that I took some artistic liberties in changing the button underline to an outline here.

If you really want all of them visible at once, (for stylus-only folks, I suppose) would you be willing to decrease the font size to show them both in each 3DS button's text, and I can make the buttons a bit bigger? I don't have the time to mock it up right now, but I think that might be the best compromise...

skyfloogle commented 1 month ago

See how shrinking the text looks. If you're using the standard button API you'll probably have to add an argument to handle_buttons for that, or a field to the button struct. Also, you can probably win some space by making the select/start buttons smaller. They're bigger than the face buttons right now, and I don't really think they need to be. It'd mean shrinking the text but that's fine.

nevumx commented 1 month ago

Yeah the thing with the start/select buttons (and the L/R/ZL/ZR buttons) is that making them smaller only wins us vertical space lol, when its horizontal space that's at a premium... Unless... We want to make the "+"-shaped buttons taller and then use two lines of text, like 3DS on the top-left corner, and VB on the bottom-right? Would probably look better than just adding a colon or something between them... πŸ€” Let me see what I can do...

nevumx commented 1 month ago

@skyfloogle Ok, so I went in GIMP and this is probably going to be the best of both worlds; I am still probably going to have to use a smaller font, and the STA/SEL contractions, but by making each button a standard size we can say, okay, you get ~3 characters to represent each 3DS/VB button over two lines on each software button, and then we can have some descriptive text as a legend saying which buttons are 3DS and which are VB... Thoughts before I fully implement it? πŸ˜… 3ds_new_buttons_thicker

nevumx commented 1 month ago

Ok, I implemented it and it looks half-decent I think; the only problem is the ZL and ZR icons are a tab too small... I did 0.6 instead of 0.7 to accommodate the line drawn on the bottom of selected buttons... I could probably also replace the space between the R/L letters and the Dpad icon, as well as adding the "3DS/VB MAP" text... Thoughts? 2024-05-20_23-17-55 650_bot

skyfloogle commented 1 month ago

I'm happy with this, with the 3DS/VB text added. It might help readability a bit to fill in the gaps between the grouped buttons the way you tried before.

nevumx commented 1 month ago

Ok @skyfloogle I think I have almost everything now; the code is almost ready to submit, the only loose end, I think, is do you want me to prevent the touchscreen buttons/dpad from being drawn if the "custom" control scheme is active?

skyfloogle commented 1 month ago

I think it still makes some sense to keep it around, but maybe it's worth removing the "switch" button and making you pick one on the config screen, since getting it to make sense would be a challenge otherwise.

nevumx commented 1 month ago

Ahh... I don't think we have any space left for a button like that... Like it really doesn't seem right to keep them on screen if we don't have the room for a button to configure them... Another question is, do we want a Reset button on the 3DS button mapping screen? That should be relatively easy to add.

skyfloogle commented 1 month ago

There's a little space in the middle you could put the touch config in. You could represent it with E058 (πŸ‘†). Alternatively, we could keep the ingame switch button and have it just not affect button controls. If the former is possible, though, I'd probably prefer it. Reset button makes sense, could go in the bottom right.

nevumx commented 1 month ago

Ok, @skyfloogle, let's move this over to https://github.com/skyfloogle/red-viper/pull/67 πŸ˜