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
Agent
is the NPC exploring the world, currently a pixelated 2D plot of landImpassable
tiles: cannot be passedPlantable
(passable) tiles: aPlant
layer withPlantable
tiles and plants but not currently in use byAgent
- Commands for
Plantable
tiles:- Press
S
toplant
1u food - Press
D
toharvest
1u food
- Press
Agent
Details
gpt-3.5-turbo
viaOpenAI API
- List of
Actions
it can perform (up, down, L, R) - Copilot style: AI
Agent
by default, but user interjections take precedent - Ability to evaluate
Surroundings
- Actions fluctuate based on
Sleepiness
values (which it self-assigns)
File Structure
Agent
contains allAgent
-related codeui-admin
contains all environemnt-related code- Used
OpenAI API
for (1) decision-making, (2) interacting with frontend (viawss
) Tiled
is the map editor. Seeui-admin/src/assets
Phaser
andGrid Engine Plugin
used 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.json
file with yourOPENAI_API_KEY
- I've only tested with `Node.js 16.19.0``
- From the
gptrpg
folder, runnpm install
to install dependencies for everything - Run
npm start
in 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