The network budget: measure, batch, pack

Put Beacon Yard's network traffic on a budget. Measure KB/s per player, turn the drone's per-frame PivotTo into a 10 Hz bit-packed UnreliableRemoteEvent stream with client interpolation, and compare hand-packed buffers with Blink and Zap.

Lab lesson, about 85 minutes, 10 steps

By the end you can

  • Measure what each system sends per player per second, and keep it in a budget table
  • Replace the drone's per-frame PivotTo with a 10 Hz bit-packed snapshot on an UnreliableRemoteEvent
  • Draw remote objects smoothly with snapshot interpolation and a render delay
  • Judge hand-packed buffers against schema-generated net code such as Blink and Zap

Before this: Performance: MicroProfiler, memory, network, Remotes: events, functions, unreliable, buffers

1One drone, sixty updates a second

Open DroneService at m14-ship and find the function that moves the drone. It runs on every Heartbeat, the engine's per-frame signal, for as long as a drill is active:

local function moveDrone(drone: Drone, dt: number)
	local root = drone.root
	local pos = Vector3.new(root.Position.X, HOVER_Y, root.Position.Z)
	local rotation = root.CFrame.Rotation
	local target = nearestLivingRoot(root.Position)
	if target then
		local flat = Vector3.new(target.Position.X - pos.X, 0, target.Position.Z - pos.Z)
		local distance = flat.Magnitude
		if distance > STOP_DISTANCE then
			local travel = math.min(Config.DRONE_SPEED * dt, distance - STOP_DISTANCE)
			local direction = flat.Unit
			pos += direction * travel
			rotation = CFrame.lookAt(Vector3.zero, direction).Rotation
		end
	end
	drone.model:PivotTo(CFrame.new(pos) * rotation)
Figure 1.1

The last line is the cost. PivotTo sets the CFrame of a server-owned part in Workspace, and every property change on a replicated instance is sent to every client that has it. Roblox's performance guide names the same pattern as a common problem with server-side TweenService: the tweened property "is replicated to each client every frame"1. PivotTo on Heartbeat is a hand-written version of that.

The Performance: MicroProfiler, memory, network lesson already found this: the drone is the yard's biggest stream. This lesson fixes it, and puts every other system on a network budgetNetwork budgetA table of how many bytes per second each system may send to each player, measured and kept up to date.Think of it as a spending plan for bandwidth: every system gets a line, and the total has to fit. while it is at it.

A drill lasts Config.ROUND_SECONDS = 40, and the server's Heartbeat runs about 60 times a second. How many drone position updates does each client receive in one drill, if every Heartbeat moves the drone?

Answer

2400 updates. 40 seconds at 60 updates a second is 2,400 updates, to every player, for one drone. Ten drones would be 24,000, and nothing a client sees changes faster than its screen.

Open this step in lesson mode · Link to this step · This confused me

2Measure before you change anything

A budget starts with a measurement, so record the drone's cost before you touch it. Roblox gives you four views, and each answers a different question2:

  • Performance Stats (Ctrl+Alt+F7 in Studio) is a toolbar with memory, CPU, GPU, network data sent and received, and ping.
  • Network debug stats (Shift+F3, or Ctrl+Shift+F3 in a Studio test client) shows one client's network numbers, including data ping.
  • The Server Stats tab of the Developer Console shows the average data ping of every player on the server.
  • The MicroProfiler (Ctrl+Alt+F6) can record network traffic into a frame dump. Choose Network: Low or High, save a dump, and open X-Ray / Network: received traffic sits on the top row, sent on the bottom, coloured by physics, data and assets3.

Data ping matters most here. When the server makes replication data faster than the network can send it, the data waits in a queue, and data ping climbs above network ping. That is the symptom of a blown network budget.

Roblox Studio
Studio's Server and Clients test of Beacon Yard at m14-ship during a drill. Client 1's Ctrl+Shift+F3 network debug stats fill the left half of the frame, with incoming around 5.7 KB/s; on the right a sunset yard strip shows the drone and the three test players.
Figure 2.1.

