Designing for groups: co-op, competition, trading

Design for groups on Roblox with Beacon Yard as the case study, covering co-play as a discovery signal, roles and shared goals, a two-lever beacon repair, capped crew goals, competition and why trading should wait.

Concept lesson, about 75 minutes, 10 steps

By the end you can

  • Explain why Roblox rewards games that friends play together, using the documented discovery signals
  • Tell the four shapes of group play apart and pick the one a feature needs
  • Design a co-op objective that needs two players and cannot be finished by one: the two-lever beacon repair
  • Judge whether a game is ready for trading, and name the exploits and policies that come with it

Before this: Social growth: invites, referrals, notifications and events, Game design for Roblox: loops, retention, fairness

1Two players, one drill, no reason to need each other

Here is the code that pays the survival bonus at the end of a drill, as it ships at m14-ship:

local function awardSurvival()
	for _, player in Players:GetPlayers() do
		local character = player.Character
		local humanoid: Humanoid? = nil
		if character then
			humanoid = character:FindFirstChildOfClass("Humanoid")
		end
		if humanoid and humanoid.Health > 0 then
			local balance = DataService.addCoins(player, Config.SURVIVAL_BONUS)
			Analytics.coinSource(
				player,
				Config.SURVIVAL_BONUS,
				balance,
				Enum.AnalyticsEconomyTransactionType.Gameplay.Name,
				"SurvivalBonus"
			)
			Analytics.onboarding(player, "SurvivedDrill")
			BadgeAwards.award(player, "FIRST_DRILL")
Figure 1.1

It loops over every player and pays each one who is still alive. Starting a drill is just as solitary: the beacon prompt calls requestStart, which ignores who pressed it and checks only if busy or phase ~= "Idle". Any one player can start the drill, and every player is paid alone.

So with two players in the yard, the drone dies faster (two wrenches at 34 damage each) and that is all. No rule in the server needs a second person. A designer would say the game is multiplayer (several people share a space) but not cooperative (people need each other to succeed).

A second player joins your yard at m14-ship. Which rule in RoundService treats the two of you as a team?

  1. None: requestStart ignores who pressed the prompt, and awardSurvival pays each living player on their own
  2. awardSurvival pays a bigger bonus when more players survive
  3. requestStart waits until every player in the server presses the prompt
  4. The drone's health goes up for each extra player
Answer

None: requestStart ignores who pressed the prompt, and awardSurvival pays each living player on their own. Beacon Yard is a shared space with solo rules. That is a fine start, but it gives players no reason to bring a friend, and no reason to come back together.

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

2Why Roblox rewards playing together

Roblox's guide to designing for the platform describes players "often hopping from one game to another with friends", and says other players act as "evergreen sources of content for each other", so single-player games "often find it harder to build and retain an audience"1. It even suggests making invitations part of the game "through mechanics such as parties and trading".

The discovery documentation puts a number on the idea. Among the signals it lists as important for Home recommendations is intentional co-play days per user: "the average number of unique days that users come back to play your game with friends, including co-play days through join, invites, or private servers"2. Two details are easy to miss. The signals are averages per user, not totals. And users who first arrive through friends, ads, search or any source other than Recommended for You can speed up your game's consideration, but their engagement is not counted in the ranking stage. Friends get people in the door; what keeps them is still your game.

Which design change most directly moves the intentional co-play days signal?

  1. A reason to return with the same friends on another day, such as a crew goal that resets weekly
  2. A bigger server size so more strangers share one yard
  3. A one-time referral reward the day a friend first joins
  4. A longer drill so each session lasts more minutes
Answer

A reason to return with the same friends on another day, such as a crew goal that resets weekly. Co-play is a retention signal with friends in it. Design for the return trip with the same people, not only the first invite.

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

3Four shapes of group play

Group features come in four shapes. Each answers a different question for the player.

