Lesson 6 of 6
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.
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
1Who 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.
Which device should a small team choose as its baseline for testing?
Answer
An inexpensive Android phone with 3 or 4 GB of RAM. Most players are on lower-spec Android devices. If the game holds up on one of those, it holds up almost everywhere.
Open this step in lesson mode · Link to this step · This confused me
2Simulate 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:

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.

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 each question to where you can answer it.
Answer
Does the Swing button sit under the right thumb?: Device simulation in Studio; Does the drill stutter after 15 minutes of play?: A real phone; Does the client run out of memory?: A real phone; Does the shop text fit a narrow screen?: Device simulation in Studio. Simulation fakes the screen and input, not the CPU, GPU, memory or heat. Thermal throttling only shows up on a device after sustained play.
Open this step in lesson mode · Link to this step · This confused me
3Add 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
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.
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.
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.
On the 3G preset the swing animation is instant but the stun flash is late. Why the difference?
Answer
The client plays the swing itself, while the hit is decided by the server's raycast after the Swing remote arrives. Anything the client can show by itself feels instant. Anything the server decides waits for outbound plus inbound delay, which is why responsive games show local feedback first and let the server confirm.
Open this step in lesson mode · Link to this step · This confused me
4Measure on the phone
The MicroProfiler and the Developer Console both run on phones1:
- Open the Developer Console from the in-game menu (or
/consolein 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
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.
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.
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.
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.
Open this step in lesson mode · Link to this step · This confused me
5Memory 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.
MapBuilder gives each of the six pads one PointLight and one ParticleEmitter. How many instances is that, counting the pads themselves?
Answer
18 instances. 6 pads × 3 instances (pad, light, emitter) = 18. Each coin adds more while it exists.
Open this step in lesson mode · Link to this step · This confused me
6Instance 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:
| Property | What it does | Guidance |
|---|---|---|
StreamingMinRadius | Area streamed in first | Keep the default 64 so the engine can scale down on low-end devices |
StreamingTargetRadius | Furthest area streamed in | Roblox 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 |
StreamOutBehavior | When far parts are removed | LowMemory (default) only under memory pressure; Opportunistic removes beyond the target radius anyway |
StreamingIntegrityMode | What happens if a player outruns the stream | PauseOutsideLoadedArea is recommended |
ModelStreamingBehavior | How ordinary models stream | Improved 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.
With StreamingEnabled on, which of these can be missing on a client when its script runs?
Answer
A part in Workspace.Yard far from the player; The drone model in Workspace, while it is on the far side of the yard. Only Workspace content streams. ReplicatedStorage is sent whole. A client must treat any Workspace part as possibly absent.
Open this step in lesson mode · Link to this step · This confused me
7Model 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.PersistentLoadedevent 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:
-- 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 each model to the streaming mode that fits.
Answer
The drone: a client script reads its root and health bar together: Atomic; Hundreds of decorative crates around the yard: Nonatomic; A small set of spawn markers every client script needs from the start: Persistent; A personal plot model only its owner must always see: PersistentPerPlayer. Atomic keeps a model whole, Nonatomic is the cheap default for scenery, Persistent never streams out (wait for PersistentLoaded before a script reads it), and PersistentPerPlayer is persistent for chosen players only.
Open this step in lesson mode · Link to this step · This confused me
8Where 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.
A player stands far from the drone, so it has streamed out on their client. Can the drone still damage another player?
Answer
Yes; the server simulates the whole world, and its distance check does not depend on any client. Streaming is per client. The server keeps every instance and runs every rule, so the drone behaves the same whoever can see it.
Open this step in lesson mode · Link to this step · This confused me
9Texture 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.
local function cost(w, h)
return (w * h) / (512 * 512)
end
for _, size in { {1024, 1024}, {256, 256}, {2048, 2048} } do
print(size[1] .. "x" .. size[2] .. " costs " .. cost(size[1], size[2]) .. " x a 512 texture")
end
1024x1024 costs 4 x a 512 texture
256x256 costs 0.25 x a 512 texture
2048x2048 costs 16 x a 512 textureDraw 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.
Forty crates use the same model, but the artist uploaded it eight times with different asset ids. What reduces draw calls most?
Answer
Point all forty crates at one mesh id and one texture, so the engine can instance them. Identical asset ids let the engine draw many copies in few calls. Compressing the file changes nothing in memory, and unique colours on separate textures break instancing.
Open this step in lesson mode · Link to this step · This confused me
10A budget sheet
Other ways pros do this
| Option | What it is | When pros pick it | Trade-offs |
|---|---|---|---|
| Instance streaming | The 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 loading | Your 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 places | Split 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 detail | Lower-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. |
Order a mobile performance pass.
Answer
1. Pick a baseline phone and a target frame rate 2. Check the layout in Studio's device simulation 3. Measure frame time and memory on the baseline phone 4. Fix the largest cost: streaming, textures, instances or draw calls 5. Measure again on the same phone. The budget comes first, simulation catches layout early, the real device gives the numbers, and the second measurement proves the fix.
Open this step in lesson mode · Link to this step · This confused me
11Challenges
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
Hints
- Use Performance Stats from the in-game settings menu.
- Take readings at the same spot each time.
A teammate sets StreamingMinRadius to 256 and StreamingTargetRadius to 128. What is wrong?
Answer
The target radius should be larger than the minimum to leave a buffer. The target is the outer edge and the minimum is the inner, high-priority area. The space between them is the buffer. Also, both are non-scriptable.
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
Hints
- Streaming properties are set on Workspace in Studio or in default.project.json, not from scripts.
- DroneService spawns the drone in code, so set ModelStreamingMode where the model is created or in its asset.
- If a client check fails, look for a client script that assumed a Workspace part exists.
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:
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
Hints
- Multiply width by height before you divide.
- Roblox allows equal radii but they leave no buffer, so this challenge's rule treats them as invalid.
- ReplicatedStorage is never streamed.
Open this step in lesson mode · Link to this step · This confused me
12Recap
Recap
- Most players are on low-end Android phones: simulate layout in Studio, measure performance on a real device.
- Streaming sends each client only nearby Workspace content; pick model modes and write client code that waits and copes.
- 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.
Queued for review
- Match each question to where you can answer it.
- With StreamingEnabled on, which of these can be missing on a client when its script runs?
- Match each model to the streaming mode that fits.
- A player stands far from the drone, so it has streamed out on their client. Can the drone still damage another player?
- Forty crates use the same model, but the artist uploaded it eight times with different asset ids. What reduces draw calls most?
Open this step in lesson mode · Link to this step · This confused me