本文へ移動
cccskills
無料GitHub で公開

scenario-roblox-gameplay

Use when building Roblox gameplay systems: NPC or enemy AI that patrols, chases and attacks, state machines or behavior trees, 'NPC pathfinding stuck', 100 zombies lag the server, hitboxes, melee combos, M1 combat, 'hits register twice', raycasts, Spherecast, Shapecast, guns and projectiles, 'bullets go through walls', knockback and stun, LinearVelocity, VectorForce or AlignPosition movers, replacing BodyVelocity, cars and vehicles with suspension, 'car flips', VehicleSeat, network ownership of NPCs and vehicles, round loops, BindToSimulation logic.

日本語の概要は準備中です。原文の説明を表示しています。

インストール方法を見る

含まれるファイル(24)

  • SKILL.md20.3 KB
  • references/critique.md4.0 KB
  • references/expert-notes.md12.2 KB
  • references/gui-paths.md8.4 KB
  • references/procedures.md35.9 KB
  • references/sources.md13.5 KB
  • scripts/agentkit/gameplay/boot/GameplayClient.client.luau1.9 KB
  • scripts/agentkit/gameplay/boot/GameplayServer.server.luau6.8 KB
  • scripts/agentkit/gameplay/Car.luau9.6 KB
  • scripts/agentkit/gameplay/CarSafety.luau3.0 KB
  • scripts/agentkit/gameplay/Combo.luau3.4 KB
  • scripts/agentkit/gameplay/DebugDraw.luau3.9 KB
  • scripts/agentkit/gameplay/GameplayAudit.luau7.6 KB
  • scripts/agentkit/gameplay/GameplayInputs.luau2.7 KB
  • scripts/agentkit/gameplay/Hitbox.luau4.6 KB
  • scripts/agentkit/gameplay/lune_gameplay_audit.luau840 B
  • scripts/agentkit/gameplay/lune_unit.luau15.3 KB
  • scripts/agentkit/gameplay/NpcBrain.luau3.2 KB
  • scripts/agentkit/gameplay/NpcPool.luau1.7 KB
  • scripts/agentkit/gameplay/NpcService.luau13.1 KB
  • scripts/agentkit/gameplay/PathGuard.luau2.8 KB
  • scripts/agentkit/gameplay/Projectile.luau2.7 KB
  • scripts/agentkit/gameplay/StateMachine.luau4.2 KB
  • scripts/rbx_gameplay.py14.5 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Roblox gameplay systems (gameplay systems programmer)

Target line: Roblox Studio (October 2026 build) on macOS, driven through the scenario-roblox-expert toolkit.

At expert level, a gameplay system is a pure rule tested in Lune, wired to the engine by one server scheduler, and proven in a playtest with measured server cost. The core stance: the client sends intent, the server decides every hit with a spatial query, and no number ships unmeasured. If a sibling skill named here is missing from your available skills, ask the user to install it (npx skills add scenario-labs/skills --skill <name>); unattended, proceed from tool schemas and flag the gap.

REQUIRED BACKGROUND: scenario-roblox-expert (channels, review loop, toolkit, current-Roblox traps).

Status (2026-10-19): 23 live tests pass in Studio 0.743 (Edit probes, NPC bench, hunt, debug drawings, combo, remote flood, car and its exit with the throttle held, movers, every doc snippet in the playtest Server); 6 offline checks pass (23 Lune specs, luau-lsp on both type solvers over 15 kit files and 12 snippets). Not yet run: two-player combat (each test client opens a Studio window), a touch device, a route through a pathfinding modifier and link.

