Table of Contents
📝About
A virtual environment roleplaying game where a user-created NPC (non-playable character) roams about to achieve a given objective:
- Similar to traditional video games-- but way more AI-heavy. User is in "copilot" mode.
LLMs have the power to behave as NPCs whch taken on states, personalities, character-like qualities, and most importantly-- develop heuristics to pursue (modeled by one or many heuristic functions often). I use gpt-3-turbo to explore these capabilties.
This is an open-source project I am building and adding to over time. Feedback and contributions are welcome, see Contributions .
Game Mechanics
Agentis the NPC exploring the world, currently a pixelated 2D plot of landImpassabletiles: cannot be passedPlantable(passable) tiles: aPlantlayer withPlantabletiles and plants but not currently in use byAgent- Commands for
Plantabletiles:- Press
Stoplant1u food - Press
Dtoharvest1u food
- Press
Agent Details
gpt-3.5-turboviaOpenAI API- List of
Actionsit can perform (up, down, L, R) - Copilot style: AI
Agentby default, but user interjections take precedent - Ability to evaluate
Surroundings - Actions fluctuate based on
Sleepinessvalues (which it self-assigns)
File Structure
Agentcontains allAgent-related codeui-admincontains all environemnt-related code- Used
OpenAI APIfor (1) decision-making, (2) interacting with frontend (viawss) Tiledis the map editor. Seeui-admin/src/assetsPhaserandGrid Engine Pluginused for rendering environment
💻How to Build
Meant as a proof of concept and is a work in progress. Errors may occur.
Designed to run locally. Follow steps here to run:
- Update the
agent/env.jsonfile with yourOPENAI_API_KEY - I've only tested with `Node.js 16.19.0``
- From the
gptrpgfolder, runnpm installto install dependencies for everything - Run
npm startin the main folder. This will start up the agent and front-end. The front-end will be athttp://localhost:3000
🚀Next Steps
- Heuristic goal-setting
- More agent actions (eat, harvest some shit, sing, vibe, etc.)
- More states of being (emotions)
- Web UI
👥Contributions
Contributions are welcome. Creativity is welcome. Please make a pull request at the project repo.
🔧Tools Used
Game interface
Web Framework