Empowering the next billion game creators.
ForgeAI is an end-to-end game development platform that uses AI to eliminate the technical barriers of game creation. Describe a game world, and watch AI generate everything you need - from tilemaps to characters to physics - then export a playable game.
From Idea to Playable Game in Minutes
You Describe → AI Generates → You Customize → Export & Play
Who Needs This:
- Indie Developers - Prototype games in hours, not weeks
- Game Design Students - Focus on mechanics without needing art skills
- Rapid Prototyping - Test 10 art styles without hiring artists
- Content Creators - Build custom games for your audience
- Text-to-Tilemap: Describe a scene ("medieval castle with dark forest") and AI generates a 1024x1024 pixel tilemap
- Image-to-Tilemap: Upload reference art and AI converts it to game-ready format
- Auto Object Detection: AI identifies all game objects with precise 32-pixel grid coordinates
- Multi-Model AI: Azure OpenAI for understanding + Google Gemini for generation
- Smart Object Grid: All objects placed on 32-pixel grid for perfect collision
- Add/Remove/Edit: Describe new objects ("add a dragon"), remove unwanted ones
- Sprite Customization: Edit or generate custom sprites for any object
- Undo/Redo System: Full modification history with state management
- Conversational Editing: "Make forest denser" or "Add mountains in background"
- Stateful Context: AI remembers your entire game world across modifications
- Iterative Workflow: Keep refining until it's perfect
- Non-Destructive: Original tilemap preserved for reference
- AI Sprite Generation: Generate animated character spritesheets from text
- Advanced Sprite Editor: Cut frames, extract sprites, build animations
- Timeline System: Visual animation designer with frame preview
- Asset Library: Save and reuse custom sprites across projects
- Default Characters: Pre-built Pokemon-style character with walk animations
- Rigidbody System: Configure static/dynamic/kinematic physics per object
- Collision Detection: Kaplay-powered collision with customizable layers
- Custom Behaviors: Add scripted behaviors (blast on collision, teleport, etc.)
- Keyboard Controls: Map WASD/Arrow keys with custom move speeds
- Real-Time Preview: Test your game instantly with Kaplay engine
- Playable Game: Fully functional 2.5D platformer in-browser
- Character Animations: Walk cycles, idle poses, directional movement
- Physics Simulation: Gravity, collision, movement - all working
- Export Ready: Download Kaplay-compatible project files
- Vanilla JavaScript - Modular ES6 architecture
- Kaplay.js - 2D game engine for rendering and physics
- HTML5 Canvas - Client-side image processing
- Vite - Lightning-fast build tool and dev server
- Node.js/Express - RESTful API architecture
- Multer - File upload handling
- Axios - HTTP client for AI model communication
- Azure OpenAI (GPT-4o-mini) - Object detection, scene understanding
- Google Gemini (Vertex AI) - Image generation, sprite creation
- Custom Coordinate Mapping - Translates AI probabilistic output to deterministic game positions
ForgeAI/
├── client/
│ ├── src/
│ │ ├── modules/ # Modular JavaScript components
│ │ │ ├── api-client.js # API communication
│ │ │ ├── phase-4-manager.js # Character customization
│ │ │ ├── phase-4-5-manager.js # Physics configuration
│ │ │ ├── game-preview.js # Live game rendering
│ │ │ ├── default-character.js # Pre-built sprite system
│ │ │ └── ...
│ │ └── styles/
│ │ └── styles.css # Dark theme UI
│ ├── public/
│ │ └── assets/ # Default character sprites
│ ├── index.html
│ └── package.json
│
├── server/
│ ├── modules/
│ │ ├── gemini-client.js # Google Gemini integration
│ │ ├── azure-client.js # Azure OpenAI integration
│ │ └── coordinate-mapping.js # Grid alignment system
│ ├── routes/
│ │ ├── tilemap.js # Tilemap generation endpoints
│ │ ├── sprite.js # Character sprite endpoints
│ │ ├── physics.js # Physics rule endpoints
│ │ └── ...
│ ├── index.js # Express server entry
│ └── package.json
│
├── vercel.json # Vercel deployment config
└── README.md
- Node.js 18+
- Azure OpenAI API key
- Google Cloud Vertex AI credentials
# Clone the repository
git clone https://github.com/Rushant-123/Forge-AI.git
cd Forge-AI
# Install dependencies
npm install
# Setup client
cd client
npm install
cd ..
# Setup server
cd server
npm install
cd ..-
Azure OpenAI Setup
- Create file:
server/.env - Add your Azure credentials:
AZURE_OPENAI_API_KEY=your-key-here AZURE_OPENAI_ENDPOINT=your-endpoint-here AZURE_OPENAI_DEPLOYMENT_NAME=your-deployment-name
- Create file:
-
Google Vertex AI Setup
- Place service account JSON in:
creds/vertex-nano-banana.json - Ensure file has required fields:
project_id,private_key,client_email
- Place service account JSON in:
-
Verify Setup
node server/check-env.js
# Terminal 1: Start backend (port 3001)
cd server
npm run dev
# Terminal 2: Start frontend (port 3000)
cd client
npm run devOpen http://localhost:3000 in your browser.
Step 1: Generate World
Input: "medieval castle with dark forest and river"
AI Output: 1024x1024 tilemap + 47 detected objects with grid coordinates
Step 2: Manage Objects
- Review detected trees, buildings, terrain
- Add: "dragon enemy sprite"
- Remove unwanted objects
- Edit existing sprites
Step 3: Refine with AI
Prompt: "Make the forest denser, add mountains in background"
AI updates tilemap while preserving object relationships
Step 4: Create Character
Input: "warrior character with sword and shield"
AI Output: 4-direction spritesheet with walk animations (4 frames each)
Step 5: Configure Physics
- Trees: Static rigidbody, collides with player
- Dragon: Dynamic rigidbody, custom blast behavior
- River: No collision (aesthetic only)
- Player: WASD controls, 150 move speed
Step 6: Play!
Export → Deploy to web → Share with friends
Problem: AI is probabilistic (gives different results each time), but games need deterministic positioning (collision breaks if objects are off by 1 pixel).
Our Solution: Custom Coordinate Mapping
// AI says: "tree at (527, 391)" (pixel coordinates)
// We translate to: grid cell (16, 12)
// Which becomes: game coordinate (512, 384) (grid-aligned)
const gridX = Math.floor(pixelX / GRID_SIZE) * GRID_SIZE;
const gridY = Math.floor(pixelY / GRID_SIZE) * GRID_SIZE;This ensures:
- Objects snap to 32-pixel grid
- Collision detection works perfectly
- Physics simulation is stable
- Consistent positioning across AI calls
Theme: Human + AI: Co-Creation for the Future
Tagline: Empowering the next billion game creators.
Biggest Challenge Solved: Making AI deterministic for game development through custom grid-snapping coordinate translation and stateful multi-model context management.
# Install Vercel CLI
npm i -g vercel
# Deploy
vercel deploy --prodThe vercel.json configuration is already set up for both client and server deployment.
Add these to your Vercel project settings:
AZURE_OPENAI_API_KEY=your-key
AZURE_OPENAI_ENDPOINT=your-endpoint
AZURE_OPENAI_DEPLOYMENT_NAME=your-deployment
Upload your Vertex AI credentials JSON as a Vercel secret.
Detailed technical documentation is available in the docs/ folder:
- Quick Start Guide - Fast setup for experienced developers
- Azure Setup Guide - Complete Azure OpenAI configuration
- Modular Architecture - Code organization and module design
- Interaction System - Object interaction and collision mechanics
- AI Animation System - Character animation generation workflow
- Animation Control System - Animation state management
- Phase 2B Implementation - Object management system
- Phase 4.5 Fixes - Physics configuration improvements
- Phase 4.5 to Phase 6 Integration - Physics data flow
- Sprite Editor Implementation - Advanced sprite editing tools
- Sprite Asset System - Asset library and management
- Sprite Optimization - Performance improvements
- Simple Animation System - Basic animation framework
- AI Animation Flow Verification - Testing guidelines
- Agents - AI agent configurations and workflows
This project is licensed under the MIT License - see the LICENSE file for details.
- Kaplay.js - 2D game engine
- Azure OpenAI - Language understanding and object detection
- Google Gemini - Image generation capabilities
- Vite - Build tool and development server
- GitHub Issues: Report bugs or request features
- Project Repository: https://github.com/Rushant-123/Forge-AI
Built for the AI + Gaming community