ShapeThe player asksBeacon Yard exampleWhat it costs you
Co-op with roles"Can I do something my friend cannot?"One player stuns the drone, the other repairs the beaconFairness when one player leaves; solo play
Shared goal"Are we getting somewhere together?"A crew goal: 500 drone hits this weekFree riders and players who carry everyone
Competition"Am I better than them?"The best-match leaderboard from the lobbyMatchmaking, pay-to-win pressure, toxicity
Exchange"Can I give or swap something?"Not in the game yetDupes, scams, real-money trading, policy
Server sideA co-op objective that needs two players is a two-person saw, with a handle at each end.
In the pictureIn Roblox
A handle at each end of the bladeTwo levers about 40 studs apart, too far for one player
One person cannot use the saw at allavailable hides the repair when fewer than 2 players are in the server
Pulling in rhythmTwo pulls by different userIds within WINDOW_SECONDS (1.5 s), measured by the server
The cutisRepaired returns true and each puller gets the crew bonus once

See the whole analogy cast

A co-op objective is like a two-person saw, the long blade with a handle at each end. One person cannot use it at all. Two people who pull in rhythm cut faster than either could alone, and each feels the other through the blade.

Think of it as A two-person saw, with a handle at each end

Match each feature idea to the shape of group play it belongs to.

  1. Two levers that must be pulled at the same time by different players
  2. A server-wide bar that fills as everyone downs drones this week
  3. A ranked board of coins earned in one match
  4. Sending a friend a cosmetic you own
Answer

Two levers that must be pulled at the same time by different players: Co-op with roles; A server-wide bar that fills as everyone downs drones this week: Shared goal; A ranked board of coins earned in one match: Competition; Sending a friend a cosmetic you own: Exchange. Naming the shape first tells you which risks to design for: leaving players for co-op, free riders for shared goals, fairness for competition, fraud for exchange.

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

4Design it: the two-lever beacon repair

Here is the feature. Every drill rattles the beacon, and between drills it flickers. Two levers stand on opposite sides of the beacon ring, 40 studs apart, too far for one player to reach both. When two players pull them within 1.5 seconds of each other, the beacon is repaired and both get a crew bonus.

Write the rules before the code. Each one closes a hole a player would find:

  1. Shown only with two or more players. A solo player should never see a job they cannot finish.
  2. Two different players. One player cannot hold both levers; pulling one lets go of the other.
  3. Both still in the server. A player who pulls and leaves must not finish the job for the one who stayed.
  4. Within the window. The two pulls are at most 1.5 seconds apart, and the pair is fresh: the later pull is at most 1.5 seconds old.
  5. A bonus, never a gate. The drill still starts without a repair. Nobody is stuck because a teammate is away from the keyboard.

The server decides every rule with workspace:GetServerTimeNow(), never a time the client reports. This cell has the check with one rule missing. Run it and read which test fails.

Luau
local WINDOW = 1.5
 
type Pull = { userId: number, at: number }
 
local function isRepaired(left: Pull?, right: Pull?, now: number, present: { [number]: boolean }): boolean
	if left == nil or right == nil then
		return false
	end
	if present[left.userId] ~= true or present[right.userId] ~= true then
		return false
	end
	if math.abs(left.at - right.at) > WINDOW then
		return false
	end
	return now - math.max(left.at, right.at) <= WINDOW
end
 
local both = { [101] = true, [202] = true }
print(isRepaired({ userId = 101, at = 10 }, { userId = 202, at = 11 }, 11.2, both))
print(isRepaired({ userId = 101, at = 10 }, { userId = 101, at = 10.2 }, 10.3, both))
Figure 4.1. Run it in the lesson view or in the Studio command bar. The lesson view checks it with tests.

Level 1, Apprentice

Challenge

Add the missing rule to isRepaired in the lever-rules cell so one player can never repair the beacon alone.

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

  • isRepaired returns false when the same userId holds both levers
  • The two-player, window, stale and departed-player cases still behave as before
  • All five tests in lever-rules pass

