Git Product home page Git Product logo

gptrpg's Introduction

GPTRPG

map of the game

This repo contains two things:

  • A simple RPG-like environment for an LLM-enabled AI Agent to exist in
  • A simple AI Agent connected to the OpenAI API to exist in that environment

It is intended as a proof of concept.

Running

GPTRPG is intended to be run locally. To run:

  1. Make sure you have updated the agent/env.json file with your OpenAI API key.
  2. Only tested with node 16.19.0
  3. In the gptrpg directory run npm install to install dependencies for all projects.
  4. Then run npm start in the root directory. This will start the agent and the front-end. The front-end will be available at http://localhost:3000.

The Environment

Code for the environment lives in the ui-admin directory. It is a React project.

The environment was made with Tiled map editor. The files live in ui-admin/src/assets.

The environment is rendered with Phaser and the Grid Engine Plugin

The environment consists of:

  • The character (agent)
  • Impassable tiles
  • A plant layer with "plantable" tiles, and plants (not currently in use by agent). Player can plant food on plantable tiles with S key and harvest food with D key.

The Agent

Code for the agent lives in the agent directory.

The agent is a simple AI agent that uses the OpenAI API to make decisions. It communicates with the front-end via a websocket.

The agent is provided with a list of possible actions, the state of its surroundings, and its internal state (currently only sleepiness is measured).

Upcoming features

  • Multi agent support
  • More agent actions (drink, eat, plant food, harvest food, write poetry, etc.)
  • More agent states (hunger, thirst, etc.)
  • Agent memory
  • Agent goals
  • Agent inventory
  • Deployment to web
  • Human controlled character
  • UI enhancements (agent state, human interactions, etc.)

Notes

Currently, GPTRPG runs with the gpt-3.5-turbo API.

gptrpg's People

Contributors

dzoba avatar eltociear avatar gatlee21 avatar klyap avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.