Network debug stats during a drill at m14-ship, one drone, three test clients. This is the baseline.

Match each question to the tool that answers it.

  1. How many bytes did this one frame receive, and was it physics or data?
  2. What is the average data ping of everyone on this live server?
  3. What is my own client's data ping right now?
  4. Roughly how much is this Studio session sending and receiving?
Answer

How many bytes did this one frame receive, and was it physics or data?: MicroProfiler frame dump, X-Ray / Network; What is the average data ping of everyone on this live server?: Developer Console, Server Stats; What is my own client's data ping right now?: Network debug stats, Shift+F3 (Ctrl+Shift+F3 in Studio); Roughly how much is this Studio session sending and receiving?: Performance Stats toolbar. The MicroProfiler shows traffic frame by frame in a saved dump, Server Stats averages every player, Shift+F3 is one client, and Performance Stats gives a quick running total.

Open this step in lesson mode · Link to this step · This confused me

3A budget per player, per system

A network budget is a table with one row per system and three numbers per row: bytes per message, messages per second, and the bytes per second that come out. You pick the total yourself. Roblox does not publish a number to aim for, so studios set one from their own measurements on their weakest target phone, and every new feature has to fit inside it.

Count payload bytes, the data you send. The engine adds its own headers on top, which is one more reason to measure the result in Studio instead of trusting the sum. Run this budget for a future yard with forty drones, comparing three ways to send them. Each version has a 3-byte header; the float version spends 15 bytes a drone (an id, three four-byte floats and a two-byte heading, as in the Remotes: events, functions, unreliable, buffers lesson).

Luau
local BUDGET_KBPS = 10 -- your team's choice for all entity streams together
 
local function kbps(bytesPerMessage: number, perSecond: number): number
	return bytesPerMessage * perSecond / 1000
end
 
local drones = 40
local rows = {
	{ name = "per-frame floats", bytes = 3 + 15 * drones, hz = 60 },
	{ name = "10 Hz floats", bytes = 3 + 15 * drones, hz = 10 },
	{ name = "10 Hz packed", bytes = math.ceil((24 + 50 * drones) / 8), hz = 10 },
}
 
for _, row in rows do
	local cost = kbps(row.bytes, row.hz)
	local verdict = if cost <= BUDGET_KBPS then "ok" else "over"
	print(string.format("%s, %d drones: %.1f KB/s %s", row.name, drones, cost, verdict))
end
Figure 3.1. Run it in the lesson view or in the Studio command bar.

At m15-scale that table is real and enforced. Config.NET_BUDGETS holds bytes per second per player for each system:

	-- Network budget per player, bytes per second, by system (m15).
	-- NetMeter compares each system's measured rate with these.
	NET_BUDGETS = {
		DroneStream = 400,
		PlayerState = 200,
		Feedback = 200,
		RoundState = 50,
	} :: { [string]: number },
Figure 3.2

NetMeter adds up what each system sends, divides by the number of players and compares the rate with its budget. In Play, every five seconds it writes one line per system to an attribute. Read it in the server's command bar: print(game.ServerScriptService.Server:GetAttribute("NetReport")).

During a drill the report reads: DroneStream 96 B/s of 400 / PlayerState 260 B/s of 200 OVER / Feedback 30 B/s of 200 / RoundState 12 B/s of 50. Where do you look first?

  1. PlayerState: it is the only system over its budget, so look for diffs sent too often or carrying too much
  2. DroneStream: it sends the most messages
  3. RoundState: its budget is the smallest
  4. Nowhere: the total of about 400 B/s is under 1 KB/s
Answer

PlayerState: it is the only system over its budget, so look for diffs sent too often or carrying too much. NetMeter's numbers are payload estimates, so confirm the fix with Network Stats afterwards (Shift+F3, or Ctrl+Shift+F3 in a Studio test client). The table finds the system; the engine's own counters confirm it.

Client sideSnapshot interpolation with a render delay is a flipbook artist who stays one page behind the pages the server sends.
In the pictureIn Roblox
A new page from the serverA snapshot packet, ten times a second
Staying one page behindDrawing at now minus the render delay
Drawing the in-between framesBlending position and yaw between the two snapshots around the render time
Throwing away an old page that arrives lateDropping a packet whose sequence number is older than the newest

