Mobile: streaming, memory and draw budgets

Make a Roblox game run on low-end phones. Learn instance streaming and its model modes, test in Studio's device simulation and on a real phone, and budget memory, instances, textures and draw calls.

Lab lesson, about 80 minutes, 12 steps

By the end you can

  • Choose StreamingEnabled settings and a ModelStreamingMode for each kind of model, and write client code that survives streaming
  • Test a layout in Studio's device simulation, then measure frame time and memory on a real low-end phone
  • Read memory by category and count instances, and explain why texture memory follows pixels, not file size
  • Reduce draw calls by reusing identical meshes and textures

Before this: Performance: MicroProfiler, memory, network, Input everywhere, part 1: keyboard, gamepad, touch and accessibility

Step 1 of 12

Who actually plays

Your development machine is not your player. Roblox's own guidance says Android is roughly 65% of a typical game's player base, and about 60% of those Android players have 2 to 4 GB of RAM1. Over half of all players use devices that score between 10,000 and 20,000 on the Passmark benchmark. A game that is smooth on a gaming PC can stutter, overheat or crash on the phone most of your players hold.

Choose one

Which device should a small team choose as its baseline for testing?

Which device should a small team choose as its baseline for testing?

Press 1 to 4 to choose, Enter to check.

Link to this step · This confused me

Step 2 of 12

Simulate first, then hold a real phone

Studio can pretend to be a device. Studio's Device Simulator toolbar previews screen size, pixel density, the on-screen keyboard and touch input, groups phones into flagship, mid-range and entry level, and pairs with the Controller Emulator2:

Roblox Studio
Studio's Device Simulator toolbar set to an iPhone 13 in landscape, with the phone, desktop, console and VR category buttons next to the device chip, the Rotate button on the right, and Beacon Yard at sunset inside the phone frame.

Select a numbered pin, or a row below, to read what it marks.

The Device Simulator toolbar: pick the category and device on the left, rotate the phone on the right.

Roblox Studio
Beacon Yard in Studio's Device Simulator toolbar, showing an iPhone 17 Pro viewport with a touch thumbstick, a Swing button and a scaled-down HUD.

Select a numbered pin, or a row below, to read what it marks.

Beacon Yard in Studio's Device Simulator: the toolbar picks the phone, network and quality presets, while the viewport shows the scaled HUD, thumbstick and Swing touch button.

Simulation answers layout questions: does the HUD fit, can a thumb reach Swing, does text wrap. It cannot answer performance questions. Studio runs the client and the server on your powerful machine, so frame time, memory pressure, heat and cellular latency are all wrong1. Latency is the one you can add back, in the next step.

Match the pairs

Match each question to where you can answer it.

Link to this step · This confused me

Step 3 of 12

Add a phone's lag in Studio

One part of a phone you can fake: its connection. The Network Simulator adds latency, jitter and packet loss between a playtest client and the server, separately for each direction. Open Test > Device Simulator and choose Network on its toolbar. It changes Studio playtests only, never live players3.

Beacon Yard's wrench is a good test. The client plays the swing at once and sends Swing to the server; the server casts the ray and stuns the drone, and only that result comes back:

		playSwing(character)
		swing:FireServer(origin, direction)

Build along

m14-ship

  1. With Device Simulator on (Test menu), open the Network pill, pick the Bad Connection (3G) preset and select Apply. The docs list it as 150 ms in and 180 ms out, plus jitter and 0.5% loss.

    You should see The Network pill above the viewport shows 3G after you select Apply.

  2. Press Play, start a drill and hit the drone a few times.

    You should see The swing animation plays as soon as you click, but the drone's stun flash arrives noticeably later, and the drone you see trails the one the server checks.

  3. Set all six values to 0, select Apply, and swing again during the same playtest.

    You should see With every value at 0, the flash follows the swing almost at once. Your notes describe the difference in one sentence.

Choose one

On the 3G preset the swing animation is instant but the stun flash is late. Why the difference?

On the 3G preset the swing animation is instant but the stun flash is late. Why the difference?

Press 1 to 4 to choose, Enter to check.

Link to this step · This confused me

Step 4 of 12

Measure on the phone

The MicroProfiler and the Developer Console both run on phones1:

  • Open the Developer Console from the in-game menu (or /console in chat) and read Memory on the client.
  • Turn on Performance Stats in the settings menu for an overlay of frame rate, memory and ping.
  • Capture MicroProfiler frames on the device and read them in the web UI on your computer4.
  • Play for 10 to 15 minutes. A frame rate that slowly sinks usually means the phone is throttling from heat.

Build along

m06-drone-wrench

  1. If you have not already published a private copy of Beacon Yard, use File > Publish to Roblox (the next lesson covers publishing in full). Then install Roblox on a low-end Android phone, sign in with the same account, and join your private Beacon Yard place.

    You should see The phone joins your private copy of Beacon Yard; you see the yard and the touch controls.

  2. Open the in-game menu, then Settings, and turn on Performance Stats.

    You should see An overlay shows FPS, memory and ping. Write down all three during Idle.

  3. Start a drill at the beacon and read the overlay again.

    You should see Three more readings, taken during a drill, with the drone chasing you. Note any drop.

  4. Keep playing drills for 15 minutes and record the readings every 3 minutes.

    You should see A table of FPS and memory every few minutes, and a sentence on whether the frame rate drifted down.

