As a performance lead, how would you set and enforce frame and tick budgets across several target platforms and a dedicated game server?
answer
- weakest hardware sets the ceiling
- budget lines with owners
- worst-case scenarios, not averages
- automated runs, noise-aware alerts
- tick time at peak player count
basics
~20 sDerive each platform's budget from its target rate, keep headroom, split it into per-system millisecond lines with owners, validate worst-case scenes on reference hardware, and enforce with automated runs that flag regressions above noise. Set the server's tick budget at peak load.
solid answer
~50 sI start from the target rate per platform and convert it to milliseconds, with headroom, then split it into budget lines (gameplay, physics, AI, streaming, UI, audio on the CPU; passes on the GPU) each with an owner. Shared content is usually held to the weakest supported hardware. Budgets are validated on worst-case scripted scenarios on reference kits, reported as percentiles and maxima, and enforced by nightly or per-change automated runs that alert only on regressions larger than measured run-to-run noise, plus play-test telemetry. For a dedicated server ticking at 30 Hz the budget is 33.3 ms at peak player count, measured with bots; if it overruns, the choices are optimising, lowering the tick rate, capping players per instance or splitting the simulation. The judgment calls are how hard the gate is, who owns regressions and what the hardware farm is worth.
go deeper
Recall that every platform and the server have their own millisecond budget, derived from their target rate.
Explain how a budget is split into per-system lines and why headroom is kept below the full frame time.
Show how budgets are validated on worst-case scenarios and reference hardware, and how a regression is traced to a budget line and its owner.
Own the trade-offs: how hard the gate is against noisy measurements, who owns regressions, what the hardware farm costs, and whether content scales per platform or follows the weakest one.
## From target rate to budgets per platform A lead starts from the product decision, the target rate on each platform, and turns it into numbers people can own. Each platform gets its own frame budget, `1000 / rate`, and the weakest supported hardware usually sets the ceiling for shared content, because content is shared across platforms while hardware is not. The total is split into **budget lines**, each with an owner. An illustrative split of a 60 Hz client's main thread: | Line | Budget (ms) | |---|---| | Gameplay and scripting | 3.5 | | Physics | 3.0 | | AI | 2.5 | | World update and streaming | 2.0 | | UI | 1.0 | | Audio | 0.5 | | Engine and other | 2.5 | | **Total** | **15.0** | | Headroom to 16.7 | 1.7 | The GPU gets its own split per pass, and any render-preparation threads get theirs. The figures are a scenario's, not a recommendation: the right split depends on the game. Memory budgets are a separate set of lines, owned with memory management. ## Measure the case that breaks, not the typical one - Pick **worst-case representative scenarios**: the densest fight, the busiest crowd, fast traversal while the world streams in, the heaviest effects. - Validate on the **weakest supported hardware**, or the reference kit for each platform, not on development workstations. - Report **per-scenario percentiles and maxima**, not averages, so hitches count against the budget. - Keep **headroom**: content grows after a budget is set, and thermals, background work and patches eat into it. ## Enforcement machinery 1. **Automated performance runs** on fixed reference hardware, nightly or per change, replaying the same camera paths and scripted scenarios. 2. **Per-line reports**: each budget line's milliseconds per scenario, trended over builds, with an owner named next to each line. 3. **Regression detection above noise**: measure run-to-run variance first, repeat runs, and alert only when a change exceeds it; otherwise the system cries wolf and people stop reading it. 4. **Escalation rules**: who fixes a regression, by when, and whether it blocks a merge or only a milestone. 5. **Field telemetry** from play tests or live players: frame-time percentiles and hitch counts per hardware tier, which catch what scripted runs miss. ## The server's tick budget A dedicated server ticking at a fixed 30 Hz has 33.3 ms per tick, and its tick time grows with load: players, projectiles, AI agents, and sometimes faster than linearly when systems compare entities pairwise. A server whose tick overruns at peak cannot keep its rate; what the loop then does is a game-loop question. So: - measure tick time against player count with bots, up to and beyond the design's peak; - budget at peak with margin, and treat tick time per player as a line item; - when peak overruns, choose among optimising the hot systems, lowering the tick rate (cheaper per second, but coarser simulation and staler updates for clients), capping players per instance (more instances, more hosting cost), or splitting the simulation across processes. Hosting density is another lever: how many matches share a machine decides how much CPU each tick really has. ## The judgment calls a lead owns - **Strictness:** whether a budget regression blocks a merge or only opens a ticket. Hard gates catch regressions early but slow everyone down when the measurement is noisy. - **Ownership:** budgets owned by the system teams scale; budgets owned only by a central performance team turn that team into a bottleneck. - **Cost:** a farm of reference devices and the people who keep it honest cost real money; the alternative is finding regressions late, near certification or launch. - **Platform priority:** whether to hold all content to the weakest platform or scale it per platform, at the price of extra content work per tier. - **Rate choice:** 30 or 60 Hz on a platform, or a higher or lower server tick, trades responsiveness against how much work fits in each frame or tick.
- Nightly performance runs flag a 0.4 ms regression on one line, then clear the next night. How do you deal with that?Treat it as noise until proven otherwise: measure the run-to-run variance on that hardware, repeat runs and compare medians, and alert on sustained trends across several builds rather than single nights. Reduce noise at the source by fixing clocks and disabling background tasks on the test kits.
- A dedicated server's 30 Hz tick takes 40 ms at peak player count. What are the options and their costs?Optimise the systems that grow with players, often pairwise checks; lower the tick rate, trading simulation detail and update freshness for headroom; cap players per instance, which costs more hosting; or split the simulation across processes, which costs engineering complexity. Measure tick time per player first.
- One frame budget for all platforms is enough if the fastest platform meets it.
- Budgets checked on average gameplay protect the worst-case scenes.
- Performance is checked once, in a dedicated pass before release.
- A server tick budget measured at typical load also covers peak load.
- Every small regression must block the merge, regardless of measurement noise.