Core loop design: act, reward, spend, repeat

Design a game's core loop before building its systems. Trace Beacon Yard's real Config.luau numbers across coin pads, drill rounds, the shop, session pacing and the first 60 seconds.

Concept lesson, about 45 minutes, 9 steps

By the end you can

  • Trace Beacon Yard's act, reward, spend and repeat cycle through Config.luau's real numbers
  • Predict how changing coin values, timers or prices shifts session pacing and upgrade timing
  • Audit the first 60 seconds of a new player's visit against Roblox's onboarding goals
  • Build a guided first minute driven by the saved onboarding funnel step, and measure it in the funnel report

Before this: Security: never trust the client

Step 1 of 9

Four beats before a single part

In this module you build the whole playable yard: map, coins, rounds, drone and wrench. Before touching a single part, read the one module that holds every gameplay number in m06-drone-wrench:

	ROUND_SECONDS = 40,
	COOLDOWN_SECONDS = 8,
	COIN_VALUE = 5,
	COIN_RESPAWN_SECONDS = 4,
	SURVIVAL_BONUS = 10,
	DRONE_SPEED = 12,
	DRONE_DAMAGE = 15,
	DRONE_HIT_COOLDOWN = 1,
	DRONE_MAX_HEALTH = 100,
	WRENCH_DAMAGE = 34,
	WRENCH_RANGE = 14,
	STUN_SECONDS = 1.6,
	WALK_SPEED = 16,
	BOOST_SPEED = 24,
	SPEED_PRICE = 25,
	SHIELD_PRICE = 40,
	COIN_PACK_COINS = 50,

Those numbers describe a four-beat core loopCore loopThe cycle of play a game is built on: constant interaction, the actions repeated most, and the progression they feed.Think of it as the engine of a game: what turns, what it drives, and what it charges up.: act (grab coins, start a drill, swing the wrench), reward (+5 coins per pad, +10 for surviving a drill), spend (Speed for 25, Shield for 40 at the quartermaster), and repeat (move at 24 studs per second instead of 16 on the next drill). Roblox's design guide breaks the same cycle into minute-to-minute interaction, the most repeated actions, and a progression engine1.

Beacon Yard core loopA clockwise cycle of four boxes: client Act feeds server Reward, which feeds stored data Spend, which feeds shared Repeat and returns to Act.server paysvisit shopupgrade keptnext drill1. Actpads, drill, wrench2. Reward+5 coin, +10 survive3. SpendSpeed 25, Shield 404. Repeatfaster next drill
Act, reward, spend and repeat in Beacon Yard, painted with the course colour roles.
Put in order

Put Beacon Yard's core loop beats in order, starting from player input.

  1. Repeat: enter the next drill faster or protected
  2. Act: collect coins on pads, trigger a drill and fight the drone
  3. Reward: the server awards 5 coins per pad and a 10-coin survival bonus
  4. Spend: buy Speed (25) or a Shield charge (40) at the quartermaster

Link to this step · This confused me

Step 2 of 9

Coin pads and drill rounds by the numbers

Look at how tightly Beacon Yard's earning numbers fit together. Six coin pads sit in a ring around the beacon. Each pickup pays COIN_VALUE = 5 and respawns after COIN_RESPAWN_SECONDS = 4. Hold E at the beacon for 0.4 seconds and a ROUND_SECONDS = 40 drill begins.

During the drill, the drone chases at DRONE_SPEED = 12, deals DRONE_DAMAGE = 15 with a DRONE_HIT_COOLDOWN = 1 second gap, and has DRONE_MAX_HEALTH = 100. Each wrench hit deals WRENCH_DAMAGE = 34 and stuns the drone for STUN_SECONDS = 1.6. Survive the 40 seconds and RoundService pays SURVIVAL_BONUS = 10, followed by COOLDOWN_SECONDS = 8.

Both sidesA core loop is a flywheel that stores each push as momentum for the next turn.
In the pictureIn Roblox
Pushing the rimThe repeated player action: collecting coins, running drills and swinging the wrench
Stored spinThe reward and progression: coins, Speed and Shield
An easier next pushFaster movement and protection in the next drill

See the whole analogy cast

Think of a core loop as a flywheel. Each turn of play pushes the rim, the reward stores that energy as spin, and spending coins makes the next turn feel smoother and stronger.

Think of it as A flywheel that stores each push as momentum for the next turn

Predict the output