Stance (the expert delta)

  1. Intent up, hits decided on the server. The client fires Attack with no arguments; the server picks the combo step from its own clock and queries a box in front of the root. Spatial queries replace Touched (Ludius, gmz904QpfxU 00:01:15): a client-owned part can fire Touched on the server anywhere (Network ownership doc). Validation and rate limits: scenario-roblox-networking.
  2. Know what a query skips. Spherecast, Blockcast and Shapecast ignore parts they start inside (veraktt, GtqFcyFgIXQ 00:19:33). Check the start with an overlap query. A Shapecast's final position is origin + direction.Unit * Distance; Position is the contact point (Crusherfire, EIOwGMZYidw 00:07:12). Use ExcludeInstances or IncludeInstances, never FilterDescendantsInstances, and build the list per shot (BrawlDev, u6I17z6ggUg 00:28:41).
  3. Sweep, then move; step by dt. Cast the whole step before committing it (veraktt 00:12:22). Trapezoid displacement makes the path independent of frame rate (BrawlDev, 0Dt-Ab8czPw 00:33:08); measured in Lune: 30, 60 and 240 Hz agree within 0.001 studs, Euler drifts 0.5.
  4. One scheduler for every NPC, measured at the target count. One Heartbeat thinks one bucket per frame, one worker computes paths on a budget, perception is distance first and one raycast against static geometry [added]. Measured with 100 R15 NPCs: server 60 fps, frame p95 17.6 ms, AI 0.14 ms per frame patrolling and 0.26 ms chasing; the physics step grew to 1.8 ms. Humanoid physics costs more than the brain, so measure at your count with the AgentKit Stats, and cut the per-Humanoid cost: unused states disabled, BreakJointsOnDeath false, no state machine on static NPCs, models pooled across waves (P5).
  5. Pin NPC roots to the server. An unanchored NPC near a player is simulated, and movable, by that client (measured: an unpinned NPC 6 studs away belonged to the player); SetNetworkOwner(nil) after parenting (Network ownership doc). Purely decorative crowds can run as client Humanoids fed by one attribute per NPC every 5 s (Suphi Kaner, JyMxrcqEzu8 00:13:50).
  6. The brain is data with hysteresis. States with onEnter, onStay, onExit and transitions as a list (Miller, Roblox Learn, nlVpAZEkxgo 00:00:57). Enter Attack at 5 studs, leave above 6.5, give up 4 s after losing sight [added]. Pathfinding success is pcall AND Status == Success (BrawlDev, ckA4fVkAjIA 00:15:48); recompute on Blocked only when the index is at or after the next waypoint (Pathfinding doc). Re-issue MoveTo, because it gives up after 8 s. Price routes in one Costs table (materials, PathfindingModifier and PathfindingLink labels) instead of special-case code; compute only on the ground, in a loaded world, under 3,000 studs; a failed move snaps to that waypoint, never the goal (P12).
  7. Stun cancels pending hits. A hit victim's queued swing is dropped and its requests refused for a bounded stun (ArTheDev, Aoc9HkGHu_8 00:02:57). One hit per character per swing, never per limb (Ludius 00:04:06). Knock a Humanoid back with a LinearVelocity held 0.2 s: one ApplyImpulse moved a standing dummy 1.2 studs, the LinearVelocity 10.5 [measured].
  8. Cars are constraints plus ownership. Per wheel one CylindricalConstraint and one SpringConstraint on the same attachments, upper limit below 0 (Suphi Kaner, FVOowr2DXbM 00:10:19). The driver owns the car while seated (Network ownership doc) and the server keeps a speed check; competitive racing goes to Server Authority. Check the steer sign live: this kit's first build turned left on D. Keep the center of mass low: dense low chassis, light body, seat low and central (FVOowr2DXbM 00:54:05). On exit, release the motors, give loose parts the same owner, leave through the highest exit point (P9, P14).

Establish first

  • NPC count, and whether NPCs deal or take damage (server) or only decorate (client crowd).
  • Hit model: melee box, hitscan ray, or projectile with travel time and drop (Weapons kit doc).
  • Competitive or casual: competitive movement and vehicles go to Server Authority (scenario-roblox-networking).
  • Platforms: phones are the most common device, so every combat action gets a key, a gamepad button and an on-screen touch button bound through InputBinding.UIButton (P7).

