Overview
GPTRPG is a proof-of-concept project that demonstrates an OpenAI GPT-powered agent operating within a 2D RPG-like environment. The system combines a React-based frontend with Phaser game engine and Grid Engine plugin to create a tile-based world where an AI agent can move around, interact with the environment, and make autonomous decisions. The agent communicates with the game world through websockets and uses the OpenAI API (specifically gpt-3.5-turbo) to process its surroundings and decide on actions based on its internal state, such as sleepiness levels. The environment features impassable terrain, plantable tiles, and basic farming mechanics that players can control manually. Built with established tools like Tiled map editor for world creation, this project serves as an educational example of how large language models can be integrated into game-like environments to create autonomous virtual beings. While currently limited in scope, it provides a foundation for exploring AI agent behavior in structured, interactive worlds and demonstrates the potential for more complex agent-driven gameplay systems.
Pros
- + Complete working demonstration of LLM integration in a game environment with visual interface
- + Uses well-established tools (React, Phaser, Tiled) making it accessible to developers familiar with these technologies
- + Open-source proof-of-concept that provides a concrete starting point for AI agent experimentation in gaming contexts
Cons
- - Limited to local deployment only, requiring manual setup and OpenAI API key configuration
- - Proof-of-concept stage with minimal agent capabilities (only sleepiness tracking and basic movement)
- - Currently supports only single agent scenarios with no multi-agent or advanced interaction features
Use Cases
- • Educational projects for learning how to integrate LLM APIs with interactive game environments
- • Prototyping autonomous AI characters for game development or simulation research
- • Demonstrating AI decision-making in constrained environments for academic or commercial presentations