Skip to content

SillyTavern/SillyTavern-EmulatorJS

SillyTavern-EmulatorJS

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

See the original README below. Thanks libretro and EmulatorJS projects for making this possible.

Current EmulatorJS version: 4.2.2

Features

Cool stuff:

  • Unnecessary and absurd concept.
  • AI can provide immersive comments on your gameplay (compatible model 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.

Installation and Usage

Prerequisites

  • Latest release version of SillyTavern.
  • ROM and/or BIOS files downloaded from the net.

Installation

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

https://github.com/SillyTavern/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).
  • Some cores (e.g. PlayStation) require you to provide a BIOS file. See the documentation to find out what are the necessary files.
  • Click the "Play" button in the list or launch via the wand menu.

AI Commentary mode

With the power of multimodal models, your AI bots can see your gameplay and provide witty in-character comments.

Requirements

  1. Latest 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 enabled. Recommended) Chat Completion API key with a supported model.
  5. (If image inlining is disabled) Multimodal captioning extension enabled and configured.

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 screenshot 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 option, 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 (30 seconds maximum) until it finishes, but not skipped.
  6. A character card or group is currently open. Comment mode is disabled when starting the game from a welcome screen.

Other common issues:

  1. Make sure you've set a commenting interval before launching the game.
  2. Make sure you have set an API 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.

Support and Contributions

Feel free to contribute.

License

GPLv3




Badge License

Self-hosted Javascript emulation for various systems.


Button Website Button Usage
Button Configurator
Button Demo
Button Contributors

Join our Discord server:

Join our Discord server!

Or the Matrix server (#emulatorjs:matrix.emulatorjs.org):

Chat on Matrix


Note

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 rewrite.

Warning

As of version 4.0.9 cores and minified files are no longer included in the repository. You will need to get them separately. You can get it from releases or the * new CDN (see this for more info). There is also a new version system that we will be using. (read here for more info).

Tip

Cloning the repository is no longer recommended for production use. You should use releases or the CDN instead.


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.


3rd Party Projects

EmulatorJS itself is built to be a plugin, rather than an entire website. This is why there is no docker container of this project. However, there are several projects you can use that use EmulatorJS!

Looking for projects that integrate EmulatorJS? Check out https://emulatorjs.org/docs/3rd-party


Versioning

There are three different version names that you need to be aware of:

  1. stable - This will be the most stable version of the emulator both code and cores will be tested before release. It will be updated every time a new version is released on GitHub. This is the default version on the Demo.
  2. latest - This will contain the latest code but use the stable cores. This will be updated every time the main branch is updated.
  3. nightly - This will contain the latest code and the latest cores. The cores will be updated every day, so this is considered alpha.

CDN

EmulatorJS provides a CDN at https://cdn.emulatorjs.org/, allowing access to any version of the emulator.

To use it, set EJS_pathtodata to https://cdn.emulatorjs.org/<version>/data/, replacing <version> with stable, latest, nightly, or another main release.

Be sure to also update the loader.js path to: https://cdn.emulatorjs.org/<version>/data/loader.js


Development:

Run a local server with:

  1. Open a terminal in the root of the project.

  2. Install the dependencies with:

    npm i
  3. Start the minification with:

    node start
  4. Open your browser and go to http://localhost:8080/ to see the demo page.



Minifying

Before pushing the script files onto your production server it is recommended to minify them to save on load times as well as bandwidth.

Read the minifying documentation for more info.


Localization

If you want to help with localization, please check out the localization documentation.


>> When reporting bugs, please specify what version you are using




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



Commodore

Commodore 64 | Commodore 128 | Commodore Amiga

Commodore PET | Commodore Plus/4 | Commodore VIC-20



Other

PlayStation   |  PlayStation Portable   |  Arcade    

3DO | MAME 2003 | ColecoVision


Star History

Star History Chart

About

Play retro console games directly in SillyTavern chats using EmulatorJS

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Contributors 17