Defaults when unanswered: NPCs on the server, 6 buckets, 30 paths per second; melee box 5 by 5 by 5 studs at 3.5 studs; a 0.25-stud sphere sweep for projectiles; the car numbers below.

Procedure

Full code and test results: procedures.md. Modules: scripts/agentkit/gameplay/; Python: scripts/rbx_gameplay.py.

  1. Install. Goal: kit, boot scripts and Input Action instances in the open place. How: rbx_gameplay.install(studio) writes Source in Edit (P1). GATE: the playtest Server sees the hook and remotes; the Client sees GameplayInputs.Combat.Attack; no boot error in the console.
  2. Probe the queries. Goal: facts for this build. How: the Edit probes (P2). GATE: Spherecast from inside returns the far part; Shapecast distance within 0.05 studs of the expected travel.
  3. Brain in Lune. Goal: a readable, tested decision table. How: StateMachine plus NpcBrain (P4). GATE: lune run lune_unit.luau passes.
  4. Crowd and cost. Goal: a known server cost. How: NpcService and the bench (P5). GATE: 0 of 100 roots client-owned; server fps and p95 recorded at each count; budget agreed with scenario-roblox-performance.
  5. Hunt. Goal: perception, path and melee together. How: walk_to drives the player in sight, then behind a wall (P6); path failure rules and route pricing (P12). GATE: the NPC reaches the player behind the wall and lands a hit; capture.
  6. Combat. Goal: a combo that resists spam and stun. How: Input Action, intent remote, Combo and Hitbox.box (P7); projectiles with Projectile (P8). GATE: two front dummies at 58 health, the one behind untouched; under spam, no accepted swing closer than 0.24 s to the previous one; a 0.2-stud wall stops every projectile. user_keyboard_input delivers presses 0.13 to 0.20 s apart whatever the waits: flood tests fire the remote from a client script (P7).
  7. Vehicle. Goal: drives, steers, stays upright. How: Car.build, Car.serve, Car.controller (P9). GATE: driver owns the chassis; W for 3 s moves it forward more than 30 studs; W plus D turns right more than 20 degrees; UpVector.Y stays above 0.8; ownership returns to automatic on exit; leaving with the throttle held stops the car (P14); capture before and after.
  8. Audit and review. How: GameplayAudit plus the lead's Audit (P3), the critique, one contact sheet. GATE: 0 errors.

Numbers

ValueDefaultRelative to
Think rate10 per NPC per second6 buckets at 60 fps
Path budget30 per secondwhole server
Detect, attack, leave range60, 5, 6.5 studstarget root; chase range 1.5 times detect
Lose sight4 slast time seen
Humanoid MoveTo timeout8 sre-issue every think
Path limits3,000 studs, 20,000 nodes; both fail as a bad Statusstart to goal (P12)
Route costs1 default, 20 to 1,000 last resort, math.huge neverCosts keys: materials, modifier and link labels (P12)
Touch button72 px, bottom right, clear of jumpshown only while PreferredInput is Touch; layout check: scenario-roblox-ui (P7)
Combo damage10, 12, 20steps 1 to 3
Combo gaps0.30, 0.30, 0.45 s with 0.8 toleranceprevious accepted swing
Finisher knockbackLinearVelocity 45 studs/s for 0.2 s, MaxForce mass times gravity times 20away from the attacker
Chain window, finisher lock, stun0.9, 0.6, 0.35 slast swing or hit
Cast reach1,024 studs (shape casts), 15,000 (ray)per call
SuspensionStiffness 3500, Damping 200, FreeLength 2.8Suphi Kaner
Slide limitsupper -1, lower -2along Attachment0 X (up)
DriveMaxSpeed / radius, torque 5000, idle 2000rear wheels
Steer30 degrees over 0.4 sfront body attachments
Car speed check1.5 times MaxSpeed, twice in 1 sserver, while a driver owns it
100 NPCs, measured60 fps, p95 17.6 ms, heartbeat 0.27 ms, physics 1.8 ms, 21.5 kbps sentpatrolling, server, Studio 0.743
One path, measured65 ms wall time (yields), 0 failuresComputeAsync, open baseplate
Casts, measuredSpherecast 0.46, Raycast 0.30 microseconds50 studs, small include list
Car, measured177.9 studs in 3 s, top 51.0 studs/s; 112 degrees in 2.5 sW, then W plus D