A brand-new player starts at 0 coins, grabs 4 coin pads during their first 40-second drill, and survives to the end. What does this Config.luau math print?

local COIN_VALUE = 5
local SURVIVAL_BONUS = 10
local SPEED_PRICE = 25
local total = 4 * COIN_VALUE + SURVIVAL_BONUS
print(total, total >= SPEED_PRICE)
A brand-new player starts at 0 coins, grabs 4 coin pads during their first 40-second drill, and survives to the end. What does this Config.luau math print?

Press 1 to 4 to choose, Enter to check.

Link to this step · This confused me

Step 3 of 9

The shop and session pacing

Good session pacingSession pacingThe rhythm of action, reward and breather across one visit, from join to leave.Think of it as the beat between sprinting during a drill and catching your breath at the shop. alternates tension and breathing room. One Beacon Yard drill is 40 seconds of chase and 8 seconds of cooldown: a 48-second cycle. On Roblox, players join and leave easily and most play on a phone, so short cycles give them a full thrill and a natural place to visit the shop2. (The shop, rounds and saved profiles arrive in later lessons. Here they are a preview, so only the numbers matter.)

Now compare the shop prices to the movement speeds in Config.luau. Your base WALK_SPEED is 16, already 4 studs per second faster than DRONE_SPEED (12). Buying Speed for 25 coins permanently raises your speed to BOOST_SPEED = 24, tripling your speed advantage over the drone. Buying a Shield for 40 coins grants one ShieldCharges charge that absorbs a single drone hit.

Run this cell to check how quickly a player affords Speed and Shield from real Config.luau numbers.

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

Using Beacon Yard's real Config.luau numbers, what does this print?

