"Wiring Sandbox.Services"
Your game ships without stats, leaderboards, or achievements while the default pause menu surfaces empty platform tabs — looks unfinished next to peers that wired Sandbox.Services in an afternoon.
Sandbox.Services is the stock path for stats / leaderboards / achievements. The default pause menu surfaces them per game (platform update 26.01.07 — verify current behavior). Wiring is cheap; skipping it is mostly inertia.
Legacy .sbproj fields LeaderboardType / RankType may be vestigial now (unverified).
Stats
Stats.Increment("bananas_collected", 1);
Stats.SetValue("best_time_seconds", time);Batched automatically. Global, local, and per-player reads available via the services API (needs verification) of exact read helpers on your build — start from current Facepunch docs / intellisense.
Leaderboards
Built on demand from any stat:
var board = Leaderboards.GetFromStat("bananas_collected");
// aggregation: sum / min / max / avg / last
// buckets: daily / weekly / monthly / yearly + country filters
// .CenterOnMe() for local contextPublic web API pattern:
https://public.facepunch.com/sbox/package/{ident}/leaderboard/{stat}/Achievements
- Score 5–100 each; game total capped at 1000.
- Icons auto-resized to 128×128 (one of the few confirmed pixel sizes on the platform).
- Unlock via stat-threshold (progress bar for free) or manual:
Achievements.Unlock("first_escape");Auth
Auth tokens exist for validating players against a custom backend — use when you have server-side truth to protect.
Call services from gameplay after meaningful events; don't spam increments every frame. Host-authoritative multiplayer: increment on the simulating owner / host path (owner-simulated-networking).
The platform already hosts aggregation, UI chrome, and a public leaderboard endpoint. You only emit idents and values; the pause-menu surface and web API do the rest — which is why a small wiring pass makes a game "look finished" on sbox.game.