Hints

  1. Compare left.userId with right.userId before checking the times.
  2. Return false as soon as the two ids are equal.
Solution
luau
local WINDOW = 1.5
 
type Pull = { userId: number, at: number }
 
local function isRepaired(left: Pull?, right: Pull?, now: number, present: { [number]: boolean }): boolean
	if left == nil or right == nil then
		return false
	end
	if left.userId == right.userId then
		return false
	end
	if present[left.userId] ~= true or present[right.userId] ~= true then
		return false
	end
	if math.abs(left.at - right.at) > WINDOW then
		return false
	end
	return now - math.max(left.at, right.at) <= WINDOW
end
 
local both = { [101] = true, [202] = true }
print(isRepaired({ userId = 101, at = 10 }, { userId = 202, at = 11 }, 11.2, both))
print(isRepaired({ userId = 101, at = 10 }, { userId = 101, at = 10.2 }, 10.3, both))

With the finished rules, player 101 pulls the left lever at 20.0 and player 202 pulls the right lever at 21.2. The server checks at 22.9. What does isRepaired return?

local WINDOW = 1.5
local apart = math.abs(20.0 - 21.2)
local age = 22.9 - math.max(20.0, 21.2)
print(apart <= WINDOW, age <= WINDOW)
  1. true false, so not repaired: the pair went stale before the check
  2. true true, so repaired
  3. false false, so not repaired
  4. false true, so not repaired: the pulls were too far apart
Answer

true false, so not repaired: the pair went stale before the check. Without the freshness rule, two pulls from five minutes ago would still count the moment the server looked. Check both the gap and the age.

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

5Where the two-person saw breaks

Server sideRemember: A co-op objective that needs two players is a two-person saw, with a handle at each end.

The saw picture gets the core right: one person cannot do it, two in rhythm can. Now look at what a real yard adds. The two players are not side by side; each is on their own device with their own lag, so "at the same time" can only mean "within a window the server measured". Either player can leave mid-pull. In a two-player server, one idle player can stop the other from ever finishing. With three players, a third could keep pulling one lever to replace a partner's pull and take the bonus, unless a held lever refuses a second player.

Where does it break?“A two-person saw, with a handle at each end” is a good picture of a co-op objective that needs two players. Where does it stop being true?

It breaks here. The two sawyers are side by side and can see each other. Online players are on separate devices with their own lag, either can leave mid-pull, and a third player can stand on a handle and never pull.

The true model. The server decides with its own clock: a window absorbs lag, a presence check ignores a player who left, the same userId on both levers never counts, and the objective is a bonus between drills, so an idle or griefing player can cost the others a reward but never their session.

Each of those is a design decision, not a bug to patch later. The window absorbs lag. The presence check stops a departed player from finishing the job. Making the repair a bonus, not a gate, takes the power away from the hostage taker: the drill goes on without them.

Which of these are real ways a two-player objective goes wrong online, that the rules above guard against?

  1. One player stands between the levers and tries to pull both
  2. A player pulls, then leaves the server, and the other pull lands a second later
  3. Two pulls that felt simultaneous arrive 300 ms apart because of lag
  4. One player refuses to pull so nobody can start the next drill
  5. Both players pull at once and the server pays the bonus four times
Answer

One player stands between the levers and tries to pull both; A player pulls, then leaves the server, and the other pull lands a second later; Two pulls that felt simultaneous arrive 300 ms apart because of lag; One player refuses to pull so nobody can start the next drill. The first four are design problems the rules close: two different players, presence, a window, and a bonus that never blocks the drill. Paying twice is a server bug (pay once, then reset the levers), not a group design problem.

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

6Crews and shared goals

A shared goal gives a group a reason to come back together: "our crew downed 500 drones this week". Two problems come with it. Free riders join a crew and do nothing. Carries do everything, so the goal finishes in an hour and the others never feel part of it. The common fix is a cap: each player counts for at most part of the goal.

Roblox gives you the group itself, if players formed one before joining. Player.PartyId holds the party a player is in, or an empty string. SocialService:GetPlayersByPartyId(partyId) returns the connected players with that party id, and SocialService:GetPartyAsync(partyId) returns members across all of the game's servers3. Studio's Party Simulator fills these in during a Server & Clients test, so you can try party code without publishing4.

Beacon Yard's lobby queue does not use parties yet: it groups whoever is next in the queue, MATCH_SIZE = 2 at a time. The party queue exercise in Capstone, part 3: multi-product receipts and party matchmaking is the first step to keeping friends together.

Where a party shows upA gold Player.PartyId box feeds two boxes: GetPlayersByPartyId for players in this server, and GetPartyAsync for members across every server of the game.Player.PartyIdempty if noneGetPlayersByPartyIdthis serverGetPartyAsyncevery server
Figure 6.1. One party id, two ways to read it.

A crew goal is 100 drone hits and each player counts for at most half of it. This week one player made 90 hits, a second made 30 and a third made 5. What is the crew's progress?

Answer

85 hits. 50 + 30 + 5 = 85. Without the cap the crew would already be at 100 from one player and two others who barely played.

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

7Competition without driving players away

Competition is the oldest group shape and the easiest to get wrong. It works when players are matched to similar players, when losing still teaches something, and when money cannot buy the win. Beacon Yard's leaderboard sits on the safe side: it ranks coins earned in one match, a shared fight against the same drone.

Roblox's monetization guide asks you to know whether your players are competitive5, because the same item reads differently there. A Speed upgrade that helps a teammate in co-op lets a payer beat a free player in a race. In a competitive mode, sell looks, not wins.

You add a race mode: first player to touch all six coin pads wins. What should happen to the Speed Pass bonus (+4 walk speed) in that mode?

  1. Turn it off in the race, so every racer moves at the same base speed, and keep it in the co-op drill
  2. Keep it, because the player paid for it
  3. Double it, to make the pass more attractive
  4. Remove the race mode, because competition never works with paid items
Answer

Turn it off in the race, so every racer moves at the same base speed, and keep it in the co-op drill. In co-op, extra speed helps the team. In a race, it beats the other players. The same item can be fair in one mode and pay-to-win in another.

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

8Trading: why Beacon Yard should say no for now

Trading is the feature players ask for most, and the one that breaks most games. Before you build it, check four things:

  1. Is there anything worth trading? At m16-design-pass the profile holds coins, upgrade tiers, quest progress and a prestige marker: all earned per player, none unique. Coins are the same for everyone, and tiers and Speed are upgrades, not items. There is nothing to swap.
  2. Can you make a swap atomic? Both sides change at once or neither does, even when a server crashes between two saves. The capstone showed how a two-write window loses or copies items; a trade has that window on both sides.
  3. Can you police it? Scams ("trade first, I'll send after"), alt accounts feeding a main, and selling items for real money all arrive with trading.
  4. Are you allowed? PolicyService:GetPolicyInfoForPlayerAsync returns IsPaidItemTradingAllowed, which says whether a player may trade items bought with Robux or with in-game currency6. Roblox also suggests using Player.DeviceTrustLevel on the server to keep sensitive features like trading to trusted devices7.

Other ways pros do this

OptionWhat it isWhen pros pick itTrade-offs
No tradingItems stay with the player who earned or bought them.Games without unique items, or teams without time to police a market. Beacon Yard today.Players cannot show generosity or build a market; fewer reasons to bring friends.
Gifting onlyA one-way send, such as buying an item for a friend in the same server, with no item coming back.Cosmetics, when you want a social gesture without a market.Still needs the policy check and a cap; no haggling, so fewer scams.
Server-held two-sided tradeBoth offers locked, a countdown, then one server write that moves both sides, with an audit log.Games built around collecting unique items.Escrow, crash handling, scam reports and alt detection are a team's ongoing work.
Robux transfersRoblox Plus subscribers send 10 to 500 Robux to another user from inside your game; Roblox runs the transfer and your game earns 10%.When you want players to help each other with money and not items.You do not see the transfer details or control it, and only subscribers can send. With many young players, never prompt a transfer the sender did not ask for, and do not reward the recipient; perks for senders invite begging.