Quality gates

  • Measurable: Lune specs; rbx_check 0 errors; GameplayAudit 0 errors; NpcService.stats() (states, client-owned roots, AI ms, paths); AgentKit Stats in the Server; dummy health and hit counts; car samples (distance, heading, UpVector.Y).
  • Visual: captures of the crowd, the hunt behind the wall, dummies after the finisher, the car before and after a drive, read through rbx_review.contact_sheet (1,600 px or less). Turn on Navigation mesh or Network owners in Visualization Options, and draw waypoints and query boxes with DebugDraw adornments, depth-tested so captures show them (P13).
  • Key tests record client input and rerun when it differs from the keys sent (P7).

Common mistakes

MistakeSymptomFix
Touched deals damagehits through walls, exploit damagebox query on the server
One result per limb3 to 5 hits per swingkey results by character model
Projectile starts inside a wallshot passes throughoverlap query before the first sweep
Teleport by Position per frametunneling at speedsweep, then move
FilterDescendantsInstancessuperseded API in new codeExcludeInstances, IncludeInstances
Debug parts queryablecasts stop at your own markersCanQuery false (Crusherfire 00:10:42)
MoveToFinished:Wait()NPC freezes after 8 sre-issue MoveTo; handle reached == false
Path computed mid-air or before the map loadsbad Status, NPC stands stillwait for FloorMaterial, gate on load (P12)
Snap to the goal after a failed moveNPCs pop through wallssnap to that waypoint (P12)
Hazards avoided in codebrittle special casesmodifier label priced in Costs (P12)
Every Humanoid fully enabledphysics step grows per NPCtrim states, pool, no state machine when static (P5)
ComputeAsync without pcallscript dies on a bad pathpcall plus Status
NPC root unpinnedthe nearest client moves NPCsSetNetworkOwner(nil)
One loop per NPCcost grows with scriptsone scheduler, buckets
BodyVelocitydeprecated moverLinearVelocity, VectorForce, AlignPosition
Constraint without Attachment0nothing moves, no errorGameplayAudit constraint-no-attachment
Suspension upper limit 0spring bottoms out, car bouncesupper -1
Reading Throttleno analog gamepad or touchThrottleFloat, SteerFloat
Passenger owns the carlag for the driverreassign on Occupant change
One fixed exit sidea flipped car drops the player under the maphighest exit point (P14)
Motor values left on exitthe empty car drives onrelease the motors on exit (P14)
Keyboard-only combatphones cannot attacktouch UIButton binding (P7)

Handoffs

  • Receives from scenario-roblox-architecture: the RoundMachine round loop, the Binder for tagged weapons and hazards, the DamageService slot.
  • Delivers to scenario-roblox-networking: hitbox, projectile and ability rules to validate (HitCheck with rewind), the car speed flag for the suspicion score, Server Authority settings.
  • Delivers to scenario-roblox-animation: NPC State and Action attributes and combo steps to drive tracks; under Server Authority, no cached tracks.
  • Delivers to scenario-roblox-vfx-audio: hit position, normal and step for impact effects.
  • Delivers to scenario-roblox-ui: the GameplayInputs contexts and actions for prompts and remapping.
  • Delivers to scenario-roblox-performance: the NPC bench numbers and budgets.
  • Shares with scenario-roblox-luau: fixed-step code (BindToSimulation) and Deferred event rules.