Link to this step · This confused me

Step 5 of 12

Memory and instance counts

On a 3 GB phone, the operating system and other apps take much of the memory before Roblox starts. When a client runs out, it crashes. Open the Developer Console (F9 or /console) and choose the Memory tab to split usage by category: PlaceMemory is what you built (instances, terrain, loaded assets) and PlaceScriptMemory is what your scripts hold5.

Every instance costs memory on every client that has it: a part, a light, a particle emitter, a sound. Beacon Yard builds its whole yard in code, so you can count from source: walls, six pads with a light and an emitter each, a beacon, a shop, signs, gates, crates. That is small. The danger is a map with ten thousand decorative parts, all loaded at once.

Work it out

MapBuilder gives each of the six pads one PointLight and one ParticleEmitter. How many instances is that, counting the pads themselves?

instances

Link to this step · This confused me

Step 6 of 12

Instance streaming

Instance streamingInstance streamingThe engine sends each client only the Workspace content near that player, and can remove distant content when memory is short.Think of it as stage sets built as you walk. lets the engine send each client only the parts of Workspace near that player, and remove distant parts when memory is short. It is controlled by Workspace.StreamingEnabled, which is on by default for new places created in Studio and cannot be set from a script6.

With streaming on, the world is a stage set built as you walk. Pieces near you are put up; pieces far behind you may be taken down when the stage gets crowded.

Think of it as Stage sets built as you walk

Both sidesRemember: Building the world near the player (chunks and StreamingEnabled) is stage sets built as you walk.

The settings that matter on Workspace, all non-scriptable6:

PropertyWhat it doesGuidance
StreamingMinRadiusArea streamed in firstKeep the default 64 so the engine can scale down on low-end devices
StreamingTargetRadiusFurthest area streamed inRoblox says to keep it larger than the minimum, so there is a buffer. Equal radii are allowed but leave no buffer and can cause network pauses
StreamOutBehaviorWhen far parts are removedLowMemory (default) only under memory pressure; Opportunistic removes beyond the target radius anyway
StreamingIntegrityModeWhat happens if a player outruns the streamPauseOutsideLoadedArea is recommended
ModelStreamingBehaviorHow ordinary models streamImproved is recommended

