69 · Performance · 2D and 3D

Time slicing

Spread big jobs over several frames.

Some work is too big for one frame: 200 enemies re-pathing at once, rebuilding a navmesh, generating a chunk. Doing it all on the same frame causes a spike. Time slicing puts the work in a queue and does a fixed amount, or a fixed number of milliseconds, each frame.

←↑↓→ or WASD moveSpace wake the horde · T sliced on/offTap Wake

Try this: Press Wake: 60 sleeping slimes all plan a path to you in one frame and the game freezes. Switch to Sliced and wake them again: they wake in a wave, no freeze.

Worst frame 0 msHits 0

Press Wake (Space) and watch the frame.

Prompt bit

Works for 2D or 3D in any engine (Unity, Unreal, Godot, web). Paste the short one for a quick fix, or the detailed one when you want it done properly.

Time-slice heavy work: queue requests such as pathfinding, process jobs each frame until 0.002 s has passed, serve nearby or visible agents first, and let waiting agents keep their old path instead of freezing until their new result arrives.

39 words · one sentence to paste as is

Where it's used

Common mistakes

Doing all requests on the frame they are made, slicing by count when jobs vary in cost, agents frozen while waiting for results, starving low-priority jobs forever, and every agent updating on the same frame.

Writing this with an AI assistant? See our best AI coding assistants for game developers.

Missing a concept? Request one.

Related concepts

New concepts, in your inbox.

One short email when we add new concepts, plus our weekly roundup of AI tools for game devs. Unsubscribe any time.