Current Roblox notes

  • RaycastParams and OverlapParams: ExcludeInstances and IncludeInstances supersede FilterDescendantsInstances and FilterType (2026-04-07). RaycastParams.Margin and SizeGradient are in the reference, but setting either raises "not enabled yet" in 0.743 (P2): keep Spherecast for thick rays.
  • Collision groups live on workspace (RegisterCollisionGroup, CollisionGroupSetCollidable); the PhysicsService methods are deprecated.
  • PathfindingService:CreatePath plus Path:ComputeAsync; FindPathAsync and ComputeRawPathAsync are deprecated. PathfindingModifier and PathfindingLink need no beta.
  • RunService:BindToSimulation is documented as needing Workspace.UseFixedSimulation. In 0.743 it ran in Edit and Play on a place that never set it (P11); scripts cannot read the property from the Studio MCP context, so set it explicitly in the Rojo project.
  • Creator Store models are sandboxed (2026-05-13): vendor libraries such as FastCast as source.

References

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

コメント

ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。

まだコメントはありません。最初のコメントを書いてみませんか。

送信するとすぐに公開されます。メールアドレスや電話番号などの個人情報は書かないでください。URL は 2 つまでです。

0 / 1000 文字

このフォームは reCAPTCHA で保護されており、Google のプライバシーポリシーと利用規約が適用されます。

同じリポジトリのスキル

Handle review comments received on GitHub for the current branch's PR or a given PR number or URL, by triaging each unresolved thread, fixing what is warranted, pushing, and replying in each thread, when asked to address, fix or answer PR comments. Works in any Scenario repository.

日本語の概要は準備中です。原文の説明を表示しています。

scenario-labs/skills1,0882026年10月23日 更新

Generate one short Conventional Commits squash message describing only the net diff between the PR's base and head, set its header as the PR title, validate it with the repository's commitlint and both copy its description to the clipboard and display it, when asked for a squash message. Works in any Scenario repository, whatever its default branch.

日本語の概要は準備中です。原文の説明を表示しています。

scenario-labs/skills1,0882026年10月23日 更新

Refresh the current pull request description from its net changes, following the repository's PR template, when asked to update or write the PR summary. Works in any Scenario repository, whatever its default branch.

日本語の概要は準備中です。原文の説明を表示しています。

scenario-labs/skills1,0882026年10月23日 更新

scenario

無料

Use when connecting an AI agent to Scenario (scenario.com) through MCP, or when a task involves generating images, video, 3D, audio, sprites, textures, or game assets. Also when picking a Scenario model, running a LoRA, refining a generation prompt, uploading reference images, waiting on generation jobs, checking credits or quota, hitting Scenario auth, scope, or Forbidden errors, or setting up mcp.scenario.com in Claude Code, Cursor, VSCode, or another agent.

日本語の概要は準備中です。原文の説明を表示しています。

scenario-labs/skills1,0882026年10月23日 更新

Use when generating or handling 3D assets through the Scenario MCP server, including text-to-3D or image-to-3D meshes, GPT-6 Astra 3D or Claude Opus 5.5 3D, GLB, FBX, OBJ, STL, or VOX files, PBR-textured or game-ready models, voxel models, multi-view reconstruction, editing a mesh by prompt, retexture, remesh, UV unwrap, auto-rigging a biped or quadruped, or retargeting an animation, previewing a mesh in the 3D viewer, or downloading a model for import into Unity, Unreal, Godot, or Blender.

日本語の概要は準備中です。原文の説明を表示しています。

scenario-labs/skills1,0882026年10月23日 更新

Use when generating navigable 3D worlds or Gaussian splat scenes on Scenario via MCP: text-to-world, image-to-world, a 360 panorama or skybox turned into a walkable splat, multi-view photos or a video walkthrough reconstructed as a splat, or one object photo to splat. Keywords: World Labs Marble 1.1, 1.1 Plus, 1.0 Draft, Hunyuan World, HY World, image-to-skybox, skybox-to-splat, multiview-to-splat, TripoSplat, gaussian splatting, 3DGS, spz, world generation, explorable scene, VR.

日本語の概要は準備中です。原文の説明を表示しています。

scenario-labs/skills1,0882026年10月23日 更新

scenario-labs のスキルをすべて見る

このスキルの問題を報告する