Skip to content

lucas-vitrus/ai-plays-emulators

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI plays Emulators

(For now only Nintendo 64)

This is a ready-to-use AI environment that runs on your browser. Simply connect with 50790014-e0a0-4dd0-a838-9c9cfd8bb2f9

Running it from Web

https://ai-plays-emulators.vercel.app and set your Vitrus API key and your world ID

Creating a player

bun add vitrus 

Running it locally

image
  • emulator-environment/: Contains the React frontend application using EmulatorJS.
  • ai-player/: Contains an example of an AI agent.

Getting Started in 3 steps

  1. Install dependencies for the entire monorepo:

    cd ./emulator-environment
    bun install
  2. Setup Environment Variables To help developers focus only in the AI player development, we abstracted the ai-to-emulator communication using Vitrus Agent-World-Actor (AwA) infrastructure.

    🔑 You can get your API Keys here.

    cd ./emulator-environment
    touch .env

    And inside of the .env file define your credentials and API

    VITE_VITRUS_API_KEY = vitrus-<api-key>
    VITE_VITRUS_WORLD = <world-id>
    ROM_URL = https://path/your_file_here.n64 #Your game of preference

    Alternativelly you may fork this repo and use a custom AwA layer like Redis, PeerJs, etc. But we've made Vitrus SDK to simplify this.

  3. Running the Frontend (Vite Development Server): Navigate to the emulator-environment directory and run:

    cd ./emulator-environment
    bun run dev

    This will typically start the frontend on http://localhost:5173. You can defined the port by adding --port 3000.

  4. (optional) Running the example Player (typescript)

    cd ./ai-player
    bun install
    touch .env

    Add the same API Keys on .env but without the VITE_ prefix.

    VITRUS_API_KEY = vitrus-<api-key>
    VITRUS_WORLD = <world-id> #Make sure it's the same world as the emulator

    With the browser running, run the player

    bun dev

    It should play now!! 🎉

Gamepad Buttons map

image

About

A bit more complicated

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published