游戏脚本生成器

一款自动生成Roblox游戏脚本的工具,通过6个简单输入生成完整的游戏系统,包括核心游戏循环、进度系统、奖励分配等功能。

  • by ClabHavingFun
  • Python
  • 本地部署
  • 更新于
在 GitHub 查看 PrestigedPowerAI/icgl-mcp-server

使用说明

ICGL MCP Server

Instant Core Gameplay Loop Generator - Automatically generate complete Roblox game systems from 6 simple inputs.


🚀 Project Status

Current Phase: Phase 1 - Deployment
Status: ✅ Production Ready
Last Updated: January 25, 2026

✅ Completed

  • [x] Core MCP server implementation
  • [x] All 14 critical bugs fixed (See BUG_FIX_SUMMARY.md)
  • [x] All 5 genre tests passing
  • [x] Web API wrapper created
  • [x] Deployment configuration ready

🎯 Next Steps

  1. Deploy to Railway/Heroku (See DEPLOYMENT_GUIDE.md)
  2. Build Roblox Studio Plugin (See IMPLEMENTATION_ROADMAP.md)

👉 New to this project? Start here: START_HERE.md


What It Does

Transforms your game concept into ready-to-use Lua scripts in seconds:

  • ✅ Core gameplay loop with state management
  • ✅ Progression system (Linear/Exponential/Prestige)
  • ✅ Reward distribution with multipliers
  • ✅ Session management with AFK detection
  • ✅ Player action handling with cooldowns

Genre-agnostic • Deterministic • Production-ready


Quick Start

1. Define Your Game

Create a JSON object with 6 fields:

{
  "genre": "Simulator",
  "coreAction": "Clicking",
  "objective": "Unlock new zones",
  "progressionStyle": "Exponential",
  "sessionLength": "Short",
  "playerCount": "Small Multiplayer"
}

2. Generate Scripts

Option A: Using Python directly

from server import handle_request

payload = {
    "genre": "RPG",
    "coreAction": "Fighting",
    "objective": "Defeat dungeon bosses",
    "progressionStyle": "Prestige",
    "sessionLength": "Long",
    "playerCount": "Solo"
}

result = handle_request(payload)
print(result)

Option B: Run the test examples

python run_tests.py

3. Use the Generated Scripts

The output contains 5 ready-to-use Lua files:

  • CoreLoop.lua - Main game loop and state machine
  • Progression.lua - XP/leveling system
  • Rewards.lua - Reward calculation and distribution
  • SessionManager.lua - Session timing and player management
  • PlayerActions.lua - Action handlers with cooldowns

Copy these scripts directly into your Roblox Studio project.


Input Fields

Field Type Options Description
genre string Any Your game type (e.g., "Simulator", "RPG", "Tycoon")
coreAction string Any Main player action (e.g., "Clicking", "Fighting", "Building")
objective string Any Primary goal (e.g., "Unlock zones", "Defeat bosses")
progressionStyle enum Linear, Exponential, Prestige How difficulty scales
sessionLength enum Short, Medium, Long Target play duration
playerCount enum Solo, Small Multiplayer, Massive Multiplayer Player capacity

Output Structure

{
  "metadata": {
    "skill": "core_gameplay_loop",
    "version": "1.0",
    "generatedAt": "2026-01-20T05:38:12.885216+00:00",
    "inputHash": "28fcfda02..."
  },
  "normalizedInput": { ... },
  "scripts": {
    "CoreLoop.lua": "...",
    "Progression.lua": "...",
    "Rewards.lua": "...",
    "SessionManager.lua": "...",
    "PlayerActions.lua": "..."
  },
  "config": {
    "progressionRate": 1.5,
    "rewardMultiplier": 1.25,
    "sessionTargetMinutes": 7.5,
    "playerScaleFactor": 5.0
  }
}

Examples

Tycoon Game

{
  "genre": "Tycoon",
  "coreAction": "Purchasing",
  "objective": "Build the biggest empire",
  "progressionStyle": "Exponential",
  "sessionLength": "Medium",
  "playerCount": "Small Multiplayer"
}

Battle Royale

{
  "genre": "Battle Royale",
  "coreAction": "Surviving",
  "objective": "Be the last player standing",
  "progressionStyle": "Linear",
  "sessionLength": "Short",
  "playerCount": "Massive Multiplayer"
}

Idle Clicker

{
  "genre": "Clicker",
  "coreAction": "Clicking",
  "objective": "Reach maximum upgrades",
  "progressionStyle": "Prestige",
  "sessionLength": "Long",
  "playerCount": "Solo"
}

How It Works

  1. Validation - Ensures all required fields are present and valid
  2. Normalization - Standardizes input format (capitalization, sentence case)
  3. Configuration - Calculates optimal rates and multipliers based on inputs
  4. Generation - Creates customized Lua scripts with your game's parameters
  5. Output - Returns complete package with metadata and deterministic hash

Same inputs always produce identical outputs (except timestamps).


File Structure

icgl-mcp-server/
├── server.py           # Main MCP handler
├── validator.py        # Input validation
├── normalizer.py       # Input normalization
├── formatter.py        # Output formatting and config builder
├── generator.py        # Lua script generation
├── run_tests.py        # Test runner
├── test_inputs.json    # Example inputs
├── spec.md             # Full technical specification
└── README.md           # This file

Requirements

  • Python 3.7+
  • No external dependencies

Error Handling

Invalid inputs return an error response:

{
  "error": "InvalidInput",
  "message": "Missing required fields: genre, objective"
}

Next Steps

  1. Modify test_inputs.json with your game concept
  2. Run python run_tests.py to see the generated output
  3. Copy the Lua scripts from the output
  4. Paste them into Roblox Studio
  5. Customize the placeholder functions (marked with comments)

Technical Details

For complete specifications, constraints, and versioning rules, see spec.md.

Version: 1.0
License: MIT
Author: ICGL Team