Extend `PlayerIndex` Enum To Support 8 Players On Compatible Platforms by AristurtleDev · Pull Request #8809 · MonoGame/MonoGame

@AristurtleDev

Extends the `PlayerIndex` enum support up to 8 players on compatible platforms:

- Added `PlayerIndex.Five` through `PlayerIndex.Eight`
- Use preprocessor directives to exclude `PlayerIndex.Five` through`PlayerIndex.Eight` on Playstation platforms since they are limited to four controllers

@SimonDarksideJ added this to the 3.8.5 milestone

Jun 2, 2025

harry-cpp

@AristurtleDev

@AristurtleDev

Added remarks to indicate that consumers should check `GamePad.MaximumGamePadCount` when using `PlayerIndex` to get game pad data as not all platforms support 8 gamepads

SimonDarksideJ

CartBlanche pushed a commit that referenced this pull request

Jun 27, 2025
#8809)

### Summary

This PR extends the `PlayerIndex` enum to support up to 8 players on
platforms that can handle more than 4 controllers simultaneously. The
change uses preprocessor directives to maintain platform-specific
limitations.

### Changes

- Added `PlayerIndex.Five` through `PlayerIndex.Eight` (values 4-7).
- Implemented preprocessor directives `#if !PLAYSTATION4 &&
!PLAYSTATION5` to exclude additional values on Playstation platforms as
they only support a maximum of four controllers.

viniciusjarina pushed a commit to codefoco/MonoGame that referenced this pull request

Nov 7, 2025
MonoGame#8809)

### Summary

This PR extends the `PlayerIndex` enum to support up to 8 players on
platforms that can handle more than 4 controllers simultaneously. The
change uses preprocessor directives to maintain platform-specific
limitations.

### Changes

- Added `PlayerIndex.Five` through `PlayerIndex.Eight` (values 4-7).
- Implemented preprocessor directives `#if !PLAYSTATION4 &&
!PLAYSTATION5` to exclude additional values on Playstation platforms as
they only support a maximum of four controllers.