Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Two joysticks of the same model can't be used together

Aperta
#7,889 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
52/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
cpp, json, linux

Direzione di ricerca

Start by tracing joystickMatchesGuid through joystick-slot assignment and the saved joystick settings, including the legacy Joy0GUID values and the JSON id field. Reproduce with two SDL joysticks sharing a GUID, then inspect device enumeration and available identity data such as SDL_GetJoystickPath or serial numbers. Done means each slot selects a distinct matching device in SDL order, with compatible fallback to the saved GUID; confirm the options UI no longer reports None and both sticks control their assigned roles.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Problem

If you have two joysticks of the same model plugged in, like a pair of identical sticks for a dual-stick setup, the game won't use either of them. At startup neither stick gets a control slot, the Joystick setting in the options shows "None", and the ship doesn't respond to either stick.

SDL gives both sticks the same GUID, since it's built from the bus, vendor, product, version and name, with no serial number. When the saved setting matches more than one connected stick, joystickMatchesGuid refuses to pick one, so nothing gets bound. The old launcher settings (Joy0GUID and friends) hit the same check.

Steps to reproduce

  1. Plug in two joysticks of the same model.
  2. Start FSO (master, in-game options on) and pick one of them as the Joystick in the in-game options.
  3. Quit and start the game again with both sticks still plugged in.
  4. Start a mission and move either stick.

I reproduced this on Linux with two virtual sticks that share a name, vendor and product, and the setting already saved for one of them (master at 12a36dc1a, retail data, SM1-01). The log shows "No joystick is being used." With only one of them plugged in, the same saved setting works.

Expected vs. actual behavior

Expected: the stick you picked steers the ship, and with a dual-stick setup each slot gets one of the two sticks.

Actual: neither stick is bound, the setting shows "None", and the ship ignores both sticks.

Proposed fixes

Ranked by simplicity, then maintainability, then thoroughness.

  1. When several connected sticks share the saved GUID, give each slot the first matching stick that isn't already in another slot, in SDL's device order. Small change, no settings format change, and a dual-stick setup works. The catch: the two sticks can swap sides if the OS enumerates them in a different order.
  2. Save something that tells identical sticks apart alongside the GUID, such as the device path from SDL_GetJoystickPath or the serial number where the device reports one. The saved JSON already has an id field that's currently always -1. Use it only to break ties, falling back to the GUID alone, so existing settings keep working.
  3. Move to full per-device identity (name plus GUID plus path or serial) for all saved joystick settings, as discussed in #7481. Most thorough, but it means a settings format change and agreeing on how to migrate old configs.

Related: #813 (SDL GUIDs aren't unique, closed), #7481.

Lingua principale
C++
Stelle
488
Fork
184
Merge medio
2g 9h
PR unite (30g)
40

Preparare l'ambiente

Non abbiamo ancora controllato i file di configurazione di questo progetto. Parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di scp-fs2open/fs2open.github.com

Tutte le issue di scp-fs2open/fs2open.github.com

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.