roblox-game-systems について
Robloxゲーム開発向けのスキルで、成長、ラウンド、戦闘、インベントリなどのシステム設計例を扱います。サーバー権威の状態管理、クライアント要求の検証、設定データ、ライフサイクル対応を重視します。
主な機能
- 01成長・報酬システムの設計例
- 02ラウンド・チーム・スポーンの設計例
- 03サーバー検証付き戦闘の設計例
- 04インベントリ・ショップ・ペットの設計例
- 05ライフサイクルと設定のチェックリスト
活用シーン
- 01通貨や経験値システムの設計
- 02ラウンド制マッチの構成
- 03検証付き戦闘操作の設計
- 04新システムのライフサイクル要件の確認
インストール
コマンドをコピーしてターミナルで実行します。
$
npx skills add https:/ / github.com/ el4cteo/ roblox-skills --skill roblox-game-systemsインストール後、Claude Code で/roblox-game-systemsを入力して読み込まれたか確認します。
同梱ファイル
SKILL.md と一緒にインストールされる参考資料やスクリプト。
references/combat.mdinventory-shop.mdprogression.mdround-system.md詳細
ゲームシステムのレシピ
すべてのレシピは同じ契約に従います:
- 状態はサーバー上のサービモジュールに存在し、永続化が必要な部分はデータレイヤー(
roblox-data-stores)を経由します。 - クライアントはインテントを送信し、検証済みでレート制限されたリモート(
roblox-security、roblox-networking)を通じて送られ、受け取った状態(属性、スナップショット/デルタ)をレンダリングします。 - 設定はデータ:調整可能な値は共有/サーバーの設定モジュール(またはライブの
ConfigService設定)に置きます。 - ライフサイクルに安全:途中参加、リスポーン、アクション中の離脱、サーバーシャットダウンに対応します。
| システム | リファレンス |
|---|---|
| リーダースタッツ、通貨サービス、XP/レベル、デイリーボーナス、オビーのチェックポイント | references/progression.md |
| ラウンドループ(インターミッション → マッチ → 結果)、チーム、スポーン | references/round-system.md |
| サーバー検証付きの近接戦闘と遠距離戦闘、クールダウン、ダメージの帰属 | references/combat.md |
| インベントリ、ツールの装備、ショップでの購入(ソフト通貨)、追従するペット | references/inventory-shop.md |
通貨サービス(すべての経済が使うパターン)
--!strict
-- ServerScriptService/Server/Services/CurrencyService.luau
local Players = game:GetService("Players")
type Balances = { [Player]: number }
local MAX_BALANCE = 1e12
local CurrencyService = {}
local balances: Balances = {}
local function publish(player: Player)
player:SetAttribute("Coins", balances[player]) -- replicated to every client; UI listens
end
function CurrencyService.load(player: Player, saved: number?)
balances[player] = math.clamp(saved or 0, 0, MAX_BALANCE)
publish(player)
end
function CurrencyService.get(player: Player): number
return balances[player] or 0
end
-- Positive amount only; returns the new balance.
function CurrencyService.add(player: Player, amount: number, _source: string): number?
local balance = balances[player]
if balance == nil or not math.isfinite(amount) or amount <= 0 then
return nil
end
balances[player] = math.min(balance + math.floor(amount), MAX_BALANCE)
publish(player)
return balances[player]
end
-- Atomic check-and-spend; false if insufficient.
function CurrencyService.spend(player: Player, amount: number, _sink: string): boolean
local balance = balances[player]
if balance == nil or not math.isfinite(amount) or amount <= 0 or balance < amount then
return false
end
balances[player] = balance - math.floor(amount)
publish(player)
return true
end
Players.PlayerRemoving:Connect(function(player)
balances[player] = nil -- after the data layer has saved it
end)
return CurrencyService
- 各リソースを所有するモジュールは 1 つだけであり、他の何もそれを書き込みません。ソース/シンクをアナリティクス(
roblox-analytics-liveops)に記録します。 - メモリ内の残高はデータレイヤー(ProfileStore の
profile.Data.coins)によって保存されます。あるいは、プロファイルテーブルをそのまま残高ストアにしてもかまいません。 - 表示のために、クライアントは
player:GetAttribute("Coins")とGetAttributeChangedSignal("Coins")を読み取ります。leaderstats(プレイヤー下のIntValueを持つ Folder)はプレイヤーリストに値を表示します。
新しいシステムのための設計チェックリスト
- 権威ある状態はどこに存在し、どのように永続化されますか?
- クライアントは何を要求でき、各要求はどのように検証され、レート制限されますか?
- セッション途中の参加、リスポーン、退出、テレポート、サーバーシャットダウン時に何が起こりますか?
- どのように調整され(設定)、測定されますか(アナリティクス)?
- プレイヤー 1 人、フルサーバー、高レイテンシの状況でどのように動作しますか?
- クライアントでストリーミングに対して安全ですか?
関連スキル
roblox-architecture、roblox-security、roblox-data-stores、roblox-networking、roblox-characters-animation、roblox-monetization、roblox-ui。
コメント
Markdown 対応