Batch Adding and Removing Bodies [SYNTH-253], et al.#1424
Draft
azaleacolburn wants to merge 6 commits into
Draft
Batch Adding and Removing Bodies [SYNTH-253], et al.#1424azaleacolburn wants to merge 6 commits into
[SYNTH-253], et al.#1424azaleacolburn wants to merge 6 commits into
Conversation
azaleacolburn
marked this pull request as draft
July 17, 2026 17:50
azaleacolburn
marked this pull request as ready for review
July 17, 2026 18:26
azaleacolburn
force-pushed
the
colbura/253/optmize-broadphase
branch
from
July 17, 2026 18:55
9d45a77 to
d29b4a0
Compare
azaleacolburn
force-pushed
the
colbura/253/optmize-broadphase
branch
from
July 17, 2026 20:39
d29b4a0 to
36950f8
Compare
[SYNTH-253][SYNTH-253] & [SYNTH-168]
[SYNTH-253] & [SYNTH-168][SYNTH-253], et. al.
[SYNTH-253], et. al.[SYNTH-253], et al.
azaleacolburn
marked this pull request as draft
July 20, 2026 14:43
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Task
SYNTH-168 (Symptom)
SYNTH-191 (Symptom)
SYNTH-253 (Cause)
Symptom
Spawning fields rapidly causes Jolt to crash. According to Jolt documentation, this can happen when there are too many bodies in the broadphase tree arranged in an unoptimized manner.
Solution
According to the Jolt documentation, there are two ways to ensure optimization, the first is to batch adding bodies, so they can be added and arranged in a more efficient manner. The second is to call
OptimizeBroadPhase()on the jolt body interface. There's significant overhead to the second option, and its not recommended with single-threaded Jolt, so instead, we batch adding bodies of aMirabufSceneObject.Turns out, we actually do need to call
OptimizeBroadPhase()anyway, to reset the broad phase tree structure. This means that this PR probably doesn't make spawning mirabuf scene objects any faster, but should stop spawning fields from crashing and speed up fields with lots of bodies.Source
Verification
Before merging, ensure the following criteria are met: