GameX Engine is a comprehensive AI-driven game development platform designed to streamline the creation of game narratives, assets, and world-building elements. It leverages advanced LLMs and agentic workflows to generate everything from initial game concepts to detailed questlines and 3D visual assets.
Powered by LangGraph, the SagaAgent creates deep, interconnected game worlds through a multi-stage, human-in-the-loop workflow:
- Concept: Generates core game ideas, genres, and USPs.
- World Lore: Builds history, geography, and magic/tech systems.
- Factions: Creates political groups, ideologies, and reputation dynamics.
- Characters: Generates protagonists and NPCs tied to factions/lore.
- Plot Arcs: Designs branching main stories with multiple endings.
- Questlines: Develops specific missions and objectives.
- RenderPrep: Prepares visual prompts for asset generation.
- Visual Assets: Integrated pipelines for generating character concepts and environment art.
- 3D Models: Capabilities to generate 3D assets (GLB) from textual descriptions or images.
- Research Agent: Performs deep web research to ground game concepts in reality or existing fiction styles.
- Supervisor Agent: Manages state and routes tasks between specialized agents.
- Memory Persistence: Checkpoint system to save/resume generation sessions and allow iterative feedback.
The project is divided into two main components:
- Frontend (
/web): A modern Next.js 16 application (React 19) providing an interactive dashboard for managing workflows, viewing generated content, and visualizing assets. - Backend (
/backend): A FastAPI server that hosts the AI agents, manages sessions, and handles specific generation tasks using Python, LangChain, and LangGraph.
- Node.js (v18 or higher)
- Python (v3.10 or higher)
- uv (Python package manager, recommended) or pip
- API Keys:
- Run
backend/README.mdfor specific key requirements (OpenAI/Nebius, Google Gemini, HuggingFace).
- Run
-
Navigate to the backend directory:
cd backend -
Create a Virtual Environment (using
uvis recommended):pip install uv uv venv
-
Activate the environment:
- Windows:
.venv\Scripts\activate - Mac/Linux:
source .venv/bin/activate
- Windows:
-
Install Dependencies:
uv pip install -r requirements.txt
-
Configure Environment Variables: Create a
.envfile in thebackendor root directory with the following keys:# AI Providers GOOGLE_API_KEY=your_gemini_key NEBIUS_API_KEY=your_nebius_key OPENAI_API_KEY=your_openai_key # Optional if using Nebius for OpenAI-compatible endpoint HUGGINGFACE_API_KEY=your_hf_key # Configuration MODEL=openai/gpt-oss-120b # or other preferred model
-
Run the Server:
# Run from root or backend directory ensuring paths are correct python backend/main.pyThe API will be available at
http://localhost:8000.
-
Navigate to the web directory:
cd web -
Install Dependencies:
npm install # or yarn install -
Run the Development Server:
npm run dev
The web interface will be available at
http://localhost:3000.
The Backend exposes several key endpoints for the Saga workflow:
POST /api/workflow/start: Initialize a new game generation session.- Accepts
topic,research_required, etc.
- Accepts
POST /api/workflow/feedback: Provide user feedback on the current stage (e.g., critique the generated Factions).POST /api/workflow/continue: Proceed to the next stage after approval.GET /api/workflow/state/{session_id}: Retrieve current generation state and data.POST /api/generate: Standalone endpoint for asset generation (images/3D).
ProjectX/
├── backend/
│ ├── SagaAgent/ # Core logic for narrative generation (LangGraph)
│ ├── Research/ # Web research agent modules
│ ├── models/ # Pydantic data models
│ ├── nodes/ # Processing nodes for image/3D generation
│ ├── main.py # FastAPI entry point
│ └── requirements.txt # Python dependencies
├── web/
│ ├── src/
│ │ ├── app/ # Next.js App Router pages
│ │ └── components/ # React UI components
│ ├── package.json # JS dependencies
│ └── next.config.ts # Next.js config
├── generated_images/ # Output directory for visual assets
└── README.md # Project documentation
Project X - Internal Use Only