Skip to content

fix: Bepu and InputSystem update order#2848

Merged
Eideren merged 1 commit intostride3d:masterfrom
Eideren:fix_system_update_order
Aug 27, 2025
Merged

fix: Bepu and InputSystem update order#2848
Eideren merged 1 commit intostride3d:masterfrom
Eideren:fix_system_update_order

Conversation

@Eideren
Copy link
Collaborator

@Eideren Eideren commented Jul 22, 2025

PR Details

Set the update order for the InputSystem to a non-zero value, it will now always run before other systems with unset order.
Previously, users may inadvertently introduce a one-frame input latency to their scripts by creating the ScriptSystem before the InputSystem.
Also provides a way for users to insert systems that may run after the InputSystem but before the ScriptSystem without touching those two systems or creating a custom game implementation.

Given the above, moved the execution point of Bepu earlier in the frame, before ScriptSystem runs to make sure interpolated bodies update their positions before users may read them in update, but after InputSystem otherwise users would be reading last frame's input when they implement Components.ISimulationUpdate.

The above will reduce/eliminate apparent stuttering with user script when moving objects based on physics object transforms.

Related Issue

None afaict.

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My change requires a change to the documentation.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have built and run the editor to try this change out.

@Doprez
Copy link
Contributor

Doprez commented Jul 22, 2025

LGTM

On a side note, would it make sense to create a PR tag for minor behaviour changes in code? I don't see this breaking anything but adding this with a specific note to releases may help existing users who may have done something specific with GameSystem order.

@Eideren Eideren merged commit 55362e1 into stride3d:master Aug 27, 2025
7 checks passed
@Eideren Eideren deleted the fix_system_update_order branch August 27, 2025 14:58
@Eideren Eideren added the behavioral-change Non breaking change which could subtly change the behavior of user logic label Aug 27, 2025
@Eideren
Copy link
Collaborator Author

Eideren commented Aug 27, 2025

@Doprez Good idea, added Behavioral-Change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-Physics behavioral-change Non breaking change which could subtly change the behavior of user logic

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants