Log In  


I've found that even with my small collection of gamepad/controllers being hooked up to various devices, that the default mappings on gamepads differ widely. It made it hard to me to know which button to label as which in my games.

So if you just plug in your gamepad and boot up PICO8, which buttons map to which keys?

Naturally, it's gonna vary but based on my own controllers and a very unscientific survey on Twitter, I've come to accept that the B button on a gamepad maps to Z on keyboard, and A button maps to X on keyboard.

Like so:

Obviously, you can remap the buttons and all that jazz but out of the box, this seems to be the common config. This is how my Buffalo gamepad is when plugged into my Windows machine...and gotta say, it makes sense. The B button is left of the A button, just like the Z key is left of the X key on my keyboard.

What have you found with your various controllers and gamepads? Maybe this thread can serve as an index of controllers and how they map to PICO8 by default. Just make sure to outline the brand of controller and the device you're using it with.

1


Controller: Buffalo Classic USB Gamepad
Device: Windows 10
Device: Pi400 w/ RetroPie

Controller: Anbernic RG351V
Device: Anbernic RG351V handheld


@morningtoast Not a Gamepad per se, but here's the default config on the Gameforce Chi handheld.


I've not had a good configuration on my cellphone with external joystick, the Kishi Razer, @morningtoast. And I'm not really sure how to fix it.

https://www.lexaloffle.com/bbs/?tid=47506


I think a big source of the ambiguity here is the difference between the SNES and the gameboy/NES:

  • the gameboy has A and B buttons, and games tended to map the primary verb (e.g. "jump") to A and the secondary (e.g. "run") to B.
  • but the SNES had 4 face buttons. A and B were placed in the same locations, but suddenly the most natural way to grip the controller is to cover Y and B with your thumb, letting you hold run (Y) and tap jump (B) when needed. so, the primary verb changed from the A button (gameboy) to the B button (SNES)

anyway, I've been using pico8's Z/O/4 as the "primary verb" in my games, and X/5 as the "secondary verb". I eventually settled on this because of the way the mobile controls looks for pico8 html exports, and matching that to the gameboy

(here are some game manuals I looked up to double check my memory of which buttons were "primary" and which were "secondary")


So, as far as I can tell at the moment, the most common sources of mapping for indie engines and games is the gamecontrollerdb.txt file that's been spread around for use with SDL2 and anything will to use the same format. Essentially, it's a listing of game controllers that were at some point in common usage, along with which number those controllers use internally for each button (as well as numbers for hats and axes). It's pretty trivial to embed a txt file in an executable and SDL2 has both a function for using custom files and its own miniature version that it defaults too. If pico-8 uses the game controller system in SDL2, then it's going to have better mapping for controllers that more people who play widely-known game use (because the more niche, the less data is available). If pico-8 doesn't use the controller system or if the controller you're using doesn't have a listing, then the default mapping will end up being based on whatever numbers are used internally by that device.

There's a github for that file, but I don't remember if it's linked to by SDL2's sites or if any of the distributions come with it directly. Here it is in case anyone's curious: https://github.com/gabomdq/SDL_GameControllerDB/blob/master/gamecontrollerdb.txt

Anyway, I noticed that the Buffalo controller seems to be on it, as is several of that company's other controllers. However, the Ambernic isn't, and I would guess that's because the focus is on USB controllers rather than embedded ones. There's also an entry for one of Gameforce's products but it doesn't seem to be the Chi. That said, controllers may not need their own listing if they match one of the general driver mappings. For example, if a controller is set up internally to tell Windows that it's an XBox controller, then it will use the mapping for XBox controllers whenever used on Windows.


Here's a fun one. I don't usually play with a controller on my laptop for some reason, but just out of curiosity I connected the only controller I have lying around - a Dualshock 3 from my Playstation 3. And hilariously, the X button on the controller maps to the O button in PICO-8 and the circle button on the controller maps to the X button in PICO-8. So it's visually backwards, and layout-wise, it's opposite of how the layout on my Gameforce is.

Gameforce                                           Dualshock 3
======================                              ============================
        O (hardware A)                                       X (hardware circle)

X (hardware B)                                       O (hardware X)


[Please log in to post a comment]