Skip to content

Play retro console games directly in SillyTavern chats using EmulatorJS

License

Notifications You must be signed in to change notification settings

SillyTavern/SillyTavern-EmulatorJS

 
 

Repository files navigation

SillyTavern-EmulatorJS

This extension allows you to play retro console games right from the SillyTavern chat.

Features

Cool stuff:

  • Unnecessary and absurd concept.
  • AI can provide immersive comments on your gameplay (OpenAI API key required).
  • Simple ROM file management. ROMs are stored in your browser.
  • All EmulatorJS cores supported.
    • Nintendo
    • Sega
    • Atari
    • PlayStation
    • many more

Limitations:

  • AI can't play the game with you as a second player (yet).
  • No built-in ROMs. But you can find them anywhere.

NEW! AI Streaming mode

With the power of GPT-4 Vision, your AI bots can now see your gameplay and provide witty in-character comments.

Requirements

  1. Latest staging version of SillyTavern.
  2. Latest update of EmulatorJS extension.
  3. A browser that supports ImageCapture. Tested on desktop Chrome. Firefox requires to enable it with config. Safari won't work.
  4. (If image inlining is disabled) OpenAI API key with access to the "gpt-4-vision" model.
  5. (If image inlining is enabled. Recommended) OpenAI or OpenRouter API key with "gpt-4-vision" as the selected model.

How to enable

  1. Make sure you set the interval of providing comments in the EmulatorJS extension settings. This setting defines how often the character is queried for comments using a snap of your current gameplay. A value of 0 indicates that no comments are provided.
  2. Select a character chat and launch the game. For the best performance, make sure that the ROM file is properly named so that AI can have more background context.
  3. Start playing as you normally would. The vision model will be queried periodically to write a comment based on the latest screenshot it "sees".

Why I'm not seeing any comments?

Comments are temporarily paused (interval step skipped) if:

  1. Emulator is paused (with a pause button, not in-game).
  2. The browser window is out of focus.
  3. The user input area is not empty. This is to let you type your reply in peace.
  4. Another reply generation is currently in progress.
  5. TTS voice is being read aloud. Comment is held off (10 seconds maximum) until it finishes, but not skipped.

Other common issues:

  1. Make sure you've set a commenting interval before launching the game.
  2. Make sure you have set an OpenAI key and there are no errors in the ST server console.

Still doesn't work? Send us your browser debug console logs (press F12).

Settings

  1. Caption template - a prompt used to describe the in-game screenshot. {{game}} and {{core}} additional macro are supported.
  2. Comment template - a prompt used to write a comment based on the generated caption. {{game}}, {{core}}, {{caption}} additional macro are supported. For image inlining mode, {{caption}} is replaced with see included image.

Installation and Usage

Installation

Install using SillyTavern's third-party extensions installer using this link:

https://github.com/Cohee1207/SillyTavern-EmulatorJS

Usage

  • Open the "EmulatorJS" extension menu.
  • Click "Add ROM file".
  • Select the game file to add. Input the name and core (if it wasn't auto-detected).
  • Click the "Play" button in the list or launch via the wand menu.

Prerequisites

  • Latest release version of SillyTavern.
  • ROM files downloaded from the net.

Support and Contributions

Feel free to contribute.

License

GPLv3




Badge License

Self-hosted Javascript emulation for various system.


Button WebsiteButton Usage
Button Configurator
Button DemoButton Legacy

Button Contributors

Join our Discord server:

Join our Discord server!


As of EmulatorJS version 4.0, this project is no longer a reverse-engineered version of the emulatorjs.com project. It is now a complete re-write,


README BEFORE YOU UPDATE: EmulatorJS Version 4.0 is a complete re-write of the application. At least some bugs are expected. If you did any communicating with the emulator, there is a 100% chance you will need to re-write your project, and to people with active branches of this project, I wish you luck with merge conflicts (I'm very sorry). The emulator object can be accessed through the window.EJS_emulator object.

It is HIGHLY suggested that you update to 4.0 ASAP.


Ads

This project has no ads.
Although, the demo page currently has an ad to help fund this project.
Ads on the demo page may come and go depending on how many people are
funding this project.

You can help fund this project on patreon


Issues

If something doesn't work, please consider opening an Issue
with as many details as possible, as well as the console log.


Extensions

GameLibrary

   A library overview for your ROM folder.


Development:

Run a local server with:

npm i
npm start

>> When reporting bugs, please specify that you are using the old version




Supported Systems


Nintendo

Game Boy Advance   |  Famicom / NES   |  Virtual Boy

Game Boy   |  SNES   |  DS   |  64



Sega

Master System   |  Mega Drive   |  Game Gear

Saturn   |  32X   |  CD



Atari

2600   |  5200   |  7800   |  Lynx   |  Jaguar



Other

PlayStation   |  Arcade   |  3DO   |  MAME 2003


PSP is not yet supported. Some of y'all may have seen that I pushed a "beta" ppsspp core, but this core is not ready for daily use. It still crashes randomly and any games that use 3d (so like, all of them) will just have a white screen (and might just crash). Do not open issues related to the "psp" core.

About

Play retro console games directly in SillyTavern chats using EmulatorJS

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Languages

  • JavaScript 84.7%
  • CSS 8.1%
  • HTML 7.2%