See the whole analogy cast

Sending ten pictures a second instead of sixty only works if the client fills the gaps. Picture a flipbook artist who receives a new page from the server ten times a second. If they show each page the moment it arrives, the drone jerks. So they stay one page behind: while page 41 is on screen, they already hold page 42 and can draw every in-between frame.

Think of it as A flipbook artist who stays one page behind the pages the server sends

One packed drone takes 10 bytes with its header. What does this print?

local bytes = 10
local perFrame = bytes * 60 / 1000
local tenHz = bytes * 10 / 1000
print(perFrame, tenHz)
  1. 0.6 0.1
  2. 6 1
  3. 0.1 0.6
  4. 600 100
Answer

0.6 0.1. Sending at 10 Hz instead of 60 cuts the cost by six before you pack a single bit. Packing then cuts each message too.

Open this step in lesson mode · Link to this step · This confused me

4Send less often, draw in between

The client keeps the last few snapshots for each drone, each stamped with the time it arrived. On every frame it draws the drone at now minus a render delay, 0.1 s here, one packet interval. That moment almost always falls between two snapshots it already holds, so it blends them: a snapshot interpolationSnapshot interpolationDrawing a remote object a little in the past, blended between the two newest snapshots the client already has.Think of it as a flipbook artist who stays one page behind so every in-between frame can be drawn.. Before the first snapshot it holds the first, after the last it holds the last. It never guesses ahead.

Drawing 0.1 s behindA copper server box sends packed snapshots at 10 Hz to a cyan client buffer box, which feeds a cyan render box that draws 0.1 seconds in the past.10 HzblendDroneServicemoves at 60 HzSnapshotsnewest fewDrawnow - 0.1 s
Figure 4.1. The server sends ten snapshots a second; the client draws between the two it already has.

The render delay is also why a swing can miss. The drone on your screen is about your ping plus 0.1 s behind the server's drone, so a swing that connects on your screen can reach the server after the drone has moved on. The next lesson, Server authority: prediction, rollback, lag-compensated hits, has a simulator for exactly that miss and shows how the server rewinds to judge the swing fairly.

Angles need care. A drone turning from 350 degrees to 10 degrees has turned 20 degrees, through 0. Blend the two numbers directly and the halfway point is 180: the drone spins all the way round for one frame.

The client blends yaw with a plain lerp. What does this print?

local function lerp(a, b, t)
	return a + (b - a) * t
end
print(lerp(350, 10, 0.5))
  1. 180
  2. 0
  3. 360
  4. -170
Answer

180. A plain lerp goes the long way: 180. Take the difference the short way first, (b - a + 180) % 360 - 180, which is +20 here, then add half of it to 350 and wrap: 0.

Fix both functions below. The tests use the same snapshots as the game repo's check.

Luau
local function lerpYaw(a: number, b: number, t: number): number
	-- Take the difference the short way round, then wrap to 0..360.
	return a + (b - a) * t
end
 
type Snap = { t: number, x: number, yaw: number }
 
