敵やNPCの行動判断を、条件を順にたどる行動ツリーと選択肢を点数で比べるUtility AIで実装し、両者の組み合わせや判断の揺れの調整まで扱うスキル。
- 再利用できる行動ツリーを作りたいとき
- 点数で攻撃や標的を選びたいとき
- 巡回・戦闘のツリーとUtility AIの併用
Robloxのシミュレーターや放置ゲームで、アップグレード価格や転生、放置報酬のバランスを計算し、通貨処理をサーバー側で実装するスキルです。
Design, balance, and implement the economy of a Roblox simulator, tycoon, clicker, or idle game in Luau: upgrade cost curves, buy max, income per second, rebirth/prestige requirements and multipliers, offline earnings, big-number display (1.5K, 3.4M, 2.0Qa), server-authoritative purchases, repairing tampered or old save data, and odds disclosure for paid random items such as eggs, crates, and spins. Includes a Lune pacing calculator. Use when choosing or checking baseCost/costGrowth/rebirth numbers, writing upgrade/currency/rebirth/offline code, or when progress stalls, a rebirth takes far longer than the last, numbers display as 1000K, offline earnings pay too much, or players gain currency they did not earn.
実行スコア 未検証
インストール方法を見るRobloxのシミュレーター、タイクーン、クリッカー、放置ゲーム向けに、通貨やアップグレードの数値を設計し、Luauで実装するためのスキルです。価格の増え方、まとめ買い、転生条件と倍率、放置報酬の上限などを設定表にまとめ、付属のLune用計算ツールで各段階の待ち時間を確認できます。購入処理はサーバー側で残高と価格を確認してから反映し、改変されたセーブデータの補正、大きな数値の表示、課金対象のランダムアイテムの確率表示にも対応します。
ゲーム序盤の成長速度や転生ごとの待ち時間を調整したいとき、通貨が不正に増える問題を防ぎたいときに役立ちます。放置報酬が多すぎる、数値が「1000K」と表示される、古いセーブデータを読み込めないといった問題の見直しにも使えます。
計算スクリプトの実行にはLune 0.11.0が使われています。Roblox Studio上で購入や転生などを確認する場合は、Server & Clientsでのプレイテストが案内されています。セーブデータの読み書き全般や通信プロトコルの詳細は、このスキルの対象外です。
この紹介文は、公開されている SKILL.md をもとに AI(OpenAI Codex)が作成しました。正確な仕様は下の原文を確認してください。
インストールする前に、エージェントに与えられる指示の中身を確認できます。
Choose the economy's numbers with a pacing table before writing gameplay code, then implement them so the server owns every amount. Code targets Luau on Roblox's rolling platform APIs; the bundled scripts are pure Luau and were run with Lune 0.11.0, outside Studio.
baseCost, costGrowth, rebirth requirement and multiplier, or offline
cap and efficiency values for a simulator, tycoon, clicker, or idle game.1e15 that lose precision.When not to use: DataStore reads, writes, session locking and retries → roblox-datastores.
Remote protocol design and rate limiting in depth → roblox-networking. Shop and HUD layout →
roblox-ui + game-ui-ux. A wave-defense economy → tower-defense. Engine-neutral save format
questions → save-systems.
baseCost,
costGrowth, effect, and maxLevel; rebirth baseRequirement, requirementGrowth,
multiplierPerRebirth; offline maxHours, efficiency. Server and client both read it.lune run scripts/balance.luau --print-defaults > economy.json, edit the file, then
lune run scripts/balance.luau economy.json. Read the wait and vs prev columns and tune
until they match the targets below. --help lists every field and its allowed range; a
missing file, invalid JSON, or out-of-range field prints an error and exits 1.scripts/economy_math.luau unchanged into a ModuleScript so the maths you tested is the maths
that runs.lune run scripts/test_economy_math.luau (exits 1 on failure) for the maths; a
Studio playtest with Server & Clients for purchases, rebirth, leaving and rejoining, and
invalid remote arguments.| Quantity | Formula | Notes |
|---|---|---|
| Price of the next level | floor(baseCost * costGrowth ^ owned) | 1.07-1.15 for upgrades bought many times; 1.5-3 for rare large ones |
| Cost from level a to b | baseCost * g^a * (g^(b-a) - 1) / (g - 1) | Players pay the floored per-level sum, slightly less |
| Buy max | walk real prices until the next exceeds the balance or maxLevel | Safer than the log formula with floored prices |
| Rebirth requirement k | baseRequirement * requirementGrowth ^ k | |
| Rebirth multiplier | 1 + k * multiplierPerRebirth | Additive grows slowly; multiplicative (q ^ k) grows exponentially |
| Offline income | floor(min(away, maxHours * 3600) * rate * efficiency) | Away time of 0 or less (clock went back) pays 0 |
Derivations, the rebirth wait-ratio formula, and a worked example: references/formulas.md.
vs prev column is that ratio. With an additive multiplier it approaches
requirementGrowth over time, so requirementGrowth = 3 gives x2.0 rising to x2.7 and rebirth 8
takes 137 days at the default income. requirementGrowth = 1.8 gives x1.2 rising to x1.6.A RemoteEvent carries what the player wants ("buy upgrade Income"), never an amount or a price.
The server looks up the price, checks the balance, spends, and grants without yielding in between.
-- ServerScriptService/Economy.server.luau (excerpt; full version in references/server-patterns.md)
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local EconomyMath = require(ReplicatedStorage.Shared.EconomyMath)
local Config = require(ReplicatedStorage.Shared.EconomyConfig)
ReplicatedStorage.Remotes.BuyUpgrade.OnServerEvent:Connect(function(player: Player, upgradeId: unknown)
local session = sessions[player]
if not session or type(upgradeId) ~= "string" then return end
local upgrade = Config.upgrades[upgradeId]
if not upgrade then return end -- unknown id
local owned = session.levels[upgradeId] or 0
if owned >= upgrade.maxLevel then return end
local price = EconomyMath.levelCost(upgrade.baseCost, upgrade.costGrowth, owned)
if EconomyMath.trySpend(session.wallet, { [upgrade.currency] = price }) then
session.levels[upgradeId] = owned + 1
end
end)
trySpend checks every currency in a multi-currency cost before subtracting any, and rejects
negative or non-finite costs.roblox-networking).sanitizeAmount (non-numbers, NaN, infinity and negatives
become 0; fractions are floored) and sanitizeLevel (also clamps to the current maxLevel).
Drop unknown upgrade ids and return a list of what was repaired, so old versions and edited data
load cleanly.os.time() on the server when the
player leaves; on join, away = os.time() - lastSeen. A missing or future lastSeen counts as
now, which pays nothing.2^53 (about 9e15). If
balances can pass about 1e15, store a mantissa/exponent pair or a base-10 logarithm instead.EconomyMath.formatNumber(value, decimals?) uses the suffixes K, M, B, T, Qa, Qi, Sx, Sp, Oc, No,
Dc, Ud, Dd, Td, Qad, Qid, Sxd, Spd, Ocd, Nod, Vg (1e63), then scientific notation.
999950 / 1000 = 999.95, which rounds to "1000.0K". Round first; if the
rounded value reaches 1000, move to the next suffix ("1.0M"). The tests cover this case.Roblox's paid random items guidelines apply when a random item is bought with Robux, directly or through in-game currency bought with Robux. Per that page:
PolicyService:GetPolicyInfoForPlayerAsync() returns ArePaidRandomItemsRestricted; for those
players, apply one of the treatments the page lists.Build the odds panel with EconomyMath.oddsPercent(outcomes) and roll on the server with
EconomyMath.pickWeighted(outcomes, rng:NextNumber()) from the same list (after applying any
boost), so shown and actual odds cannot drift.
requirementGrowth far above the multiplier's growth; read the
vs prev column and lower requirementGrowth or switch to a multiplicative multiplier.costGrowth of 1.5+ on an upgrade meant
to be bought 50 times (level 50 costs about 637 million times level 0); use 1.07-1.15.1.5 ^ k) without a
matching requirement curve; keep requirementGrowth / q near the ratio you want.task.wait, DataStore call, or other yield.maxLevel, keep
baseCost >= 1 (maxAffordable errors instead of looping forever).lastSeen; use the
server clock, cap, and treat future times as now.math.floor(x * 10) / 10 before choosing the suffix; use
formatNumber.scripts/balance.luau — pacing calculator: per-level price, total, income and wait; per-rebirth
requirement, multiplier, wait and ratio; offline maximum. Run with --help first.scripts/economy_math.luau — the formulas, trySpend, sanitizers, odds and formatNumber as
pure Luau; runs in Lune and in a Roblox ModuleScript.scripts/test_economy_math.luau — tests for every function (lune run, exits 1 on failure).roblox-luau — services, ModuleScripts, and the client/server split.roblox-networking — remote validation and token-bucket rate limits.roblox-datastores — loading and saving the session this skill repairs.roblox-ui — shop, upgrade, and odds panels.roblox-studio-workflow — Server & Clients playtests.https://create.roblox.com/docs/production/monetization/paid-random-itemshttps://create.roblox.com/docs/scripting/events/remotehttps://create.roblox.com/docs/scripting/security/client-server-boundaryhttps://create.roblox.com/docs/reference/engine/classes/PolicyServicehttps://create.roblox.com/docs/reference/engine/datatypes/Randomhttps://lune-org.github.io/docsまだレビューはありません。使ってみた感想をお寄せください。
ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。
まだコメントはありません。最初のコメントを書いてみませんか。
敵やNPCの行動判断を、条件を順にたどる行動ツリーと選択肢を点数で比べるUtility AIで実装し、両者の組み合わせや判断の揺れの調整まで扱うスキル。
ゲームの音量バランスと状況に応じた音楽の変化を設計するスキル。音の種類ごとの一括調整、会話中のBGM抑制、効果音の変化、拍に合わせた演出を扱います。
RustのBevyゲームで、部品データと処理を分けるECS設計を支援。アプリ構成、データ検索、処理順序、移動速度やデータアクセス競合の修正を扱います。
ゲームの2D追従カメラや3D視点操作を実装・調整するスキル。滑らかな追従、進行方向の先読み、表示範囲の制限、壁へのめり込み対策を扱います。
カードゲームの山札・手札・捨て札の管理から、ドロー、シャッフル、ターン進行、コストと効果の処理順まで、基本ルールを整理して実装につなげるスキル。
ゲームの見た目に統一感を持たせ、スプライトや背景、UI素材の制作・調達からサイズ調整、実機での見え方の確認、出典・ライセンス管理まで進めるスキル。