Skip to main content

BotPlot

An NPC bot roaming a plot ⛰️🤖

Github

Table of Contents

    📝 About
    💻 How to Build
    🔧 Tools Used
      🚀 Next Steps
      👥 Contributions
      👤 Contact

    📝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 land
    • Impassable tiles: cannot be passed
    • Plantable (passable) tiles: a Plant layer with Plantable tiles and plants but not currently in use by Agent
    • Commands for Plantable tiles:
      • Press S to plant 1u food
      • Press D to harvest 1u food

    Agent Details

    • gpt-3.5-turbo via OpenAI 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 all Agent-related code
    • ui-admin contains all environemnt-related code
    • Used OpenAI API for (1) decision-making, (2) interacting with frontend (via wss)
    • Tiled is the map editor. See ui-admin/src/assets
    • Phaser and Grid 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:

    1. Update the agent/env.json file with your OPENAI_API_KEY
    2. I've only tested with `Node.js 16.19.0``
    3. From the gptrpg folder, run npm install to install dependencies for everything
    4. Run npm start in the main folder. This will start up the agent and front-end. The front-end will be at http://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

    • Phaser
    • GridEngine
    • Tiled

    Web Framework

    • WebSocket
    • OpenAI
    • React

    👤Contact

    Email Twitter