What is SOCD?
SOCD (Simultaneous Opposite Cardinal Direction) resolution determines what happens when you press opposing directions at the same time, such as left + right or up + down. HayBox provides fully customizable SOCD cleaning for each button pair in each mode.SOCD Types
HayBox supports six different SOCD resolution methods:SOCD_NEUTRAL
Neutral (0.5 0.5)When both directions are held, the output is neutral (center). This is the default if no SOCD type is specified.Use case: Traditional fighting games, hitbox-style controllers
SOCD_2IP
Second Input PriorityThe last pressed direction takes priority. Releasing the second direction reactivates the first.Example: Left → Left+Right = Right → Release Right = LeftUse case: Platform fighters with reactivation needed
SOCD_2IP_NO_REAC
Second Input Priority (No Reactivation)The last pressed direction takes priority. Releasing the second direction gives neutral - the first direction must be physically re-pressed.Example: Left → Left+Right = Right → Release Right = NeutralUse case: Melee, competitive play (prevents accidental reactivation)
SOCD_DIR1_PRIORITY
First Direction PriorityThe first button in the SOCD pair always takes priority over the second.Use case: Custom controllers, specific game mechanics
SOCD_DIR2_PRIORITY
Second Direction PriorityThe second button in the SOCD pair always takes priority over the first.Use case: Custom controllers, asymmetric layouts
SOCD_NONE
No SOCD ResolutionBoth directions are sent to the game. The game decides what happens.Use case: Testing, games with built-in SOCD handling
Configuring SOCD Pairs
SOCD pairs are configured in your mode’s configuration. Each pair defines two opposing directions and how to resolve conflicts between them.Basic Configuration
Inconfig_defaults.hpp, define SOCD pairs for each game mode:
HAL/pico/include/config_defaults.hpp
Different SOCD Types Per Mode
Different modes can use different SOCD types for the same button pairs:How SOCD Resolution Works
SOCD resolution happens automatically before the mode’sUpdateDigitalOutputs() and UpdateAnalogOutputs() functions are called.
Processing Flow
Input Reading
The firmware reads the raw button states from your input sources (GPIO pins, switch matrix, etc.).
SOCD Resolution
The
HandleSocd() function processes each configured SOCD pair according to its type:src/core/InputMode.cpp
Real-World Examples
Melee Mode (B0XX V3 Specification)
Melee mode uses 2IP No Reactivation to prevent accidental inputs:src/modes/Melee20Button.cpp
Melee20Button overrides
HandleSocd() to detect horizontal SOCD for the ledgedash maximum jump trajectory feature, but still calls the parent InputMode::HandleSocd() to perform the actual cleaning.Ultimate Mode
Ultimate mode uses standard 2IP with reactivation:FGC Mode (Fighting Games)
FGC mode uses neutral SOCD resolution, standard for hitbox-style controllers:FGC mode only defines 2 SOCD pairs because it uses D-Pad directions instead of analog stick, so C-stick SOCD pairs aren’t needed.
Advanced: Custom SOCD Handling
You can override theHandleSocd() function in your custom mode to implement special logic:
Custom Mode Example
SOCD State Management
For 2IP and 2IP No Reactivation, the firmware maintains state for each SOCD pair:include/core/socd.hpp
- Detect which button was pressed second
- Track when to reactivate the first button (2IP)
- Lock out buttons until release (2IP_NO_REAC)
Choosing the Right SOCD Type
When to use SOCD_2IP_NO_REAC
When to use SOCD_2IP_NO_REAC
Best for: Melee, competitive Smash, any game where accidental reactivation could cause problemsAdvantages:
- Most precise control
- Prevents accidental backwards inputs
- Tournament legal for most events
- Requires more deliberate inputs
- Can feel less fluid for some players
When to use SOCD_2IP
When to use SOCD_2IP
Best for: Ultimate, platform fighters with buffering, casual playAdvantages:
- More fluid movement
- Easier to input rapid direction changes
- Reactivation feels natural
- Can cause unintended inputs if not careful
When to use SOCD_NEUTRAL
When to use SOCD_NEUTRAL
Best for: Traditional fighting games, hitbox layoutsAdvantages:
- Tournament standard for most fighting games
- Prevents charge move exploits
- Simple and predictable
- Can’t hold both directions for any purpose
When to use SOCD_DIR1_PRIORITY or SOCD_DIR2_PRIORITY
When to use SOCD_DIR1_PRIORITY or SOCD_DIR2_PRIORITY
Best for: Custom controllers with asymmetric layouts, specific game mechanicsAdvantages:
- Consistent priority regardless of timing
- Useful for games where one direction should always win
- Less common, may be unexpected
- Tournament legality may vary
When to use SOCD_NONE
When to use SOCD_NONE
Best for: Testing, debugging, games with built-in SOCD handlingAdvantages:
- See raw inputs
- Useful for development
- May cause undefined behavior in games
- Not tournament legal
Common SOCD Patterns
Standard Platform Fighter
Hitbox-Style Fighting Game
Minimal (Left/Right Only)
Troubleshooting
Testing Your SOCD Configuration
- Use an input viewer (built-in B0XX viewer or external tool)
- Test each SOCD pair individually:
- Hold button 1, then press button 2
- Release button 2, check if button 1 reactivates (for 2IP) or stays neutral (for 2IP_NO_REAC)
- Test rapid alternation between directions
- Verify tournament legality if competing
See Also
- Mode Selection - Configure mode switching bindings
- Console Selection - Backend configuration
- Creating Custom Modes - Build modes with custom SOCD logic
