Skip to content

feat(physics): allow gamepieces to sleep & adding simulation debt into timestep#1421

Open
Dhruv-0-Arora wants to merge 10 commits into
devfrom
darora1/257/timestepping-and-sleep
Open

feat(physics): allow gamepieces to sleep & adding simulation debt into timestep#1421
Dhruv-0-Arora wants to merge 10 commits into
devfrom
darora1/257/timestepping-and-sleep

Conversation

@Dhruv-0-Arora

@Dhruv-0-Arora Dhruv-0-Arora commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Important

The way that gamepieces go to sleep when the field first spawns is something we should look into:
Currently, they are set to sleep (in this PR) however the MirabufSceneObject instantly wakes them up to move them to their desired location. This will tank performance for the first ~5 seconds while the gamepieces wait to go back to sleep.

SYNTH-257


Before merging, ensure the following criteria are met:

  • All acceptance criteria outlined in the ticket are met.
  • Necessary test cases have been added and updated.
  • A feature toggle or safe disable path has been added (if applicable).
  • User-facing polish:
    • Ask: "Is this ready-looking?"
  • Cross-linking between Jira and GitHub:
    • PR links to the relevant Jira issue.
    • Jira ticket has a comment referencing this PR.

timestepping: adding simulation timedebt for when FPS dropping

Signed-off-by: Dhruv Arora <dhruv.arora1@autodesk.com>
Signed-off-by: Dhruv Arora <dhruv.arora1@autodesk.com>
@Dhruv-0-Arora Dhruv-0-Arora self-assigned this Jul 17, 2026
@Dhruv-0-Arora
Dhruv-0-Arora requested review from a team as code owners July 17, 2026 00:15
@Dhruv-0-Arora
Dhruv-0-Arora force-pushed the darora1/257/timestepping-and-sleep branch 2 times, most recently from ab6c1dd to 3eb1cd4 Compare July 17, 2026 00:55
@Dhruv-0-Arora Dhruv-0-Arora mentioned this pull request Jul 17, 2026
Comment thread fission/src/systems/physics/PhysicsSystem.ts
Signed-off-by: Dhruv Arora <dhruv.arora1@autodesk.com>
@Dhruv-0-Arora
Dhruv-0-Arora force-pushed the darora1/257/timestepping-and-sleep branch from 3eb1cd4 to 1b0a76d Compare July 17, 2026 01:15
Signed-off-by: Dhruv Arora <dhruv.arora1@autodesk.com>
@Dhruv-0-Arora
Dhruv-0-Arora force-pushed the darora1/257/timestepping-and-sleep branch from 9788651 to 5c391f6 Compare July 17, 2026 01:26

@AlexD717 AlexD717 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drag Mode is broken

Fission._.Synthesis.-.Google.Chrome.2026-07-17.09-08-48.mp4

It appears that you can't use drag mode for objects that are asleep, but the force is still applied once they wake up.

In addition, jittering is a bit worse on my MacBooks 120hz monitor, but still happens on my home desktop (weaker computer and 60hz monitor).

@rutmanz rutmanz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screen.Recording.2026-07-17.at.10.13.24.AM.mov

Like @AlexD717 noticed, Dozer jitters now in a way it doesn't on dev (this is on my work laptop)

// driver stiffness independent of construction-time frame rate.
export function getLastDeltaT(): number {
return lastDeltaT
return STANDARD_SIMULATION_PERIOD

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should probably be removed. This name implies it is the last delta t and that it changes, when it is actually a constant (that can be referenced directly where this is used)

Comment thread fission/src/systems/physics/PhysicsSystem.ts Outdated
Comment on lines 110 to 112
export function getLastDeltaT(): number {
return lastDeltaT
return STANDARD_SIMULATION_PERIOD
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We were doing this before? I thought lastDeltaT was supposed to be calculated

Comment thread fission/src/systems/physics/PhysicsSystem.ts Outdated
Comment thread fission/src/systems/physics/PhysicsSystem.ts Outdated
body.GetID(),
rn.isGamePiece ? JOLT.EActivation_DontActivate : JOLT.EActivation_Activate
)
if (!rn.isGamePiece) body.SetAllowSleeping(false)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This means that 2024 field performance will still be terrible? Why should only game pieces be allowed to sleep?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you mean? In addition, the 2024 field performance went from 10 fps for me to 110 fps.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@azaleacolburn, I think the majority of 2024 fields performance loss is a result of us having notes in the loading station and simulating them.

Screenshot 2026-07-20 092643

This also explains the performance increase from putting the game objects to sleep.

Comment thread fission/src/systems/physics/PhysicsSystem.ts
@Dhruv-0-Arora

Copy link
Copy Markdown
Collaborator Author

@AlexD717 @rutmanz I'm not able to reproduce the robot jitter that you experienced. Does dozer jitter when you initially spawn it for the first time on an empty field?

Dhruv-0-Arora and others added 5 commits July 17, 2026 18:15
Co-authored-by: Azalea Colburn <62953415+azaleacolburn@users.noreply.github.com>
Signed-off-by: Dhruv Arora <dhruv.arora1@autodesk.com>
Signed-off-by: Dhruv Arora <dhruv.arora1@autodesk.com>
Signed-off-by: Dhruv Arora <dhruv.arora1@autodesk.com>
Signed-off-by: Dhruv Arora <dhruv.arora1@autodesk.com>
@AlexD717

Copy link
Copy Markdown
Member

@AlexD717 @rutmanz I'm not able to reproduce the robot jitter that you experienced. Does dozer jitter when you initially spawn it for the first time on an empty field?

For me, this really only happens on the 2026 field after I go in and push some balls around (once the fps recovers the jittering starts to slow down and eventually goes away). If you are struggling to reproduce it try throttling your CPU (it makes the jittering a lot worse for me).

Signed-off-by: Dhruv Arora <dhruv.arora1@autodesk.com>
@Dhruv-0-Arora
Dhruv-0-Arora force-pushed the darora1/257/timestepping-and-sleep branch from f80dac9 to 785f09b Compare July 20, 2026 23:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants