Project Info
Inspiration
The idea behind Hackathon Roblox AI Agent was born due to the idea of our Future Tech Foundation which is a non-profit making organization run by myself and my younger brother who was then aged 13 and 12 respectively. The idea has been conceived due to the reason that there are quite a few children who have an idea of the game but lack the programming skills or whatever is needed to develop the game. The children just waste a lot of time playing someone else's world; however, when they try developing a world in Roblox studio, nothing happens. With the help of our agent, the child can describe his/her game in natural language, see it develop in Roblox Studio, play it and even ask for some changes in it.
What it does
The Hackathon Roblox AI Agent turns a child’s game idea into a playable Roblox experience. A creator describes what they want, and the agent reads the live Roblox Studio project, understands its structure, creates a plan, and begins building. It can generate environments, mechanics, user interfaces, assets, and Luau scripts. It then tests the result, identifies problems, and improves the game instead of assuming the first attempt worked. The agent follows a ReAct-style cycle: reason, act, observe, and decide what to do next. It also uses a Reflexion-inspired process to study failed attempts and turn them into guidance for the next iteration. The result is more than prompt-to-code generation. The agent translates a child’s intent into a tested experience they can play, evaluate, and continue shaping.
How we built it
The agent was implemented using Codex, a TypeScript and Express backend, and a safe Roblox Studio plugin. Codex implements planning, reasoning, tool selection, and coding choices. The backend manages the coordination of the process and provides 26 typed capabilities for inspecting projects, making instances, modifying properties, scripting in Luau, managing assets, and testing. The Roblox Studio plugin transforms the tool calls made by the agent into safe actions on the live project. It allows the creator to work in the Roblox Studio while enabling the backend to manage the agent. Our system constantly analyzes, plans, constructs, tests, reflects, and iterates. We have also developed 16 automated tests that verify syntax, asset loading, game initialization, movement, user interface, mechanics, performance, and win condition. In order to enhance security and reliability of our system, we have implemented confirmations for high impact actions, timeouts, rollback, quarantine of assets, and processing of animations and Meshy 3D asset pipeline.
Challenges we ran into
However, the most important problem that we have encountered was the problem of reliability. There are many interconnected subsystems in the game created in Roblox: scripts, physics, assets, UI, player interaction, goals and victory conditions. Even though the code is syntactically correct, it may fail because of lack of particular elements, wrong order of construction, mechanisms conflicts and so on. The way to deal with the issue was letting the agent watch the evidence rather than believe in the produced code. With the help of the ReAct cycle, the agent will perform the action, analyze its result and change its strategy accordingly. With the help of Reflexion, the agent will analyze the errors that were made during the process and consider them for the next attempt. Moreover, we had to get the balance between autonomy, safety and simplicity. The agent should be autonomous enough to be able to produce the games. At the same time, it should remain clear to the beginners.
Accomplishments we're proud of
Wear our proud of our agent does not stop with the creation of the code. The prototype can perform analysis of the project in Roblox Studio, its understanding in terms of its composition, changes required, creation of the environment and game logic, generation of Luau scripts, testing the experience, detection of errors, fixing of the error, and validation of the results. Our technology employs 26 typed utilities, 16 automated tests, runtime verification, reflexion-based re-executions, rollbacks, timeouts, confirmation controls, asset quarantine, animation capability, and 3D asset management. The greatest success of our work in this project is the realization of our concept until playing experience level. Even a beginner developer can move from the idea to the game without having any experience in programming. For the perspective of Future Tech Foundation, the prototype demonstrates how powerful AI can be the creative tool available to kids with great ideas.As far as the Future Tech Foundation is concerned, our prototype shows that the AI can become a helpful tool to implement kids' ideas in their creative process.
What we learned
The truth was revealed that an effective AI developer does not need only to program. It has to be able to analyze the situation, develop a strategy, act purposefully, evaluate its result, realize the failure, and transform itself in order to apply a new strategy if the old one fails. The experience with ReAct helped us see how the process of game development can be split into several interrelated stages interacting with each other through the feedback received from Roblox Studio. The Reflexion made us understand that a failure can be a valuable source of data for the next stage. We got one more interesting piece of knowledge from this practice. We learned that access of children to the Future Tech Foundation is not only a matter of giving kids appropriate software. It must be safe, understandable, tolerant, and developed in a beginner language. An AI agent cannot replace the creativity of children or cover the process of learning. On the contrary, it has to be transparent, assist kids in decision-making, and encourage their desire to learn and create.
What's next
The second objective is connected to the idea of developing a visual and creative educational agent. It is supposed to improve the ability to analyze screenshots, evaluate UI, observe the behavior of NPCs, create environment, produce higher quality animations, and work with complicated 3D models. In addition, the agent has to back up its propositions and changes in terms of language that would be clear for young creators. Children must remain active participants making decisions and not passive users of the automatic system. Within the framework of the Future Tech Foundation, we are going to use this instrument in workshops, receive the feedback of young creators, make the connection between the students and their mentors, equip them with necessary tools and access to competitions. The Foundation is going to supply us with the human factor that we cannot get from the software.Therefore, the final objective of our project will not be limited by acceleration of the process of Roblox creation. The long-term objective of our project will also include the help of children in becoming game creators themselves rather than players of other people's games.
Roblox Hackathon Agent
An OpenAI-powered Roblox Studio game-building agent that turns a natural-language goal into inspected, implemented, and verified changes inside an open Roblox project.
GPT-5.6 powers the agent's planning, tool selection, final responses, and evidence-grounded Reflexion retries through the official OpenAI SDK. Typed tools connect the model to a queued HTTP bridge and a Roblox Studio plugin, while human approval protects destructive actions. ChatGPT and OpenAI Codex also helped design, implement, test, and document the project.
Runtime: OpenAI GPT-5.6 via the Chat Completions API and function calling. Set
OPENAI_MODELto use another compatible OpenAI model.
What it can do
- Inspect the Explorer hierarchy, selection, scripts, properties, camera state, and recent output.
- Create and modify Roblox instances and Luau scripts.
- Build many related objects from one declarative specification.
- Generate TweenService scripts, KeyframeSequences, animation previews, and animation configurations.
- Search Creator Store models, quarantine them, scan their scripts, and remove scripts by default before insertion.
- Start Meshy text-to-3D jobs and download validated GLB or FBX artifacts.
- Observe Play mode, runtime errors, output, player state, and typed assertions.
- Evaluate whether an attempt produced verified evidence instead of trusting the model's final message.
- Reflect on failed or inconclusive attempts and retry with a revised strategy.
The agent is genre-neutral. Its behavior comes from the user's goal and the systems it generates rather than a hard-coded game template.
Agent structure
User request
│
▼
Express API server
│ creates a task
▼
ReActAgent ⇄ OpenAI GPT-5.6
│ plans, selects functions, and reads observations
▼
Typed tool registry
│
├──► Backend integrations such as optional Meshy 3D generation
│
└──► StudioBridge command queue
│
▼
Roblox Studio plugin
│ inspects or changes the open project
▼
Structured tool result
│
└──────────────► ReActAgent
Completed attempt
│
▼
OutcomeEvaluator
├── passed ─────────────────────────────► Complete
└── failed or inconclusive ─────────────► OpenAI-powered Reflexion
│ revised strategy
└────────► Next ReAct attempt
1. API and task orchestration
backend/src/server.ts is the backend entry point. It exposes endpoints for health, readiness, Studio sessions, queued commands, command results, and agent tasks.
When the plugin submits a user goal, the server:
- Confirms that the model credentials exist.
- Confirms that the requested Studio session is connected.
- Creates an asynchronous task.
- Starts a new
ReActAgent. - Records state events such as
planning,acting,observing,evaluating, andreflecting. - Returns a task ID that the plugin can poll for progress and results.
The API is protected by AGENT_API_KEY, except for the public health endpoint.
2. ReAct reasoning loop
backend/src/agent/ReActAgent.ts controls the main agent loop. OpenAIClient initializes the official OpenAI SDK with OPENAI_API_KEY. The ReAct agent calls the OpenAI Chat Completions API with the configured model and exposes the project tool registry as function definitions.
For each attempt, the agent:
- Sends the system instructions, user goal, and tool definitions to the model.
- Receives one or more typed tool calls.
- Executes those calls and records every input and observation in a trace.
- Returns each structured result to the model.
- Continues until the model stops calling tools or the iteration budget is exhausted.
The default budget is 20 ReAct iterations per attempt and up to two Reflexion retries. These values can be changed with MAX_REACT_ITERATIONS and MAX_REFLEXION_ATTEMPTS.
3. Typed tool registry
backend/src/tools/registry.ts defines every action available to the model, including its name, description, JSON input schema, and destructive-action classification.
The tools fall into several groups:
- Inspection: scan the project, find instances, inspect properties, and read scripts.
- Construction: create instances, set properties, create scripts, and build from a specification.
- Editing: patch or replace scripts and delete instances.
- Animation: create tweens and KeyframeSequences, preview animations, and configure uploaded assets.
- Asset workflows: search and quarantine Creator Store assets or generate Meshy 3D assets.
- Validation: validate project structure, observe runtime state, and evaluate playtest assertions.
Most tools are forwarded to Roblox Studio. Optional Meshy operations execute directly in the backend; Meshy generates external 3D assets but does not power the agent's reasoning.
4. Queued Studio bridge
backend/src/studio/StudioBridge.ts connects the asynchronous model loop to Roblox Studio.
The backend cannot directly mutate a Studio project. Instead, it places each command in a session-specific queue. The Studio plugin polls for the next command, executes it locally, and posts a structured result back to the backend. The bridge resolves the waiting tool call when that result arrives.
A Studio session is considered connected only when it has checked in within the last five seconds. Commands fail if Studio does not answer before STUDIO_COMMAND_TIMEOUT_MS.
5. Roblox Studio plugin
studio-plugin/RobloxHackathonAgent.lua is the only component allowed to change the open Roblox project. It captures project snapshots, polls the backend, decodes typed Roblox values, runs tool handlers, and returns observations.
Mutations use Roblox Change History recordings. Successful commands are committed as undoable Studio actions, while failed commands cancel their recordings. Script replacement, exact script patches, deletion, animation publishing, and approval of quarantined assets require explicit user confirmation inside Studio.
6. Evidence-based evaluation
backend/src/agent/OutcomeEvaluator.ts decides whether an attempt actually succeeded. It does not accept the model's final prose as proof.
An attempt fails when a required tool fails. It is inconclusive when no observable action occurred, an external workflow still needs the user, or the last mutation was not followed by a successful inspection or validation tool. It passes only when the trace contains successful, verified evidence.
7. Reflexion and retry protection
When an attempt fails or is inconclusive, backend/src/agent/ReflexionEngine.ts asks the model for a structured, evidence-grounded reflection containing root causes, failed approaches, a revised strategy, and whether retrying is worthwhile.
backend/src/agent/FailedActionGuard.ts fingerprints failed tool calls. It blocks the same failed tool and identical input from being repeated until a successful action creates new evidence. This prevents the agent from getting stuck retrying the same command.
Validated reflections are stored by backend/src/memory/LessonStore.ts. A lesson is saved only when its revised attempt later succeeds, and each session retains its 20 most recent lessons.
Repository layout
backend/
├── src/
│ ├── agent/
│ │ ├── OpenAIClient.ts # Official OpenAI runtime client
│ │ ├── ReActAgent.ts # Main tool-use loop
│ │ ├── OutcomeEvaluator.ts # Evidence-based success checks
│ │ ├── ReflexionEngine.ts # Structured retry strategy
│ │ ├── FailedActionGuard.ts # Repeated-failure protection
│ │ └── prompts.ts # Agent operating contract
│ ├── assets/MeshyClient.ts # External 3D generation
│ ├── memory/LessonStore.ts # Validated session lessons
│ ├── studio/StudioBridge.ts # Backend-to-Studio command queue
│ ├── tools/registry.ts # Tool definitions and dispatch
│ ├── config.ts # Environment configuration
│ ├── readiness.ts # Startup readiness checks
│ ├── server.ts # Express API and task manager
│ └── types.ts # Shared command and result types
├── tests/ # Backend unit tests
studio-plugin/
├── RobloxHackathonAgent.lua # Studio UI and tool executor
└── sync.sh # Plugin installation helper
tools/ # Demo and Roblox build scripts
docs/ # Supporting project documentation
Quick start
Requirements
- Node.js 18 or newer
- Roblox Studio for macOS
- An OpenAI API key
Start the backend
cp .env.example .env
# Add OPENAI_API_KEY to .env and replace the default AGENT_API_KEY.
# OPENAI_MODEL defaults to gpt-5.6.
npm install
npm start
Run the readiness doctor before opening Studio:
npm run doctor
Install the Studio plugin
The plugin uses change-me as its default local API key. If you set a custom AGENT_API_KEY, set the plugin setting RobloxHackathonAgent.ApiKey to the same value.
chmod +x studio-plugin/sync.sh
./studio-plugin/sync.sh
In Roblox Studio:
- Enable Game Settings → Security → Allow HTTP Requests.
- Restart Studio after installing the plugin.
- Open a place and select Plugins → Roblox AI Agent → Agent.
- Enter a game-building request.
Example:
Build a compact neon dungeon with a collectible key, an animated door, an enemy, health UI, and a victory portal. Use server-authoritative gameplay code.
Safety model
- Only the Studio plugin can mutate the open project.
- Tools use typed inputs and structured results.
- Destructive operations require explicit, expiring approval.
- Server-authoritative Roblox patterns are required by the system prompt.
- Imported Creator Store assets are quarantined and scanned.
- Embedded scripts are removed from imported assets by default.
- Build commands are limited to 500 instances.
- Failed Studio commands cancel their Change History recording.
- Successful mutations remain undoable.
- External artifact downloads are restricted by job, host, format, and size checks.
How OpenAI powers the project
OpenAI is used in both the running application and the development workflow:
- GPT-5.6 runtime: interprets user goals, selects typed Roblox tools, consumes structured observations, writes final responses, and produces Reflexion retry strategies.
- Official OpenAI SDK: authenticates with
OPENAI_API_KEYand carries the model conversation and function calls. - ChatGPT: helped shape the product direction, hackathon scope, architecture, safety boundaries, and documentation.
- OpenAI Codex: worked directly with the repository to implement, inspect, test, debug, and document the TypeScript backend and Roblox Studio plugin.
The human developer directed the project, made product decisions, reviewed the generated work, tested it in Roblox Studio, and prepared the final submission. AI suggestions and code were treated as drafts until verified in the working experience.
Current limitations
- Ordinary Roblox Studio plugins cannot directly capture viewport pixels, so
capture_viewportcurrently returns camera evidence. - Plugins cannot reliably launch Play mode automatically. The user starts Play, and
run_playtestthen captures a bounded observation window and evaluates assertions. - Animation publishing uses Studio's authenticated native interface and waits for the user to provide the published asset ID.
- Meshy generation requires
MESHY_API_KEY. Downloaded GLB or FBX files still require Roblox Studio's native 3D Importer. - Tasks and Studio queues are kept in memory, so backend restarts discard active work.
- The lesson store is session-local and is not yet injected into new prompts.
Roadmap
- Add durable task state, a change journal, and batch rollback.
- Feed validated lessons back into later agent prompts.
- Improve Play-assisted runtime observation and screenshot capture.
- Verify animation ownership after publishing.
- Add conversion checks and a guided native 3D import workflow.
- Expand Creator Store metadata and licensing checks.
The same typed tool registry can later be exposed through MCP without changing the core agent.
Analysis
View
Metric
- 8
Figures cover GitHub contributors during the hackathon window. A co-authored commit counts in full for each author, so per-member totals add up to more than the whole-team figures.
Technology
- CSSIn code
- ExpressIn code
- HTMLIn code
- JavaScriptIn code
- OpenAIIn code
- TypeScriptIn code
6 of 6 appear in the indexed code.
AI coding agents
No AI coding agent signals were found in this repository.
Detected from committed agent config files and commit authorship. Absence of a signal is not proof an agent was unused.
Codebase size
Source size
174 KB
Source files
34
Counts recognized source files only; vendored directories, binaries and lockfiles are excluded, so this is smaller than the repository on disk.
Repository
awantony3/Roblox-Hackathon-Agent
41 files · 240 KB · @ fd86327
Structure
Interface
2 files · 5%Screens, components and styles rendered to the user.
Application logic
16 files · 39%Domain rules, services and shared utilities.
Supporting
Layers are inferred from where files sit in the tree, not from reading the code. A project that names its directories unconventionally will read oddly here — open the file browser to check anything the diagram implies.
Languages
- Markdown36%
- TypeScript25%
- Lua22%
- CSS9%
- HTML8%
- JavaScript0%
- Other (1)0%
Share of indexed source by file size. Binary and vendored files are excluded.
Dependencies
package.json
npm · 10- cors
- dotenv
- express
- openai
- zod
- +5 more
Declared in the repository’s manifests at the indexed commit. A declared package is not proof it is used, and runtime dependencies are listed first.
This project’s features have not been analysed yet.
Export this project's context (description, README, evidence, key source files) to chat with an AI agent elsewhere.