At m14-ship, Beacon Yard turns streaming on explicitly in default.project.json:

    "Workspace": {
      "$className": "Workspace",
      "$properties": {
        "Gravity": 196.2,
        "StreamingEnabled": true,
        "StreamingMinRadius": 128,
        "StreamingTargetRadius": 512

Large open-world maps usually keep the default StreamingMinRadius of 64 so low-end devices can shrink their loaded bubble when memory gets tight. Beacon Yard's walled yard is compact and has few parts, so m14-ship sets 128 and 512 to keep the immediate arena loaded around the player without pop-in.

Choose all that apply

With StreamingEnabled on, which of these can be missing on a client when its script runs?

With StreamingEnabled on, which of these can be missing on a client when its script runs?

Press 1 to 4 to choose, Enter to check.

Link to this step · This confused me

Step 7 of 12

Model streaming modes

Each Model chooses how it streams with ModelStreamingMode6:

  • Nonatomic (default): parts arrive one by one, so a script can see half a model.
  • Atomic: the whole model arrives and leaves together. Use it for things a client script reads as a unit, such as a drone with its root and its health bar.
  • Persistent: sent to every client soon after join and never streamed out. A client script that reads one straight away should wait for the Workspace.PersistentLoaded event first. Use it rarely: for a few parts client code must always reach.
  • PersistentPerPlayer: persistent only for players added with Model:AddPersistentPlayer().

And client code must ask, not assume:

luau
-- Not this: errors if the gate has not streamed in yet
local gate = workspace.Yard.GateLeft
 
-- This: waits a bounded time, then copes
local yard = workspace:WaitForChild("Yard", 10)
local gate = yard and yard:FindFirstChild("GateLeft")
if gate == nil then
	return -- show nothing, try again when it streams in
end

Beacon Yard's client scripts never reach into Workspace.Yard. They read the round from workspace attributes, the remotes from ReplicatedStorage and the HUD from PlayerGui, which is why the game is already safe to stream.

Match the pairs

Match each model to the streaming mode that fits.

Link to this step · This confused me

Step 8 of 12

Where the stage-set picture breaks

Where does it break?“Stage sets built as you walk” is a good picture of building the world near the player (chunks and streamingenabled). Where does it stop being true?

It breaks here. There are two crews. Your generator decides what exists on the server; StreamingEnabled separately decides which of it each client has received, so a piece can exist on the server and still be missing on a client.

The true model. Chunked generation is your code creating instances on the server near players. StreamingEnabled is the engine sending only nearby instances to each client. Client code must handle parts that are not streamed in yet, whatever created them.

The stage picture suggests the set exists only where the audience is. In Roblox the server always has the whole world. The drone is fully simulated on the server even when no client has it streamed in, its damage check runs, and RoundService still writes workspace attributes every client receives. Streaming changes what each client holds, never what the server decides.

Choose one

A player stands far from the drone, so it has streamed out on their client. Can the drone still damage another player?

A player stands far from the drone, so it has streamed out on their client. Can the drone still damage another player?

Press 1 to 4 to choose, Enter to check.

Link to this step · This confused me

Step 9 of 12

Texture memory and draw calls

Two graphics budgets matter most on phones.

Texture memory follows the number of pixels, not the file size. A 1024 × 1024 texture uses four times the memory of a 512 × 512 one, and compressing the PNG before upload does not help, because Roblox transcodes images to a fixed format7. Built-in materials cost far less memory than custom textures8.

Luau
Ctrl Enter runs the cell. Checked against the expected output

Draw calls are the instructions the engine sends the GPU for each thing it draws, and each one has overhead. The engine collapses identical meshes with identical textures into one draw call (instancing), so six copies of the same pad mesh are cheap and six slightly different uploads of it are not. In Studio, inspect draw calls under Render Stats > Timing; in the Roblox client, press Shift+F2 to open Render Stats7.

Choose one

Forty crates use the same model, but the artist uploaded it eight times with different asset ids. What reduces draw calls most?

Forty crates use the same model, but the artist uploaded it eight times with different asset ids. What reduces draw calls most?

Press 1 to 4 to choose, Enter to check.

Link to this step · This confused me

Step 10 of 12

A budget sheet

Other ways pros do this

OptionWhat it isWhen pros pick itTrade-offs
Instance streamingThe engine streams Workspace content per client.Most places, especially large maps.Client code must cope with missing parts; some models need Atomic or Persistent.
Manual loadingYour code clones areas in and out from ServerStorage or ReplicatedStorage.Distinct areas such as interiors, or older games built before streaming matured.More code, and you rebuild what the engine already does.
Separate placesSplit the world into places and teleport between them.Very different areas, such as a lobby and a match.Loading screens and teleport handling; covered in the lobby lesson.
Level of detailLower-detail models at distance, such as Model.LevelOfDetail.Large models seen from far away.Art work up front; does not reduce what is in memory up close.
Put in order

Order a mobile performance pass.

  1. Fix the largest cost: streaming, textures, instances or draw calls
  2. Measure frame time and memory on the baseline phone
  3. Check the layout in Studio's device simulation
  4. Measure again on the same phone
  5. Pick a baseline phone and a target frame rate

Link to this step · This confused me

Step 11 of 12

Challenges

Level 1, Apprentice

Challenge

Measure Beacon Yard on the weakest phone you can borrow.

Start from
The game at milestone m06 (download)

Done means

  • A table of FPS and memory readings from a real phone, during Idle and during a drill
  • The phone's model and RAM are written next to the table

Meet the criteria above, then record your own result. No test grades this check.

Choose one

A teammate sets StreamingMinRadius to 256 and StreamingTargetRadius to 128. What is wrong?

A teammate sets StreamingMinRadius to 256 and StreamingTargetRadius to 128. What is wrong?

Press 1 to 4 to choose, Enter to check.

Level 2, Builder

Challenge

Turn streaming on in a copy of the yard and prove nothing broke.

Start from
The game at milestone m06 (download)

Done means

  • StreamingEnabled is on in a test copy of the place, with StreamingIntegrityMode set to PauseOutsideLoadedArea
  • The drone model is Atomic
  • The full playtest suite still passes

Meet the criteria above, then record your own result. No test grades this check.

Level 3, Professional

Challenge

Fix the three budget rules in challenges/mobile_budgets_work.luau on m14-ship. Press Play and run this in the server command bar:

luau
game.ServerScriptService.RunGameTests:Invoke("mobile-budgets")
Start from
The game at milestone m14 (download)
Grade it
In Studio, press Play, then run game.ServerScriptService.RunGameTests:Invoke("mobile-budgets") in the server command bar. Copy the pass code from Output.

Done means

  • textureCost returns the pixel count relative to 512 × 512
  • radiiValid follows the stricter Beacon Yard rule: equal radii are invalid, not only inverted ones
  • streamingCanHide is true only for Workspace with streaming on
  • challenges/mobile-budgets.luau prints TEST PASS for all ten cases

The Course Runner prints this code when the test passes.

Link to this step · This confused me

Step 12 of 12

Recap

Recap

  1. Most players are on low-end Android phones: simulate layout in Studio, measure performance on a real device.
  2. Streaming sends each client only nearby Workspace content; pick model modes and write client code that waits and copes.
  3. Texture memory follows pixels, instances cost memory on every client, and identical meshes and textures save draw calls.

Building the world near the player (chunks and StreamingEnabled) is stage sets built as you walk, until there are two crews. Your generator decides what exists on the server; StreamingEnabled separately decides which of it each client has received, so a piece can exist on the server and still be missing on a client.

Next Publishing: versions, rollback, store page

Link to this step · This confused me