local WALK_SPEED = 16
local BOOST_SPEED = 24
local DRONE_SPEED = 12
local SHIELD_PRICE = 40
local COIN_VALUE = 5
print(BOOST_SPEED - DRONE_SPEED, SHIELD_PRICE // COIN_VALUE)
Using Beacon Yard's real Config.luau numbers, what does this print?

Press 1 to 4 to choose, Enter to check.

Link to this step · This confused me

Step 4 of 9

Where the flywheel picture breaks

Both sidesRemember: A core loop is a flywheel that stores each push as momentum for the next turn.

A flywheel stores momentum only while there is still something to charge up. In m06-drone-wrench (a preview of the shop and data lessons ahead), Speed can only be bought once (profile.speedOwned), and ShopService caps ShieldCharges at 1. Even COIN_PACK_COINS = 50 only feeds the same two buttons. Once a player owns Speed and holds a Shield, every coin they pick up sits in leaderstats with nowhere to go, and the progression engine stops pulling them into another drill. Answer the question below before opening the breakdown.

Where does it break?“A flywheel that stores each push as momentum for the next turn” is a good picture of a core loop. Where does it stop being true?

It breaks here. A flywheel slows down the moment nothing new can absorb its energy; once a player buys the only permanent upgrade and holds a Shield, coins stop unlocking new capability.

The true model. A core loop couples minute-to-minute interaction, repeated actions and a progression engine. Every number in Config.luau tunes how fast players earn, how tense a round feels and when progression needs new goals.

Predict the output

A player owns Speed, already holds 1 Shield charge, and has 95 coins. Based on ShopService.luau's rules, what happens when they try to buy Speed and then Shield?

local speedOwned = true
local shieldCharges = 1
local function tryBuy(item)
	if item == "Speed" and speedOwned then return "Already owned" end
	if item == "Shield" and shieldCharges >= 1 then return "Shield already up" end
	return "Bought"
end
print(tryBuy("Speed"), tryBuy("Shield"))
A player owns Speed, already holds 1 Shield charge, and has 95 coins. Based on ShopService.luau's rules, what happens when they try to buy Speed and then Shield?

Press 1 to 4 to choose, Enter to check.

Link to this step · This confused me

Step 5 of 9

Three time scales: moment, session and meta

That ceiling happens because a complete game runs loops on three time scales, and Beacon Yard only builds the first two.

Time scaleSpanWhat it doesIn Beacon Yard
Moment loopSecondsThe action under your fingers: move, dodge, aim, collectWalk (16), grab a pad (+5), swing (0.4 s gap), stun (1.6 s)
Session loopMinutesOne visit's arc from earn to upgrade40 s drill + 8 s cooldown, spend at the quartermaster (Speed 25, Shield 40)
Meta loopDays and weeksLong-term goals that give players a reason to return tomorrowMissing: once you own Speed and hold one Shield, coins have no further job

Naming that missing meta loop early keeps you from blaming the moment-to-moment controls when day-7 retention drops. A live version of Beacon Yard would add a meta loop on top of the same yard: tiered upgrades, daily or weekly quests, seasonal tracks, or cosmetic unlocks. In Module 14, Pillars and loops maps all three time scales and designs Beacon Yard's pillars and meta loop in full.

Match the pairs

Match each part of Beacon Yard to its loop time scale.

Link to this step · This confused me

Step 6 of 9

The first 60 seconds: onboarding

OnboardingOnboarding (FTUE)The first-time user experience: the first minute a new player spends learning what to do and feeling the fun.Think of it as the front entrance of the yard, with signs and a coin right in front of your feet. (the First-Time User Experience) is the first few minutes a player spends in your place. Roblox's onboarding guide sets three goals: teach the essentials, get to the fun quickly, and leave players wanting more3.

Notice how Beacon Yard's MapBuilder.luau guides a new player without a wall of tutorial pop-ups:

	local beaconSign = stationSign("BeaconSign", Vector3.new(0, 4.2, -8), "BEACON", "Hold E to start the drill")
	local shopSign =
		stationSign("ShopSign", Vector3.new(22, 4.2, 22), "QUARTERMASTER", "Speed 25   Shield 40   Pack 50")
	local coinSign = stationSign("CoinSign", Vector3.new(-16, 3.6, 16), "COIN PADS", "Touch a pad. +5 coins")
	local gateSign = stationSign("GateSign", Vector3.new(12, 6.2, 40), "YARD GATE", "Opens while the drill is active")

You spawn at (-30, 3, 0), 30 studs west of the glowing centre beacon. Six lit coin pads sit on a 22-stud radius ring, putting the nearest pad ((-22, 0)) just 8 studs ahead. Four lit sign boards name the Coin Pads, Beacon, Quartermaster and Yard Gate in plain words. One risk remains: the round stays Idle until someone holds E at the beacon for 0.4 seconds, so a solo newcomer who walks past the beacon never sees the drone.

Roblox Studio
Roblox Studio in Play on Beacon Yard's spawn pad at (-30, 3, 0): the nearest glowing coin pad sits just ahead on the 22-stud ring, with the cyan beacon behind it and the lit station signs around the yard.

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

The spawn sightline in Beacon Yard: first coin pad straight ahead, glowing beacon in the centre, and station signs framing the yard.

Work it out

A new player spawns at x = -30 and walks straight east toward the nearest coin pad at x = -22 (8 studs away) at WALK_SPEED = 16 studs per second. How many seconds until their first coin pickup?

seconds

Link to this step · This confused me

Step 7 of 9

Build it: a guided first minute

That audit found one risk: a solo newcomer can walk past the beacon and never see a drill. At m14-ship the game already measures it. Analytics logs Roblox's onboarding funnel, once per player, in order: Joined (1), FirstCoin (2), StartedDrill (3), SurvivedDrill (4), FirstPurchase (5). The furthest step is saved as onboardingStep in the profile, and the Creator Hub's funnel page shows how many players reach each one4. A big drop from step 2 to step 3 is that risk, in numbers.

The fix is a guide that shows the way once. A beam runs from the new player to the nearest coin pad. After the first coin it swings to the beacon, and one toast says what to do there. Once a drill starts, it is gone for good, because the step is saved on the server.

function Analytics.onboarding(player: Player, step: OnboardingStep): boolean
	local index = Analytics.onboardingIndex(step)
	local ok, data = pcall(DataService.get, player)
	if not ok or index <= data.onboardingStep then
		return false
	end
	data.onboardingStep = index
	safely(function()
		AnalyticsService:LogOnboardingFunnelStepEvent(player, index, step)
	end)
	return true

The client part reads one player attribute, OnboardingStep, that the server keeps in step with the profile:

luau
-- src/client/FirstMinute.luau
local CollectionService = game:GetService("CollectionService")
local Players = game:GetService("Players")
 
-- Positions in Analytics' ONBOARDING list: Joined, FirstCoin, StartedDrill.
local FIRST_COIN = 2
local STARTED_DRILL = 3
 
local FirstMinute = {}
 
local function nearestPad(from: Vector3): BasePart?
	local best: BasePart? = nil
	local bestDistance = math.huge
	for _, pad in CollectionService:GetTagged("CoinPad") do
		if pad:IsA("BasePart") and (pad.Position - from).Magnitude < bestDistance then
			best = pad
			bestDistance = (pad.Position - from).Magnitude
		end
	end
	return best
end
 
local function beacon(): BasePart?
	local yard = workspace:FindFirstChild("Yard")
	local model = if yard then yard:FindFirstChild("Beacon") else nil
	local pedestal = if model then model:FindFirstChild("Pedestal") else nil
	return if pedestal and pedestal:IsA("BasePart") then pedestal else nil
end
 
function FirstMinute.start()
	local player = Players.LocalPlayer
	local from = Instance.new("Attachment")
	local to = Instance.new("Attachment")
	to.Parent = workspace.Terrain
	local beam = Instance.new("Beam")
	beam.Attachment0 = from
	beam.Attachment1 = to
	beam.Width0 = 0.4
	beam.Width1 = 0.4
	beam.FaceCamera = true
	beam.Color = ColorSequence.new(Color3.fromRGB(80, 220, 255))
	beam.Enabled = false
	beam.Parent = workspace.Terrain
 
	local function update()
		local step = player:GetAttribute("OnboardingStep")
		local character = player.Character
		local root = if character then character:FindFirstChild("HumanoidRootPart") else nil
		if typeof(step) ~= "number" or step >= STARTED_DRILL or root == nil or not root:IsA("BasePart") then
			beam.Enabled = false
			return
		end
		local target = if step < FIRST_COIN then nearestPad(root.Position) else beacon()
		if target == nil then
			beam.Enabled = false
			return
		end
		from.Parent = root
		to.WorldPosition = target.Position
		beam.Enabled = true
	end
 
	player:GetAttributeChangedSignal("OnboardingStep"):Connect(update)
	player.CharacterAdded:Connect(function()
		task.defer(update)
	end)
	update()
end
 
return FirstMinute

Build along

m14-ship

  • src/server/Analytics.luau
  • src/client/FirstMinute.luau
  • src/client/init.client.luau
  1. In Analytics.onboarding, right after data.onboardingStep = index, add player:SetAttribute("OnboardingStep", index). In joined, before logging Joined, copy the saved value: read DataService.get(player) inside pcall and set the same attribute from its onboardingStep.

    You should see In Play, the Attributes section of your Player shows OnboardingStep, and it goes up by one when you collect your first coin on a fresh profile.

  2. Still in Analytics.onboarding, when the logged step is FirstCoin, call Remotes.fireClient("Feedback", player, "toast", "Follow the beam to the beacon and hold E"). Require Remotes at the top of the file.

    You should see The first coin shows the toast Follow the beam to the beacon and hold E, once.

  3. Add FirstMinute.luau from the block above and call FirstMinute.start() from init.client.luau. Your test profile has probably passed every step already, so in Play run game.Players:GetPlayers()[1]:SetAttribute("OnboardingStep", 1) on the server to replay the first minute.

    You should see After you set OnboardingStep to 1 from the server command bar, a cyan beam runs from you to the nearest pad; it swings to the beacon after a coin and disappears when you start a drill.

  4. After you publish, open the onboarding funnel on the Creator Hub and compare step 2 to step 3, setting the date range to start on the day the guide went live.

    You should see The funnel page shows the share of players who go from FirstCoin to StartedDrill in the week before and the week after the change.

Choose one

Why does FirstMinute follow an OnboardingStep attribute set by the server, instead of the client keeping its own tutorialDone flag?

Why does FirstMinute follow an OnboardingStep attribute set by the server, instead of the client keeping its own tutorialDone flag?

Press 1 to 4 to choose, Enter to check.

Link to this step · This confused me

Step 8 of 9

Loop shapes and tuning like a pro

Other ways pros do this

OptionWhat it isWhen pros pick itTrade-offs
Round-based loopShort timed matches with a clear start, climax and cooldown (Beacon Yard).Action, survival and multiplayer games where everyone shares the same clock.An Idle wait before a round can feel empty for a solo new player.
Open-ended resource loopContinuous collecting, upgrading and unlocking with no round reset (tycoons, simulators).Relaxed drop-in play where players set their own pace.Needs many upgrade tiers and rebirths so players do not hit a ceiling.
Stage or level loopDiscrete checkpoints or rooms that escalate in difficulty (obbies, tower climbers).Skill challenges where mastering one section unlocks the next.Requires hand-built or procedural stages to avoid feeling repetitive.

Build along

m06-drone-wrench

  • src/shared/Config.luau
  1. Inspect src/shared/Config.luau at m06-drone-wrench and note every number that controls earnings, combat and prices.

    You should see You see ROUND_SECONDS = 40, COOLDOWN_SECONDS = 8, COIN_VALUE = 5, SURVIVAL_BONUS = 10, SPEED_PRICE = 25 and SHIELD_PRICE = 40 in one table.

  2. Press Play in Studio and time your own first 60 seconds: note how many seconds pass before your first coin, your first drill start, and your first shop purchase.

    You should see You collect your first coin within a second of moving, start a 40-second drill at the beacon, and afford Speed (25) right after your first drill.

Choose one

Why does Beacon Yard put SPEED_PRICE and SHIELD_PRICE in src/shared/Config.luau instead of writing 25 and 40 separately in ShopService and ShopGui?

Why does Beacon Yard put SPEED_PRICE and SHIELD_PRICE in src/shared/Config.luau instead of writing 25 and 40 separately in ShopService and ShopGui?

Press 1 to 4 to choose, Enter to check.

Link to this step · This confused me

Step 9 of 9

Challenges and recap

Write roundsToAfford(price, padsPerRound) using Beacon Yard's real COIN_VALUE = 5 and SURVIVAL_BONUS = 10, returning how many full drills a player needs to afford an item.

Luau
Ctrl Enter runs the cell. Checked by tests

Level 1, Apprentice

Challenge

Fix roundsToAfford in the balance-check cell above so it includes SURVIVAL_BONUS and passes all three tests.

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

Done means

  • Include SURVIVAL_BONUS in each drill's earnings
  • Return the rounded-up number of drills needed to reach price
  • All three assertions in balance-check pass

Level 2, Builder

Challenge

Retune Beacon Yard's economy in Config.luau so Speed requires two drills instead of one, test the feel in Studio Play, then restore the defaults.

Start from
The game at milestone m06 (download)

Done means

  • Adjust SPEED_PRICE or COIN_VALUE in Config.luau so buying Speed takes two drills at 4 pads per drill
  • Verify in Play that both the shop panel and ShopService enforce the new number (the 3D Quartermaster sign is hard-coded and keeps saying Speed 25)
  • Restore Config.luau to its original values afterwards

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

Predict the output

If you lower WRENCH_DAMAGE from 34 to 25 while keeping DRONE_MAX_HEALTH at 100, what does this print?

local DRONE_MAX_HEALTH = 100
local oldHits = math.ceil(DRONE_MAX_HEALTH / 34)
local newHits = math.ceil(DRONE_MAX_HEALTH / 25)
print(oldHits, newHits)
If you lower WRENCH_DAMAGE from 34 to 25 while keeping DRONE_MAX_HEALTH at 100, what does this print?

Press 1 to 4 to choose, Enter to check.

Retiring the analogy

You no longer need “a flywheel that stores each push as momentum for the next turn”. A core loop couples minute-to-minute interaction, repeated actions and a progression engine. Every number in Config.luau tunes how fast players earn, how tense a round feels and when progression needs new goals.

Recap

  1. Beacon Yard's core loop is act (pads, drill, wrench), reward (+5 coin, +10 survival), spend (Speed 25, Shield 40), repeat.
  2. A 48-second cycle (40 active, 8 cooldown) fits drop-in Roblox sessions, and every tuning lever sits in Config.luau.
  3. The first 60 seconds must teach the essentials and get to a reward fast; spatial cues like Beacon Yard's spawn sightline and lit signs beat text walls.
  4. A guide driven by the saved onboarding funnel step (a beam to the pad, then the beacon) shows the way once, and the FirstCoin to StartedDrill step in the funnel report shows whether it worked.

A core loop is a flywheel that stores each push as momentum for the next turn, until a flywheel slows down the moment nothing new can absorb its energy; once a player buys the only permanent upgrade and holds a Shield, coins stop unlocking new capability.

Next World building in code: MapBuilder, lighting, atmosphere

Link to this step · This confused me

Sources
  1. Core loops. Roblox Creator Documentation, checked 2026-11-13.
  2. Design for Roblox. Roblox Creator Documentation, checked 2026-11-13.
  3. Onboarding. Roblox Creator Documentation, checked 2026-11-13.
  4. Funnel events. Roblox Creator Documentation, checked 2026-11-13.