local function interpolate(snaps: { Snap }, renderTime: number): Snap?
	-- Hold the first before it, the last after it, blend in between.
	return snaps[#snaps]
end
 
local snaps = {
	{ t = 10.0, x = 0, yaw = 350 },
	{ t = 10.1, x = 1.2, yaw = 10 },
	{ t = 10.2, x = 2.4, yaw = 30 },
}
local s = interpolate(snaps, 10.05)
print(s and string.format("x %.2f yaw %.1f", s.x, s.yaw))
Figure 4.2. Run it in the lesson view or in the Studio command bar. The lesson view checks it with tests.

Open this step in lesson mode · Link to this step · This confused me

5Pack the bits

A bufferBufferA fixed block of bytes that you read and write yourself, used to send small, exact payloads.Think of it as a strip of numbered boxes where you decide what goes in each one. lets you choose how many bytes each value takes. buffer.writebits goes further: it writes a value in any number of bits from 0 to 32, at any bit offset, treating the value as an unsigned 32-bit number and keeping only the lowest bits4. To use it, every value must become a whole number in a known range first. That step is quantizationQuantizationTurning a number into a whole count of fixed steps inside a known range, so it fits in a few bits.Think of it as measuring with a ruler marked in sixteenths instead of writing every decimal..

The yard's drone needs far less precision than a float. Here is the layout the game repo's check expects:

FieldRangeStepBits
sequence (header)0 to 65,535, wraps116
count (header)0 to 63 drones18
id0 to 6316
x and z-256 to 255.9375 studs1/16 stud13 each
y0 to 63.875 studs1/8 stud9
yaw0 up to 360 degrees, wraps360/2568
stunnedyes or no1

A drone is 50 bits. One drone with the header is 74 bits, which rounds up to 10 bytes.

Luau
local RANGE, STEP = 256, 1 / 16
 
local function q(value: number, low: number, step: number, bits: number): number
	return math.clamp(math.round((value - low) / step), 0, 2 ^ bits - 1)
end
 
local function pack(seq: number, drones)
	local b = buffer.create(math.ceil((24 + 50 * #drones) / 8))
	buffer.writebits(b, 0, 16, seq % 65536)
	buffer.writebits(b, 16, 8, #drones)
	local at = 24
	for _, d in drones do
		buffer.writebits(b, at, 6, d.id)
		buffer.writebits(b, at + 6, 13, q(d.x, -RANGE, STEP, 13))
		buffer.writebits(b, at + 19, 13, q(d.z, -RANGE, STEP, 13))
		buffer.writebits(b, at + 32, 9, q(d.y, 0, 1 / 8, 9))
		buffer.writebits(b, at + 41, 8, math.round((d.yaw % 360) / 360 * 256) % 256)
		buffer.writebits(b, at + 49, 1, if d.stunned then 1 else 0)
		at += 50
	end
	return b
end
 
local one = pack(1, { { id = 1, x = -17.53, y = 4, z = 18, yaw = 90, stunned = false } })
print("1 drone: " .. buffer.len(one) .. " bytes")
local xBack = buffer.readbits(one, 24 + 6, 13) * STEP - RANGE
print("x -17.53 reads back as " .. xBack)
 
local many = {}
for i = 1, 40 do
	table.insert(many, { id = i, x = i, y = 4, z = -i, yaw = i * 9, stunned = false })
end
print("40 drones: " .. buffer.len(pack(2, many)) .. " bytes")
Figure 5.1. Run it in the lesson view or in the Studio command bar.

The header is 24 bits and each drone is 50 bits. How many bytes does a packet with 40 drones need? (Round up to whole bytes.)

Answer

253 bytes. 24 + 2,000 = 2,024 bits, and 2,024 / 8 = 253 bytes. The float layout needs 603 bytes for the same forty drones.

x is rounded to the nearest 1/16 of a stud. What is the largest error, in studs, that rounding can add to a position inside the encodable range?

Answer

0.03125 studs (within 0.0001). Half of 1/16 is 1/32, about 0.03 studs: far below what a player can see on a 3-stud drone. Clamping is the other half of the rule: a value outside the range lands on the edge instead of wrapping to the far side.

Open this step in lesson mode · Link to this step · This confused me

6An unreliable stream, and what stays reliable

The packet goes on an UnreliableRemoteEventUnreliableRemoteEventA remote whose messages are not resent when lost and can arrive out of order; payloads over 1000 bytes are dropped.Think of it as shouting the latest position across a field: a missed shout is replaced by the next.. Its messages are not resent when lost, and they do not wait for earlier ones, so they can arrive out of order. A payload over 1,000 bytes is dropped5. For a stream where every packet replaces the one before, all three are fine, and the 253-byte packet leaves room to spare.

Out of order is the one to handle. If packet 41 arrives after packet 42, drawing it would move the drone backwards. That is what the sequence number is for: the client keeps the newest number it has seen and ignores anything older. Because the number wraps at 65,536, "older" means "behind by less than half the range", which the receiving code checks with (seq - lastSeq) % 65536.

Client sideRemember: Snapshot interpolation with a render delay is a flipbook artist who stays one page behind the pages the server sends.

The flipbook artist now also throws away any page older than the one on the easel. The server only has to keep sending the newest picture.

Which Beacon Yard messages may travel on an UnreliableRemoteEvent?

  1. The 10 Hz drone snapshot
  2. Feedback("hit"), which plays the hit sound for one confirmed swing
  3. RoundState changing from Active to Cooldown
  4. A decorative spark at the wrench tip
  5. ShopBuy("Shield") from a client
Answer

The 10 Hz drone snapshot; A decorative spark at the wrench tip. The next snapshot replaces a lost one, and a lost spark is invisible. A hit confirm, a phase change and a purchase must arrive exactly once, so they stay on RemoteEvents.

The client has drawn packet 42. Packet 41 arrives late. What should it do?

  1. Ignore it, because 41 is older than the newest packet it has
  2. Draw it, because every packet is the server's truth
  3. Ask the server to resend 42
  4. Stop the stream and wait for packet 43
Answer

Ignore it, because 41 is older than the newest packet it has. Keep the highest sequence number seen and drop older ones. Compare with wrap-around: (seq - lastSeq) % 65536 above 32,768 means older.

Open this step in lesson mode · Link to this step · This confused me

7Build it: the drone as data

The bigger change is on the server. At m14-ship, the engine replicates the drone model in Workspace. At m15-scale, the server keeps the position, yaw, health and stun deadline in a table. Clients build their own drone models from the stream. This excerpt shows the original reliable remotes.

local REMOTE_NAMES: { string } = { "RoundState", "Feedback", "ShopOpen", "ShopBuy", "Swing", "SetSetting" }
 
type RemoteArg = string | number | boolean | Vector3 | nil
Figure 7.1

The sender aims for ten sends per second on Heartbeat. It caps the leftover time after a long stall.

local function sendSnapshots(dt: number)
	sendClock += dt
	if sendClock < SEND_INTERVAL then
		return
	end
	-- Subtract, do not reset, so the leftover keeps the average at 10 Hz;
	-- after a long stall do not catch up with a burst.
	sendClock = math.min(sendClock - SEND_INTERVAL, SEND_INTERVAL)
 
	seq = (seq + 1) % 65536
	local now = workspace:GetServerTimeNow()
	sentAt[seq % SENT_SLOTS] = now
	sentSeq[seq % SENT_SLOTS] = seq
 
	local list = liveDrones()
Figure 7.2

Build along

m14-ship to m15-scale

  • src/shared/DronePacket.luau
  • src/server/Remotes.luau
  • src/server/DroneService.luau
  • src/server/NetMeter.luau
  1. Add DroneStream to UNRELIABLE_NAMES and create it in Remotes.init. Retrieve it with Remotes.getUnreliable("DroneStream"). Use DronePacket to pack the sequence number and drone rows.

    You should see ReplicatedStorage.Remotes holds DroneStream next to nine RemoteEvents.

  2. Keep the position, yaw, health and stun deadline in DroneService. Publish health on ReplicatedStorage.DroneState. The attribute names for slots one through three are Health, Health2 and Health3. A drill uses only slot one at m15-scale. setWave arrives at m16-design-pass with a cap of three.

    You should see The server moves a drone table on Heartbeat and owns the touch damage and stun checks.

  3. After moving the drones on Heartbeat, call sendSnapshots(dt). Pack positions relative to DronePacket.YARD_CENTER, send only a viewer's relevant drones with FireClient, and record payload bytes with NetMeter.sent. Skip the send when the viewer has no relevant drones.

    You should see An in-range viewer receives about ten 10-byte payloads per second during a drill with one drone.

Why does sendSnapshots subtract SEND_INTERVAL from sendClock instead of setting sendClock back to 0?

  1. So ordinary frame-to-frame overruns carry forward toward the 10 Hz target
  2. Because setting a number to 0 is slower in Luau
  3. So the first packet is sent before the drone moves
  4. Because Heartbeat passes a negative dt on slow frames
Answer

So ordinary frame-to-frame overruns carry forward toward the 10 Hz target. Subtracting keeps the remainder during ordinary frame overruns. The upper bound on sendClock limits catch-up after a stall.

Open this step in lesson mode · Link to this step · This confused me

8Build it: the client draws the drone

The receiver keeps a short history per drone and draws on RenderStepped:

local function render()
	local now = os.clock()
	local renderTime = now - Config.DRONE_INTERP_DELAY
	for id, track in tracks do
		local folder = state
		local health = if folder ~= nil then folder:GetAttribute(DroneVisual.healthAttribute(id)) else nil
		if now - track.lastAt > TIMEOUT_SECONDS or typeof(health) ~= "number" then
			removeBody(track)
			tracks[id] = nil
			continue
		end
		local at = DronePacket.interpolate(track.snapshots, renderTime)
		if at == nil then
			continue
		end
		local pivot = CFrame.new(at.x, track.y, at.z) * CFrame.Angles(0, math.rad(at.yaw), 0)
		local body = ensureBody(track, pivot)
		body.model:PivotTo(pivot)
		body.root:SetAttribute("StunnedUntil", if track.stunned then workspace:GetServerTimeNow() + 1 else 0)
		DroneVisual.paint(body, track.colors, track.stunned, health / Config.DRONE_MAX_HEALTH)
		lastDrawn = pairAt(track, renderTime)
Figure 8.1

The yaw convention has to match on both sides. CFrame.Angles(0, θ, 0) looks along (-sin θ, 0, -cos θ), so the server stores yaw = math.deg(math.atan2(-dir.X, -dir.Z)) % 360 for a chase direction dir.

Build along

m14-ship to m15-scale

  • src/client/DroneClient.luau
  • src/client/init.client.luau
  • src/shared/DroneVisual.luau
  • src/server/CombatService.luau
  1. Start DroneClient in init.client.luau. Keep four snapshots per drone and draw 0.1 s behind using Config.DRONE_INTERP_DELAY. DroneVisual.build creates the body. Remove its track after 0.5 s without a snapshot or when health disappears. The first packet after more than 0.5 s of stream silence can establish a new sequence baseline.

    You should see The client draws and paints its own drone from the stream and health attribute.

  2. Use the history and the radius-two sphere check in CombatService.droneHit. trySwing compares the distance to the drone's centre with the actual raycast distance to a crawler. That comparison approximates which target the swing touches first.

    You should see A swing at a drone can hit without any drone part on the server.

  3. Start a Server & Clients test with three clients and run a drill. Record the same Network debug stats and MicroProfiler Network views as at m14-ship. Compare the measured totals with the payload budget.

    You should see The two captures give you a before and after for data received per second.

After the change, why can CombatService no longer use workspace:Raycast to find the drone, and what keeps the hit check on the server?

  1. The server has no drone part to hit, so it tests the swing ray against the drone's server-side position with plain maths
  2. Raycasts cannot run on the server once an UnreliableRemoteEvent exists
  3. The client now reports which drone it hit, and the server trusts it
  4. The drone model on each client is anchored, so rays pass through it
Answer

The server has no drone part to hit, so it tests the swing ray against the drone's server-side position with plain maths. The server keeps the truth as data and decides hits with maths. The next lesson goes one step further and checks the swing against where the drone was when the player swung.

Open this step in lesson mode · Link to this step · This confused me

9Let a schema write the code

Hand-packing works, and it shows you exactly where the bytes go. It also means two pieces of code (pack and unpack) that must agree forever, for every message in the game. Networking libraries solve that with a schema: you describe each message once, and a compiler writes both sides. Here is the drone stream in Blink's language6:

text
option ServerOutput = "src/server/Net.luau"
option ClientOutput = "src/client/Net.luau"
 
struct DroneSnap {
    Id: u8(0..63),
    X: i16,
    Y: u16,
    Z: i16,
    Yaw: u8,
    Stunned: boolean
}
 
event DroneStream {
    From: Server,
    Type: Unreliable,
    Call: SingleSync,
    Data: (u16, DroneSnap[..63])
}

Blink's numbers take whole bytes (u8 is one, i16 two), so you still quantize the position yourself: x and z as sixteenths of a stud in an i16, and y as eighths of a stud in a u16. Its unreliable events carry the same 1,000-byte limit, and it validates what clients send before your code sees it.

Other ways pros do this

OptionWhat it isWhen pros pick itTrade-offs
Plain remotesRemoteEvent and UnreliableRemoteEvent with Luau tables.Most messages: rare, small, or changing game state once.Easy to read; tables carry their structure, so a high-rate stream costs more than it needs to.
Hand-packed bufferbuffer.writebits with your own layout, as in this lesson.One or two hot streams where every bit counts.Smallest packets; you maintain pack and unpack by hand and test that they agree.
BlinkAn IDL compiler that writes buffer networking code from a schema (github.com/1Axen/blink, MIT, release v0.18.9, active as of 2026-11-25).Many typed messages and a team that wants one source of truth.A build step and generated files; whole-byte fields unless you pack yourself.
ZapA schema compiler for buffer networking that inspired Blink's range syntax (github.com/red-blox/zap, MIT, release v0.6.29, last push 2026-06-23).The same job as Blink, if its syntax or output suits you.Pushed less often than Blink this year; check its changelog before adopting.
ByteNet, WarpRuntime buffer libraries with no compile step.You want packing without a schema compiler.ByteNet's last push was 2025-08; Warp is in pre-release. Mention, do not build on them without checking.

Your yard now has 30 message types. What is the strongest reason to move them to a schema compiler such as Blink?

  1. Pack and unpack are generated from one description, so the two sides cannot drift apart
  2. Generated code is always smaller than a hand-packed buffer
  3. It removes the 1,000-byte limit on unreliable messages
  4. It makes server validation unnecessary
Answer

Pack and unpack are generated from one description, so the two sides cannot drift apart. The win is one source of truth for every message. Keep hand-packing for the rare stream where bits really matter, and keep validating game rules on the server either way.

Where does it break?“A flipbook artist who stays one page behind the pages the server sends” is a good picture of snapshot interpolation with a render delay. Where does it stop being true?

It breaks here. Pages stop coming for longer than the delay: the artist has nothing to draw towards, so the drone holds still and then jumps when packets return.

The true model. Interpolation only hides gaps up to the render delay. Longer stalls need a longer delay (more lag for everyone), extrapolation (guessing ahead, sometimes wrong) or a visible catch-up.

A player's connection stalls and no drone packet arrives for 0.5 s. With this lesson's interpolate, what does that client draw during the stall?

  1. The drone stops at the newest snapshot it has, then jumps when packets return
  2. The drone keeps moving smoothly, because the flipbook is always one page behind
  3. The drone disappears until the next packet
  4. The client asks the server to resend the missing packets
Answer

The drone stops at the newest snapshot it has, then jumps when packets return. This is where the flipbook breaks: the artist can only stay one page behind while pages keep coming. Longer stalls need a choice: a longer render delay (more lag for everyone), extrapolation (guessing ahead, sometimes wrong), or accepting a visible catch-up.

Open this step in lesson mode · Link to this step · This confused me

10Challenges and recap

Level 1, Apprentice

Challenge

Measure Beacon Yard at m14-ship during a drill and write its network budget as a table in a Markdown file.

Start from
The game at milestone m14 (download)

Done means

  • A budget table lists the drone stream, RoundState, Feedback and ShopBuy with bytes per message and messages per second
  • It has a baseline capture from Network debug stats or a MicroProfiler Network dump during a drill
  • It names one system you would change first and why

Hints

  1. RoundState and ShopBuy fire on change, a few times a minute. The drone fires every frame during a drill.
  2. Use a Server and Clients test with three clients so the numbers are per player.

Level 2, Builder

Challenge

Fix lerpYaw and interpolate in the interp-cell Run above.

Start from
The game at milestone m14 (download)
Check it here
Run the code cell in the lesson view; the challenge completes when it passes. No Studio needed.

Done means

  • lerpYaw takes the short way round and returns 0 to 360
  • interpolate blends between the two snapshots around renderTime and holds at both ends
  • Every test in interp-cell passes

Hints

  1. (b - a + 180) % 360 - 180 is the signed short-way difference.
  2. Loop over pairs i and i + 1 and find the one where a.t <= renderTime < b.t.
Solution
luau
local function lerpYaw(a, b, t)
	local delta = (b - a + 180) % 360 - 180
	return (a + delta * t) % 360
end
 
local function interpolate(snaps, renderTime)
	local first, last = snaps[1], snaps[#snaps]
	if first == nil then return nil end
	if renderTime <= first.t then return first end
	if renderTime >= last.t then return last end
	for i = 1, #snaps - 1 do
		local a, b = snaps[i], snaps[i + 1]
		if renderTime >= a.t and renderTime < b.t then
			local alpha = (renderTime - a.t) / (b.t - a.t)
			return { t = renderTime, x = a.x + (b.x - a.x) * alpha, yaw = lerpYaw(a.yaw, b.yaw, alpha) }
		end
	end
	return last
end
 
local snaps = {
	{ t = 10.0, x = 0, yaw = 350 },
	{ t = 10.1, x = 1.2, yaw = 10 },
	{ t = 10.2, x = 2.4, yaw = 30 },
}
local s = interpolate(snaps, 10.05)
print(s and string.format("x %.2f yaw %.1f", s.x, s.yaw))

Your budget table for Beacon Yard at m14-ship shows the drone stream, RoundState, Feedback and ShopBuy. Which row should you change first?

  1. The drone stream: it sends every frame during a drill, to every player
  2. ShopBuy: purchases are the most important message
  3. RoundState: it carries the timer
  4. Feedback: it has the most different kinds
Answer

The drone stream: it sends every frame during a drill, to every player. Fix the biggest row first. A budget table makes that obvious: the per-frame stream outweighs every on-change message together.

Level 3, Professional

Challenge

Write the packer, the reader and the interpolation in the game repo's challenges/work/drone_packet.luau, then run the network-budget challenge through the Course Runner.

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

Done means

  • challenges/work/drone_packet.luau packs one drone in 10 bytes and forty in 253
  • unpack returns every drone within half a step, with the sequence number, and clamps out-of-range values to the edge
  • lerpYaw and interpolate pass the same cases as the Run cell
  • The network-budget challenge prints TEST PASS for all fourteen checks

Hints

  1. Write the header first: 16 bits of seq % 65536, then 8 bits of count.
  2. Quantize with math.clamp(math.round((value - low) / step), 0, 2 ^ bits - 1).
  3. Read back with value * step + low, in the same bit order you wrote.

Retiring the analogy

You no longer need “a flipbook artist who stays one page behind the pages the server sends”. Interpolation only hides gaps up to the render delay. Longer stalls need a longer delay (more lag for everyone), extrapolation (guessing ahead, sometimes wrong) or a visible catch-up.

Recap

  1. Every property the server changes on a replicated part goes to every client; the drone's PivotTo on Heartbeat is 60 updates a second per player.
  2. A network budget lists bytes per message and messages per second for each system, measured with Performance Stats, Shift+F3, Server Stats and MicroProfiler Network dumps.
  3. Send moving objects at 10 to 20 Hz on an UnreliableRemoteEvent, drop packets older than the newest, and interpolate 0.1 s behind; payloads over 1,000 bytes are dropped.
  4. Quantize and bit-pack with buffer.writebits: forty drones fit in 253 bytes, about 2.5 KB/s at 10 Hz instead of 36 KB/s per frame.
  5. Schema compilers such as Blink and Zap write pack and unpack from one description; hand-pack only the hottest streams.

Snapshot interpolation with a render delay is a flipbook artist who stays one page behind the pages the server sends, until pages stop coming for longer than the delay: the artist has nothing to draw towards, so the drone holds still and then jumps when packets return.

Next Server authority: prediction, rollback, lag-compensated hits

Open this step in lesson mode · Link to this step · This confused me