Your team wants to add trading to Beacon Yard next month. Which are good reasons to wait?

  1. The profile has no unique items, only coins, tiers and progress
  2. A swap needs both profiles to change in one safe write, which the game does not have yet
  3. The game has no per-player IsPaidItemTradingAllowed gate or trade audit log yet
  4. Trading is against Roblox's rules in every game
  5. Device trust is never available, so trading can never be gated
Answer

The profile has no unique items, only coins, tiers and progress; A swap needs both profiles to change in one safe write, which the game does not have yet; The game has no per-player IsPaidItemTradingAllowed gate or trade audit log yet. Trading is allowed on Roblox when you respect IsPaidItemTradingAllowed, and DeviceTrustLevel becomes available on live servers (it stays Pending in Studio). Beacon Yard should wait because it has nothing worth trading, no atomic swap, and none of the policy gate or audit log a trade feature needs.

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

9Build along: the beacon repair

This part builds the m16-design-pass milestone. The rules live in one pure module so the server code stays thin and the Level 3 test can check them without two clients.

  • src/shared/CoopRules.luau
  • src/shared/data/rewards.json
  • src/shared/Config.luau
  • src/server/MapBuilder.luau
  • src/server/CoopService.luau
  • src/server/init.server.luau
  1. Write the rules first in challenges/work/coop_rules.luau until designing-for-groups passes, then copy them into src/shared/CoopRules.luau.

    You should see CoopRules.luau has available, pull, isRepaired and crewProgress, and the Level 3 test passes against your work file.

  2. In MapBuilder.luau, add a lever(side, x) helper and build the levers at x = -20 and x = 20 on opposite sides of the beacon ring. Keep the prompts disabled and return them as leverPrompts = { left, right } in the map handles; CoopService turns them on.

    You should see Two lever parts named LeverLeft and LeverRight stand about 40 studs apart, each with a ProximityPrompt that says Pull, hold 0.3.

  3. In CoopService.luau, enable both prompts only when CoopRules.available(#Players:GetPlayers()) is true and the round phase is not Active. Recheck on PlayerAdded, PlayerRemoving (counting the leaving player out) and every phase change. Add CoopService to the server roles in init.server.luau.

    You should see With one player the prompts stay hidden. With two players in Cooldown or Idle they appear; with Active they hide.

  4. Add a BeaconRepair row (15 coins) to rewards.json and read it as Config.CREW_BONUS = Content.reward("BeaconRepair").coins. In CoopService, keep the BeaconDamaged workspace attribute: a new server starts rattled, and every drill sets it again when it ends. That gate stops one pair from farming the bonus between drills. On each prompt's Triggered, refuse a pull when the beacon is not damaged, otherwise call CoopRules.pull with workspace:GetServerTimeNow(), then CoopRules.isRepaired with a present set built from Players:GetPlayers(). A lever that another player pulled inside the window refuses the new pull with the toast "That lever is already held" (the same player may pull again), and while a lever is held, set LeverHeldUntil (server time) on its part and enable a HeldGlow PointLight, so the partner sees it. On success, clear the damage and, for each of the two pullers, add Config.CREW_BONUS through DataService.addCoins, log a coinSource economy event with the SKU CrewRepair, log beacon_repaired, and fire the repair game event for the quest board.

    You should see A pulled lever glows for every client for 1.5 s, and a second player who pulls it hears 'That lever is already held'. Two clients pulling within 1.5 s repairs a rattled beacon once, pays each puller 15 coins once, and resets both levers. Pulling again before the next drill answers 'The beacon is fine'.

When you test the levers with two clients, watch your partner's wrench too. With no swing animation uploaded, a swing turns Tool.Grip on the swinger's client, and that change stays on that client. So at m16-design-pass the server relays every swing it accepts as SwingSeen to the other players, and each of them plays the same arc on the swinger's wrench (the Game feel: juice, hit stop and feedback lesson builds it). You see your partner swing, with no trail and no sparks: sparks come only with the swinger's own confirmed hit. A team reads each other through the world, so a teammate who looks frozen mid-fight feels like lag even when the server is fine.

Roblox Studio
Roblox Studio's mezzanine testing controls with the testing mode dropdown set to Server and Clients and the client count set to 2, ready to start a two-player test of Beacon Yard.

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

Figure 9.1.

The Server & Clients mode with two clients: the quickest way to test a two-player rule on one machine.

Why does the build make the repair a bonus between drills instead of a requirement before the next drill can start?

  1. So a player who is idle or griefing cannot stop everyone else from playing
  2. Because ProximityPrompts cannot block RoundService
  3. Because Roblox forbids objectives that need two players
  4. Because a requirement would be too easy
Answer

So a player who is idle or griefing cannot stop everyone else from playing. Make cooperation pay, and make non-cooperation cost only the bonus. Then a bad teammate costs you a reward, not your session.

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

10Challenges and recap

Level 2, Builder

Challenge

Design one more group feature for the yard on one page, and test its riskiest rule with two clients.

Start from
The game at milestone m14 (download)

Done means

  • One page that names the shape (co-op with roles, shared goal, competition or exchange) of one new group feature for Beacon Yard
  • What a solo player sees, what happens when one player leaves mid-task, and what an idle or griefing player can and cannot block
  • Which recommender signal it should move and the custom or economy event you would log to see it
  • A two-client test in Studio's Server & Clients mode, with what you saw in each client

Hints

  1. Pick something small: a revive, a shared crate that needs two keys, a weekly crew bar.
  2. The intentional co-play days signal counts days with friends, so say why players come back together.

Level 3, Professional

Challenge

In the game repo, edit challenges/work/coop_rules.luau until RunGameTests:Invoke("designing-for-groups") passes in the Course Runner.

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

Done means

  • available hides the repair from a server with fewer than 2 players
  • pull returns a new table, ignores unknown levers and lets go of the other lever held by the same player
  • isRepaired needs two different players, both present, at most 1.5 s apart and at most 1.5 s old
  • crewProgress ignores negative amounts, caps each player at half the goal and the total at the goal

Hints

  1. Copy the levers table before you change it: { left = levers.left, right = levers.right }.
  2. math.clamp(amount, 0, goal * MAX_SHARE) handles the negative amount and the cap together.

Retiring the analogy

You no longer need “a two-person saw, with a handle at each end”. The server decides with its own clock: a window absorbs lag, a presence check ignores a player who left, the same userId on both levers never counts, and the objective is a bonus between drills, so an idle or griefing player can cost the others a reward but never their session.

Recap

  1. Beacon Yard at m14-ship is multiplayer but not cooperative: requestStart and awardSurvival treat every player alone.
  2. Roblox lists intentional co-play days per user, days users return to play with friends, among the important signals for Home recommendations.
  3. Group play has four shapes: co-op with roles, shared goals, competition and exchange, each with its own risks.
  4. A co-op rule must name two different players, check that both are still present, use a server-measured window, and be a bonus rather than a gate.
  5. Trading waits until a game has items worth trading, an atomic swap, a way to police it, and PolicyService and device trust checks.

A co-op objective that needs two players is a two-person saw, with a handle at each end, until the two sawyers are side by side and can see each other. Online players are on separate devices with their own lag, either can leave mid-pull, and a third player can stand on a handle and never pull.

Next Monetization design players respect

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