Project Info
The AI designs. Sprite2World engineers. Sprite2World is a containerized, AI-assisted level-design tool that turns a collection of pixel-art sprites and a natural-language idea into a deterministic, validated, playable 2D world. Users can import PNG files or ZIP archives, classify assets, describe the world they want, generate a semantic blueprint with OpenAI, and immediately inspect and playtest the resulting map in the browser.
Inspiration
The project started with a recurring problem in 2D game development: having a folder full of promising sprites is not the same as having a playable level. Turning those assets into a coherent world still requires categorization, layout planning, collision rules, connectivity checks, iteration, and a great deal of manual placement. Generative AI is good at interpreting creative intent, but asking a model to output thousands of exact tile coordinates is fragile and difficult to reproduce. We wanted a clearer division of responsibility: let AI understand the visual assets and propose the structure of a world, while conventional software engineering remains responsible for coordinates, rules, validation, and playability. That idea became the central principle of Sprite2World: AI expresses intent; deterministic code builds the world.
What it does
Sprite2World provides an end-to-end workflow for creating a playable top-down level: Import pre-sliced PNG sprites, multiple files, folders, or ZIP archives. Review the adaptive sprite library and assign semantic roles manually or with OpenAI vision classification. Describe the desired world in natural language. Generate a schema-constrained semantic blueprint containing regions, connections, themes, and gameplay intent. Convert that blueprint into rooms, corridors, walls, objects, collision cells, a player start, and an exit. Validate reachability, connectivity, overlaps, boundaries, collisions, and asset references. Repair bounded obstacle problems automatically and display remaining diagnostics. Playtest the result immediately with keyboard controls. Improve the world through natural-language feedback, restore earlier versions, or export the full project as JSON and a PNG preview. The editor also includes a deterministic offline demo workflow. This means the core product remains explorable even when no OpenAI API key is configured or an AI request is unavailable.
How we built it
Sprite2World is completly built with Codex (ChatGPT 5.6 Sol) C# and .NET 10 as a Blazor Web App. Docker Compose starts two services: sprite2world-web provides the browser editor, project state, OpenAI orchestration, and Canvas integration. sprite2world-worker performs bounded file processing, deterministic world generation, validation, repair, and preview rendering. Only the web service is exposed to the host. The worker stays on an internal Docker network, and both services share a named volume for JSON project files and imported assets. This keeps installation simple: users only need Docker and a browser—no local .NET SDK, Node.js installation, database, or message broker. The OpenAI Responses API is used for asset classification, blueprint creation, and feedback-driven revision. AI responses use strict Structured Outputs and are deserialized into an OpenAI-independent semantic model. The model never supplies final tile coordinates. The concrete map is produced by a seeded TopDownRooms generator. Conceptually, the result is a pure function of the validated inputs: $$ W = f(B, A, S, V) $$ where $W$ is the generated world, $B$ is the semantic blueprint, $A$ is the classified asset manifest, $S$ is the seed, and $V$ is the generator version. Keeping these inputs constant produces the same world again. An independent validator then checks the generated result using grid traversal and flood-fill logic. It verifies that the exit is reachable, required regions are connected, rooms do not overlap incorrectly, collision data is valid, and every referenced asset exists. A bounded repair step can remove blocking obstacles without silently redesigning the level. The browser renders the world through a lightweight JavaScript Canvas layer with pan, zoom, grid, minimap, camera following, and keyboard playtesting. Project data is stored as JSON, while a dependency-free PNG encoder creates diagnostic previews. Challenges we faced Creating a reliable boundary between AI and game logic The hardest design decision was deciding what the model should control. Giving AI complete control over tile placement would have made results inconsistent and difficult to validate. We instead designed a compact semantic blueprint schema and moved all spatial engineering into deterministic C# code. Making generated worlds genuinely playable A visually plausible map can still contain an unreachable exit, disconnected regions, invalid collisions, or blocked corridors. We built validation as an independent stage rather than trusting the generator. This separation made failures explainable and allowed safe, bounded repairs. Handling arbitrary user assets safely File import introduced its own security and reliability problems. The importer validates extensions, sizes, PNG signatures, dimensions, normalized paths, duplicate entries, and extraction limits. ZIP entries are checked against path traversal before anything is written. Preserving determinism while supporting iteration Creative feedback should change the design without turning the system into an unpredictable black box. We therefore version semantic blueprints and preserve seeds and generator metadata, allowing users to understand what changed and restore earlier results. Delivering a zero-setup experience The project spans browser UI, server-side AI calls, file persistence, and CPU-oriented generation. Packaging everything into two healthy Docker services—while correctly publishing Blazor's interactive browser assets—was an important final challenge. The result can now be cloned and started with a single Docker Compose command.
What we learned
We learned that AI becomes more useful when its responsibilities are deliberately constrained. Strict schemas do not reduce creativity; they create a dependable contract between creative intent and deterministic systems. We also learned that generation and validation should be separate concerns. A generator tries to produce a good result, while a validator assumes nothing and proves whether the result satisfies the rules. That distinction is especially valuable for AI-assisted workflows. Finally, we learned how important graceful degradation is. By including deterministic demo content and an offline fallback, Sprite2World remains testable even without external services. This made the product easier to demonstrate, debug, and trust. What we are proud of Sprite2World does more than create a visually interesting image. It produces a structured world with rooms, connections, collisions, a start position, an exit, validation results, version history, and exportable data. Users can immediately play what they generated and inspect the reasoning boundary between AI design and deterministic engineering.
What's next
The current release intentionally focuses on one reliable grammar: TopDownRooms. Future versions could add overworld, city, platformer, and multi-floor generators; sprite-sheet slicing and animation; richer editing tools; collaborative projects; and exporters for engines such as Godot, Unity, and Tiled. The long-term goal is to make Sprite2World a transparent bridge between creative assets, natural-language direction, and production-ready level data.
Sprite2World
The AI designs. Sprite2World engineers.
Sprite2World is a containerized AI-assisted level-design tool for importing pre-sliced PNG sprites, creating a semantic room blueprint with OpenAI, engineering it into a deterministic tile map, validating and repairing that map, and playtesting the result immediately in the browser.
How Codex & GPT-5.6 were used
This project was built end-to-end with Codex as the primary engineering collaborator and uses the GPT-5.6 model family as the creative intelligence inside the product. Under human direction, Codex supported nearly every layer of the build—from product framing and architecture to implementation, debugging, browser QA, Docker packaging and submission documentation.
Codex during development
Codex was used as an active engineering partner throughout the complete development loop:
- Product and architecture: turned the initial concept and visual references into a scoped MVP, a two-service architecture and a clear boundary between AI intent and deterministic game logic.
- Full-stack implementation: created and refined the C# domain, application, infrastructure, worker and Blazor web layers; implemented the Canvas editor, persistence, import pipeline, generator, validator, repair flow and exports.
- UI and interaction design: translated design feedback into the three-column editor, onboarding, project and sprite libraries, inspectors, dialogs, responsive behavior and accessibility improvements.
- Debugging and verification: built containers, inspected logs, tested the application in a real browser and diagnosed release-only problems such as missing Blazor static assets in the optimized Docker build.
- Quality and release work: added deterministic tests, security checks for PNG/ZIP imports, health checks, Docker Compose setup, architecture notes and clean-clone verification from the public GitHub repository.
Codex did not merely generate a code sample. It was used iteratively to inspect real results, identify failures, edit the repository, rebuild the system and verify the finished behavior.
GPT-5.6 inside Sprite2World
Sprite2World integrates GPT-5.6 through the OpenAI Responses API for three focused workflows:
| Workflow | What GPT-5.6 contributes | What deterministic code retains |
|---|---|---|
| Sprite classification | Interprets imported sprite images and assigns semantic roles using vision input | Stable asset IDs, manual overrides, validation and persistence |
| World design | Converts a natural-language request into a strict, schema-constrained semantic blueprint | Room coordinates, corridors, walls, collisions, start/exit placement and seeded generation |
| Feedback iteration | Revises the semantic blueprint from contextual user feedback | Version history, regeneration, validation, repair and export |
The model is deliberately not asked to generate thousands of raw tile coordinates. GPT-5.6 handles visual understanding, intent and semantic structure; Sprite2World turns that structure into a reproducible and testable world. This makes the AI contribution both visible and trustworthy.
The model picker exposes the GPT-5.6 family by workload:
- GPT-5.6 Luna is the efficient default for cost-sensitive experimentation.
- GPT-5.6 Terra offers a balance of capability and cost.
- GPT-5.6 Sol provides the highest-quality option for demanding world-design prompts.
- The GPT-5.6 alias routes to Sol.
Users can also choose low, medium or high reasoning effort. API responses use strict Structured Outputs and store=false, and an unavailable AI request falls back to an explicit deterministic demo blueprint so the core workflow remains testable.
This division of labor is the project's central idea:
GPT-5.6 designs the intent. Sprite2World engineers the playable result.
Learn more in OpenAI's GPT-5.6 model guide.
MVP capabilities
- polished Blazor Web App editor with a three-column, desktop-first dark UI
- ZIP, multi-PNG and browser-supported folder import with PNG validation, stable content IDs and ZIP-slip protection
- adaptive asset library with search, role filter, exclusion, folder hints, manual overrides and OpenAI vision classification
- OpenAI Responses API with strict Structured Outputs for classification, blueprint creation and feedback revision
- deterministic
TopDownRoomsgenerator with rooms, orthogonal corridors, loops, walls, collisions, objects, start and exit - independent pathfinding/validation and bounded obstacle repair
- Canvas rendering, pan/zoom/grid, minimap and keyboard playtest (WASD or arrow keys)
- version history and contextual feedback iteration
- complete project JSON and PNG preview export
- JSON-file persistence in a named Docker volume; no database
- a licensed seven-sprite starter pack plus procedural demo tiles for a sub-three-minute walkthrough
The first release intentionally supports one reliable grammar, TopDownRooms. Overworld, city, platformer, auto-tiling, animation and engine-specific exports are extension points, not claimed features.
Screenshots
The application opens directly into the deterministic demo workspace. Add current screenshots from http://localhost:3000 here when preparing the hackathon submission.
Quick start with Docker
The only prerequisite is a running Docker Desktop installation or Docker Engine with Docker Compose. .NET, Node.js, a database and an OpenAI key are not required to start the application.
git clone https://github.com/RichardsWelt/sprite2world.git
cd sprite2world
docker compose up -d --build --wait
Open http://localhost:3000. On the first visit, onboarding asks for language and an optional personal OpenAI API key. The editor also starts without AI.
The first build downloads the .NET container images and can take a few minutes. Later builds reuse Docker's dependency cache and are considerably faster.
If port 3000 is already in use, choose another one without editing a file:
SPRITE2WORLD_PORT=3100 docker compose up -d --build --wait
Then open http://localhost:3100.
Stop without deleting project data:
docker compose down
Deliberately delete all saved projects:
docker compose down -v
OpenAI configuration
For the shortest and safest setup, enter a personal API key in the first-start onboarding. The key is validated directly with OpenAI and is never committed to the repository, persisted in projects, exported or logged.
Server administrators can alternatively copy .env.example to .env.local and set OPENAI_API_KEY before starting Docker. Both .env and .env.local are ignored by Git.
Configuration variables:
OPENAI_API_KEY— project API keyOPENAI_DEFAULT_MODEL— defaults to the cost-sensitivegpt-5.6-luna; common compatible OpenAI models are selectable from grouped dropdowns in Settings and the InspectorOPENAI_REASONING_EFFORT—low,mediumorhigh
If an API request fails, the error is presented in user-safe form and the generator uses an explicit deterministic demo blueprint so the workflow remains testable offline.
Three-minute demo
- Open the app; the licensed seven-sprite starter pack, procedural demo tiles and three example worlds are preloaded.
- Import a PNG/ZIP pack or inspect the categorized demo assets.
- Choose AI classify to classify non-overridden assets with image input.
- Edit the world description and choose Generate world.
- Inspect Semantic Blueprint and Validation.
- Open Playtest, choose Start, focus the canvas, and move with WASD/arrows to the red exit.
- Enter feedback such as “Needs another loop” and choose Improve.
- Restore a version from the right panel or export JSON/PNG from the action rail.
Manual classifications always win over later AI classification. Pixel-art previews use nearest-neighbor browser rendering.
Import limits and security
- PNG and ZIP only; sprite sheets are not sliced
- 250 assets by default
- 10 MB per upload/extracted file and 100 MB total
- normalized relative paths, duplicate rejection, path traversal protection and PNG signature/IHDR validation
- uploads are never executed
This is a local developer tool without authentication. Do not expose it directly to the public internet without authentication, HTTPS, request throttling and a deployment-specific security review.
Tests
With a local .NET 10 SDK:
dotnet test Sprite2World.sln
With Docker only:
docker run --rm -v "$PWD:/src" -w /src mcr.microsoft.com/dotnet/sdk:10.0 dotnet test Sprite2World.sln
Tests cover blueprint serialization, seeded determinism, non-overlap, connectivity/reachability, start/exit, collisions, missing roles, validation, repair, ZIP traversal, PNG encoding and export completeness.
Troubleshooting
localhost:3000is unavailable: rundocker compose psanddocker compose logs.- Worker remains unhealthy: rebuild with
docker compose build --no-cacheand check the worker log. - Asset write errors: ensure the named volume is writable, then recreate containers without
-v. - OpenAI authentication/model errors: verify the key/project access and select an available model in Settings.
- Do not paste the output of
docker compose configinto issues: Compose expands values fromenv_file, including secrets. - Reset only the current browser project with Settings; remove every persisted project only with
docker compose down -v.
Hackathon
The demo highlights a transparent boundary: GPT returns compact semantic intent using a strict schema; all coordinates, collision rules, repairs, pathfinding, rendering and playability are owned by deterministic C# code.
See ARCHITECTURE.md for design decisions and THIRD_PARTY_NOTICES.md for dependency licenses.
Analysis
View
Metric
- 1
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
- C#In code
- CSSIn code
- JavaScriptIn code
- HTMLClaimed
3 of 4 appear in the indexed code. 1 claimed on Devpost could not be matched to code, which may simply mean the tool leaves no trace in the repository.
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
382 KB
Source files
39
Counts recognized source files only; vendored directories, binaries and lockfiles are excluded, so this is smaller than the repository on disk.
Repository
RichardsWelt/sprite2world
69 files · 1.3 MB · @ af2c58f
Structure
Interface
6 files · 9%Screens, components and styles rendered to the user.
Application logic
46 files · 67%Domain rules, services and shared utilities.
+1 more
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
- C#51%
- CSS24%
- JavaScript21%
- Markdown5%
- YAML0%
Share of indexed source by file size. Binary and vendored files are excluded.
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.