HarbourMasters / HarbourMasters/Starship

Add low level controller mapping?

Open
#282 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
2.1k
Forks
140
Avg merge
14d 15h
Merged PRs (30d)
2

Description

I am not sure if I am interpreting the issue correctly. I am trying to play on Linux with an 8bitdo N64 mod kit controller, connected while in 'Switch' mode over bluetooth (a similar thing happens in the other 'D' mode)
It appears that the controller is automatically mapped using SDL to generic button names as if it was, say, a modern Xbox controller. Then when I use the built-in button mapper in Starship (the UI is way too small by the way), it works, but the button names as I press them make no sense! For example, C-up is called the 'view' button. Importantly, C-right is not detected at all and I cannot map it. In 'D' mode it is a different set of buttons that are not detected.

So, I figure SDL is trying to map the N64 controller to an Xbox layout as best as it knows how to, but doesn't have a place to put C-right and just loses that button.
I then tried 'SDL2 Gamepad Tool' and am able to map all the N64 buttons to something on the generic Xbox layout (I assigned C-up and C-right to the joystick click-in buttons for example). I believe I saved this layout to the system, rebooted the PC, but it still does not work in Starship. I gather that Starship takes it's config from 'gamecontrollerdb.txt' instead of the OS? I am not sure how I could edit this file if it is even possible. This whole issue I think could be avoided if I could just assign the generic 'button 1', 'button 2' etc. inputs right inside Starship.

Or maybe I am misunderstanding the issue, I am not sure.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the mapping problem on Linux with the 8bitdo N64 controller in Switch and D modes, then trace how Starship uses SDL and gamecontrollerdb.txt instead of the OS mapping. Done means the N64 buttons, including C-right, can be identified and assigned through Starship without misleading or missing inputs.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, linux
Domain
game-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.