[Input] Direct input controller OutOfRange
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 7.8k
- Forks
- 1.2k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 49
Description
This has been worked around through #696 , leaving this open until someone more knowledgeable about direct input comes around to clarify this stuff / fix it.
Release Type: Launcher
Version: 4.0
Platform(s): Windows, build and editor
Describe the bug
Exceptions are being thrown in GameControllerDirectInput.cs's update
To Reproduce
Steps to reproduce the behavior:
- Generate 'New Game' template.
- Connect non-standard direct input USB device.
Expected behavior
Append input from DI devices successfully.
Screenshots

Log and callstacks
Exception: IndexOutOfRangeException: Index was outside the bounds of the array.
at Stride.Input.GameControllerDirectInput.Update(List`1 inputEvents)
at Stride.Input.InputManager.Update(GameTime gameTime)
at Stride.Games.GameSystemCollection.Update(GameTime gameTime)
at Stride.Editor.EditorGame.Game.EditorServiceGame.Update(GameTime gameTime)
at Stride.Games.GameBase.InitializeBeforeRun()
at Stride.Games.GamePlatform.OnInitCallback()
at Stride.Games.GameWindowWinforms.Run()
at Stride.Games.GameBase.Run(GameContext gameContext)
at Stride.Assets.Presentation.AssetEditors.GameEditor.Services.EditorGameController`1.SceneGameRunThread()
at Stride.Core.Diagnostics.SafeAction.<>c__DisplayClass1_0.<Wrap>b__0()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
[SceneEditorGame]: Error: Unexpected exception. System.IndexOutOfRangeException: Index was outside the bounds of the array.
at Stride.Input.GameControllerDirectInput.Update(List`1 inputEvents)
at Stride.Input.InputManager.Update(GameTime gameTime)
at Stride.Games.GameSystemCollection.Update(GameTime gameTime)
at Stride.Editor.EditorGame.Game.EditorServiceGame.Update(GameTime gameTime)
at Stride.Games.GameBase.InitializeBeforeRun()
[SafeAction]: Fatal: Unexpected exception. System.IndexOutOfRangeException: Index was outside the bounds of the array.
at Stride.Input.GameControllerDirectInput.Update(List`1 inputEvents)
at Stride.Input.InputManager.Update(GameTime gameTime)
at Stride.Games.GameSystemCollection.Update(GameTime gameTime)
at Stride.Editor.EditorGame.Game.EditorServiceGame.Update(GameTime gameTime)
at Stride.Games.GameBase.InitializeBeforeRun()
at Stride.Games.GamePlatform.OnInitCallback()
at Stride.Games.GameWindowWinforms.Run()
at Stride.Games.GameBase.Run(GameContext gameContext)
at Stride.Assets.Presentation.AssetEditors.GameEditor.Services.EditorGameController`1.SceneGameRunThread()
at Stride.Core.Diagnostics.SafeAction.<>c__DisplayClass1_0.<Wrap>b__0()
Additional context
Initially brought up here https://github.com/stride3d/stride/issues/673#issuecomment-621101365
More context from @tre4b
I have a foot controller, 3 button USB device. Unplugged that and it all worked.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at sources/engine/Stride.Input/Windows/GameControllerDirectInput.cs around line 142 and review the Update call in the supplied stack trace, then read the workaround in issue #696. Reproduce with a non-standard DirectInput USB device on Windows; done means the device input is appended successfully without an IndexOutOfRangeException.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100