PoBDSDocs
简体中文v1.0.0
POBDS / 11

Scheduling, performance and lockstep

Separate integer simulation from Unity presentation and define a stable decision/execution order.

Separate decisions from execution

Decisions keep evaluating while execution follows the active branch. · Click to view full image

A long-running leaf Action must not stop BDS scoring. Disable automatic ticking when a host scheduler calls the two update phases, so one simulation frame is not processed twice.

C#
// Host-owned stable ordering; AutoTick is disabled.
// frame and deltaMs come from the fixed-step simulation.
foreach (PoBDSCharacterComponent character in characters)
    character.UpdateDecisions(frame, deltaMs);

foreach (PoBDSCharacterComponent character in characters)
    character.UpdateExecution();

Use explicit integer units

QuantityRepresentation
Position / distanceInteger millimeters; squared distance where appropriate.
SpeedMillimeters per second, preserving division remainders.
Time / cooldownInteger milliseconds or logic frames.
RatiosPermille or ten-thousandths; state the denominator.
RandomnessFixed seed and stable call order; Random Integer includes Min and Max.

What is not automatically deterministic

Unity Transform, Vector3, Quaternion, physics and float operators remain floating-point boundaries. Integer BDS scores alone do not make an entire game deterministic across devices.

The host still needs stable Actor IDs, inputs, random state, collision/navigation results, overflow rules and checksums. Switching candidates may invoke Enter. If all Actors must observe one frame snapshot, use snapshots or buffered commands instead of reading earlier Actors’ intermediate writes.

Keep complex graphs responsive

  • Discover and cache reflection members before the hot path.
  • Throttle world-wide perception with events or fixed intervals.
  • Avoid reevaluating random or side-effecting logic merely to refresh multiple inspectors.
  • Capture detailed traces only for inspected Actors, with a bounded history.
  • Keep continuous work in Action.Update; do not allocate a new behavior object every frame.
Combine keywords with / · Enter opens first result · Esc closes