{"id":"fadeluc-123/tread","name":"tread","scope":"fadeluc-123","platform":"roblox","description":"Whiteoak's server-authoritative character controller for Roblox, with client prediction, on Volt","version":"0.1.0","latest":"0.1.0","versions":["0.1.0"],"license":"Apache-2.0","licenseRating":"safe","licenseCaveats":["Modified files must carry a notice of changes. If the package ships a NOTICE file, its attributions must be preserved."],"licenseVerified":true,"dependencies":{},"integrity":"86dfadd13f757cc32a580799be76f91994fe46dc41b20b1897d5c228671be4ac","likes":0,"downloads":0,"install":"forest install fadeluc-123/tread","url":"https://forest.dev/p/roblox/fadeluc-123/tread","files":"https://api.forest.dev/ai/package/roblox/fadeluc-123/tread/files","readme":"# Tread\n\nTread is Whiteoak Studios' custom character controller for Roblox. It replaces the default Roblox character with server-authoritative movement, client prediction and reconciliation, kinematic collision, replication to other players with per-viewer relevancy and anti-ESP, a lag-compensation history, and client-built rigs with first person. It is built for 150-player servers and beyond.\n\nA game hooks into Tread and keeps its own lifecycle logic, such as spawn, death, respawn, downed and sleepers. Everything game-specific is configuration the game supplies. Frontier Zero is the first game built on it.\n\nTread is a public Wally package, `fadeluc-123/tread`, under the Apache-2.0 license.\n\n## Status\n\n0.1.0 is Tread's first release, with server simulation as its authority model. It is released before every benchmark gate passes, so a game can start building on it. `CHANGELOG.md` lists the gates it meets, at the pass lines set for this release from live readings, and the gates and tests still open, which 0.2.0 carries on with.\n\nEach `0.x` minor is its own line under Wally's version rules, so 0.2.0 may change the API this README documents, and `CHANGELOG.md` says what changed.\n\n## Installing\n\n### Wally\n\nAdd Tread and Volt to the game's `wally.toml`:\n\n```toml\n[dependencies]\nTread = \"fadeluc-123/tread@0.1.0\"\nVolt = \"fadeluc-123/volt@0.1.0\"\n```\n\n`0.1.0` takes any 0.1.x release, and 0.2.0 is a new line a game moves to by changing the pin. The package's realm is `shared`, since the owning client runs the same step as the server, so Wally puts it in `Packages/` and the game mounts that folder at `ReplicatedStorage.Packages`.\n\n### Volt\n\nTread's generated Volt modules ship inside the package, and each requires the game's own Volt runtime at `ReplicatedStorage.Packages.Volt`. Install Volt under the alias `Volt`, on the same major.minor as the Volt compiler Tread was built with. Tread pins the `volt` 0.1.0 compiler, so the runtime must be a 0.1 release; under Wally's version rules, `0.1.0` means at least 0.1.0 and below 0.2.0.\n\n### Promise\n\nTread has no runtime dependency, so installing it puts only Tread in the game's `Packages/`, beside the Volt the game installs itself. Tread's schema doesn't set `yield = promise`, so its generated modules never require Promise, and a game needs no Promise at `ReplicatedStorage.Packages.Promise` for Tread's sake. The one place Tread meets a Promise is the optional `prestream` hook, which returns one from the game's own Promise library, such as `evaera/promise`.\n\n### Place settings\n\nA place that runs Tread has no Roblox character, so it needs these settings:\n\n- `Players.CharacterAutoLoads` off. Tread builds every character itself, and `Player.Character` stays nil.\n- An empty `PlayerModule` under `StarterPlayer.StarterPlayerScripts`, a ModuleScript that returns `{}`, so Roblox's default camera and control scripts never run. The game writes its own camera from `client:getEye()`.\n- `Workspace.Gravity` equal to the shared table's `step.gravity`, so loose physics objects, client ragdolls among them, fall the way characters do. Tread doesn't check it at start. A `server:setGravity` call sets it on the server, and the clients take it from there.\n- `Workspace.StreamingIntegrityMode` set to Disabled when streaming is on. Tread sets each player's `ReplicationFocus` itself, to a focus part it keeps under a server-only Camera, so the game shouldn't set it.\n- `Workspace.UseFixedSimulation` off (Disabled). With it on, a joint's `Transform` can't be written while a track plays, and Tread's rigs write it. No script can read the setting, and Tread doesn't detect it at start, so check it in the place.\n- UI mounted from `StarterPlayerScripts`. Without a character, StarterGui is never copied into PlayerGui.\n\nRojo 7.7.0's serve never writes `StreamingIntegrityMode` or `UseFixedSimulation`, which its plugin marks not scriptable. A place gets them from `rojo build` or from setting them once by hand in Studio.\n\n## Starting Tread\n\nA game passes three tables: a shared table that both entry points take, the server settings and the client settings. Build the shared table once, in a module both realms require, because the server sends a hash of it in its handshake and a client whose table hashes differently never plays.\n\n### The shared table\n\n```lua\n--[[\n    The shared table both of Tread's entry points take: the numbers and\n    field declarations in Config/Tread, with the game's collision\n    functions, water query and movement rules added\n--]]\n\n--!strict\nlocal ReplicatedStorage = game:GetService(\"ReplicatedStorage\")\nlocal Packages = ReplicatedStorage.Packages\n\nlocal Tread = require(Packages.Tread)\n\nlocal Cast = require(ReplicatedStorage.Shared.Classes.Cast)\nlocal Rules = require(ReplicatedStorage.Shared.Classes.Movement.Rules)\nlocal WaterHeight = require(ReplicatedStorage.Shared.Extensions.WaterHeight)\n\nlocal CONFIG = require(ReplicatedStorage.Shared.Config.Tread)\n\nlocal Shared: Tread.Shared = {\n\trates = CONFIG.rates,\n\tticks = CONFIG.ticks,\n\tstep = CONFIG.step,\n\ttolerances = CONFIG.tolerances,\n\thitShapes = CONFIG.hitShapes,\n\tfields = CONFIG.fields,\n\n\tcollision = {\n\t\tray = Cast.ray,\n\t\tsweep = Cast.sweep,\n\t\trest = Cast.rest,\n\t\tsphere = Cast.sphere,\n\t},\n\n\twater = WaterHeight,\n\trules = Rules,\n}\n\nreturn Shared\n```\n\nA game on engine casts passes no collision functions and gives `collision = { include = { ... } }`, the instances the casts may hit.\n\n### Starting the server\n\n```lua\n--[[\n    Starts Tread's server with the game's shared table and server settings,\n    and hands every report Tread raises to the game's cheat score\n--]]\n\n--!strict\nlocal ReplicatedStorage = game:GetService(\"ReplicatedStorage\")\nlocal ServerScriptService = game:GetService(\"ServerScriptService\")\nlocal Packages = ReplicatedStorage.Packages\n\nlocal Tread = require(Packages.Tread)\n\nlocal CheatScore = require(ServerScriptService.Server.Modules.CheatScore)\nlocal Equip = require(ServerScriptService.Server.Modules.Equip)\nlocal TreadShared = require(ReplicatedStorage.Shared.Classes.TreadShared)\n\nlocal SETTINGS = require(ServerScriptService.Server.Config.Tread)\n\nlocal serverSettings: Tread.ServerSettings = {\n\trates = SETTINGS.rates,\n\tcatchUp = SETTINGS.catchUp,\n\tslots = SETTINGS.slots,\n\trelevancy = SETTINGS.relevancy,\n\ttiers = SETTINGS.tiers,\n\tweights = SETTINGS.weights,\n\tshotNear = SETTINGS.shotNear,\n\tbudget = SETTINGS.budget,\n\tantiEsp = SETTINGS.antiEsp,\n\tfootsteps = SETTINGS.footsteps,\n\tsleepers = SETTINGS.sleepers,\n\tnpcs = SETTINGS.npcs,\n\thistory = SETTINGS.history,\n\trewind = SETTINGS.rewind,\n\tteleport = SETTINGS.teleport,\n\n\t-- Runs before each command is simulated, and never in the owner's prediction\n\tbeforeCommand = function (character: Tread.Character, command: Tread.Command)\n\t\tEquip.advance(character, command)\n\tend,\n}\n\nlocal tread: Tread.Server = Tread.startServer(TreadShared, serverSettings)\n\n-- Lives as long as the server. Tread keeps no score, so every report is the game's to weigh\ntread:onReport(CheatScore.report)\n```\n\nA character's life is the game's to run. A spawn, a death and a leave look like this:\n\n```lua\nlocal character: Tread.Character = tread:create(player, at)\ncharacter:setOutfit(outfit)\ncharacter:setTeam(team)\n\n-- A death: the body takes a slot of its own, and the character is released\nlocal body: Tread.Body = character:die(push)\ncharacter:destroy()\n\n-- A leave: the sleeper takes the character's slot, or nil past the sleeper limit\nlocal sleeper: Tread.Sleeper? = character:sleep()\ncharacter:destroy()\n```\n\n### Starting the client\n\n```lua\n--[[\n    Starts Tread's client with the game's shared table and client settings,\n    writes the camera from the eye Tread publishes, and plays each culled\n    enemy's footstep where it fell\n--]]\n\n--!strict\nlocal ReplicatedStorage = game:GetService(\"ReplicatedStorage\")\nlocal RunService = game:GetService(\"RunService\")\nlocal Workspace = game:GetService(\"Workspace\")\nlocal Packages = ReplicatedStorage.Packages\n\nlocal Tread = require(Packages.Tread)\n\nlocal Attire = require(ReplicatedStorage.Shared.Classes.Attire)\nlocal HeldItem = require(ReplicatedStorage.Shared.Classes.HeldItem)\nlocal Movement = require(ReplicatedStorage.Shared.Classes.Movement)\nlocal Sound = require(ReplicatedStorage.Shared.Classes.Sound)\nlocal TreadShared = require(ReplicatedStorage.Shared.Classes.TreadShared)\n\nlocal Camera = Workspace.CurrentCamera\n\n-- Boot-time waits: the asset package may not have replicated yet\nlocal Animations = ReplicatedStorage:WaitForChild(\"Assets\"):WaitForChild(\"Animations\") :: Folder\nlocal Rig = ReplicatedStorage:WaitForChild(\"Assets\"):WaitForChild(\"Character\") :: Model\n\nlocal JOINTS: { [string]: string } = require(ReplicatedStorage.Shared.Config.Rig).joints\nlocal SETTINGS = require(ReplicatedStorage.Shared.Config.TreadClient)\n\nlocal animations: { [string]: Animation } = {}\nfor _, animation: Instance in Animations:GetChildren() do\n\tif animation:IsA(\"Animation\") then\n\t\tanimations[animation.Name] = animation\n\tend\nend\n\nlocal clientSettings: Tread.ClientSettings = {\n\tsample = Movement.sample,\n\tlook = Movement.look,\n\trig = Rig,\n\tjoints = JOINTS,\n\tanimations = animations,\n\tdress = Attire.dress,\n\tundress = Attire.strip,\n\thold = HeldItem.attach,\n\tinterpolation = SETTINGS.interpolation,\n\tbodies = SETTINGS.bodies,\n\tspectate = SETTINGS.spectate,\n\tsmoothing = SETTINGS.smoothing,\n\tdrawDistance = SETTINGS.drawDistance,\n\tlod = SETTINGS.lod,\n\tfirstPerson = SETTINGS.firstPerson,\n}\n\nlocal tread: Tread.Client = Tread.startClient(TreadShared, clientSettings)\nCamera.CameraType = Enum.CameraType.Scriptable\n\n-- At Camera priority, after Tread's own frame, so the camera reads this frame's eye\nRunService:BindToRenderStep(\"GameCamera\", Enum.RenderPriority.Camera.Value, function ()\n\tlocal eye: Vector3, look: Vector3 = tread:getEye()\n\tCamera.CFrame = CFrame.lookAlong(eye, look)\nend)\n\n-- Lives for the client session. An enemy culled from this client has no rig, so its steps arrive as points\ntread:onFootstep(function (step: Tread.Footstep)\n\tSound.playStepAt(step.at, step.kind, step.material)\nend)\n```\n\nTread draws each frame in a render step, `TreadFrame`, at `Enum.RenderPriority.Camera.Value - 1`. A camera bound at Camera priority or later, or connected to `RunService.PreRender`, reads that frame's eye, and one bound below Camera priority reads the previous frame's.\n\n### Configuration\n\nTread holds no game values and ships no default for any setting. Every gameplay number below is the game's own, and every key is required unless its line says optional. Tread's own wire and parity invariants are constants inside the package that no game sets: the codec layouts and `CODEC_VERSION`, the 1/512-stud state quantum, the 0.02-stud skin, the cap of 4 collision bumps, the ±8,192-stud play bound, the 4,096 character slots, the 127 platform ids and the byte bounds on the game's declared fields.\n\n#### The shared table\n\n| Key | What it sets |\n|---|---|\n| `rates.simulation`, `rates.relay` | The step's rate and the relay's, in Hz. |\n| `ticks.standIn` | The ticks a stand-in repeats held inputs for. |\n| `ticks.ahead` | How far ahead of the server a command may run before it is dropped. |\n| `ticks.queueWait` | The cap on a shot's queue wait in the rewind, in simulation ticks. |\n| `ticks.leadMin`, `ticks.leadMax` | The queue, in ticks, the client's clock holds at the server. |\n| `ticks.nudge` | The largest share the client's clock is nudged by, 0 to 1. |\n| `ticks.resync` | How far the command clock may drift, in ticks, before it snaps. |\n| `ticks.debt` | The time debt a frozen client keeps, at least 1 tick. |\n| `step.gravity` | Gravity, studs/s², the value the server starts with. `Workspace.Gravity` should match it. A game changes it while the server runs with `server:setGravity`, and the table keeps its own number. |\n| `step.walk`, `step.sprint`, `step.crouch` | The stance speeds, studs/s. |\n| `step.swim`, `step.swimSprint`, `step.ladder`, `step.ladderSprint` | The swim and ladder speeds, studs/s. |\n| `step.jump` | A jump's upward speed, studs/s. |\n| `step.stepHeight` | The tallest step a body walks up, studs. |\n| `step.walkable` | The lowest ground normal Y a body walks on. |\n| `step.standable` | The lowest ground normal Y a body stands on without gaining height, at most `walkable`. |\n| `step.terminal` | The terminal falling speed, studs/s. |\n| `step.landing` | The seconds in the air before a landing counts. |\n| `step.airEase`, `step.ladderEase`, `step.waterEase` | How fast velocity moves toward its target, per second, in the air, on a ladder and in water. |\n| `step.waterEntry` | The share of velocity kept on entering water, 0 to 1. |\n| `step.radius` | The hull's half width, studs. |\n| `step.standing`, `step.crouched` | The hull's standing and crouched heights, crouched below standing. |\n| `step.eyeStanding`, `step.eyeCrouched`, `step.eyeDowned` | The eye heights above the feet, studs. |\n| `step.eyeEase` | How fast the eye eases to a new height, per second. |\n| `step.clearance` | The eye's distance from walls and ceilings, studs. |\n| `step.clearanceStart` | How far below the hull's top the clearance cast starts, above `clearance`. |\n| `step.lean` | The lean limit either way, degrees. |\n| `step.leanShift` | The eye's shift at full lean, a `Vector3`: sideways, then down. |\n| `step.leanRate` | The fastest lean the server accepts, degrees a second. |\n| `step.headCone` | The head offset's cone either side of facing, degrees. |\n| `step.ladderDrop` | How far below level, in degrees, a climber's look may point before forward input on a ladder loses its up part, and before a body on the ground stops mounting one. Above 0 and below 90. |\n| `step.swimEnter`, `step.swimLeave` | The water depths at which a body starts and stops swimming, `swimLeave` below `swimEnter`. |\n| `step.floatDepth` | How far an idle swimmer's feet float below the surface. |\n| `step.crouchDepth` | The depth past which crouch is refused. |\n| `step.mantleHeight` | The mantle's reach above the last ground, studs. |\n| `step.mantleReach` | How far, in studs, past the hull's front a ledge's face may stand for a jump press, or `client:getMantle()`, to find a mantle. Above 0, and short enough that one tick's move to the face stays under 512 studs/s. Frontier Zero uses the hull's radius, 1.39 studs. |\n| `step.mantleTime` | The mantle's duration in seconds, which must round to 1 to 255 ticks at `rates.simulation`. |\n| `step.mantleArc` | How far, in studs, the mantle's path peaks above the point where its feet clear the ledge's top; 0 or more. |\n| `step.ladderJump` | The speed of a jump off a ladder, studs/s. |\n| `step.headSlide` | How fast a character slides off another's head, studs/s. |\n| `step.lyingBox` | The lying box, `{ length, width, height, lift }`, laid along the body's facing with its center `lift` above the ground. |\n| `step.slide` | Optional. The crouch slide ([The crouch slide](#the-crouch-slide)), which runs only when the table is given. Every key inside it is required. |\n| `step.slide.start` | The horizontal speed, studs/s, a body needs to start a slide. |\n| `step.slide.boost` | The studs/s a slide adds at its start, 0 or more. A start never passes the greater of the body's speed and `step.sprint` plus the boost. |\n| `step.slide.friction` | The studs/s a slide loses each second, 0 or more. |\n| `step.slide.slope` | The share of gravity along the ground, 0 to 1, that speeds a slide downhill and slows it uphill. |\n| `step.slide.max` | A slide's top speed, studs/s, at least `start`. |\n| `step.slide.stop` | The speed, studs/s, below which a slide ends, below `start`. |\n| `step.slide.steer` | How fast a slide's direction turns toward the move input, degrees a second, 0 or more. |\n| `step.slide.cooldown` | The seconds from a slide's end to the next start, at most 255 ticks at `rates.simulation`. |\n| `tolerances.Ground`, `Air`, `Swim`, `Ladder`, `Rider`, `Mantle` | How far a prediction may drift in each state before the owner replays, in whole quanta of 1/512 stud. A crouch slide take","readmeTruncated":true,"readmeFull":"https://api.forest.dev/v1/package/fadeluc-123/roblox/tread/0.1.0/readme"}