Your game is a folder of plain files, and that’s all a player’s browser needs. To put it online, you copy the folder, take out what’s meant only for you, and upload the files to a web host: a service that keeps files on the internet and gives them an address. There’s nothing to install, no program to run on the host, and no step that converts your game first.

Online, your game is served, so everything in the right column of the table works there, audio effects and save pictures included.

Before you share it

Decide on four things, in your game folder:

  • The credits. The pictures in your game are Queen BeeBee’s, and their terms ask you to credit her everywhere you share the game, and to keep it free. Add this to the end of js/script.js: the main menu gets a Credits button that lists her, with a link to her page.

    monogatari.configuration('credits', {
      'Art': {
        'Backgrounds, Yui and Mio': '<a href="https://queenbeebee.carrd.co/" target="_blank">Queen BeeBee</a>',
      },
    });

    Write the same credit in the description of the page where you share the game: “Yui, Mio and the backgrounds by Queen BeeBee (https://queenbeebee.carrd.co/)”. Credits Screen shows how to add your own names.

  • The game’s name, in js/options.js: 'Name': 'My Visual Novel'. Players’ browsers keep their saves under this name, so pick the final one now, such as 'After the Bell'. If you change it after people have played, their saves seem to disappear.

  • The title, in index.html, which you changed in Edit, save, reload.

  • The icons, if you like: replace the images in assets/icons/ and favicon.ico with your own, at the same sizes and with the same file names.

Web lists the other details worth setting before a release, such as the description that shows when someone shares a link to your game.

Make a copy for players

You keep working in your game folder. Players get a copy without the parts meant for you.

  1. Copy your game folder, and give the copy a name such as after-the-bell-web.

  2. Remove the debug module from the copy’s index.html. Open it in your text editor and delete these two lines (lines 80 and 81 in the starter game):

    <!-- Debug Library. Remove this file for release builds -->
    <script src="./engine/debug/debug.js"></script>

    The debug module’s dialogs help you find mistakes, and would only confuse players.

  3. Quiet the console in the copy’s js/main.js. Change the 5 in this line to 0:

    monogatari.debug.level(0);

    Without the debug module, Monogatari already stops writing every step of the game to the browser’s console. At 0, it doesn’t write its errors either.

  4. Delete what players don’t need from the copy (optional, but it makes the upload much smaller): the folders types/, engine/debug/, engine/electron/, engine/electrobun/ and engine/desktop/, and the files serve.ts, build-web.ts, package.json, bun.lock, electrobun.config.ts, jsconfig.json and jsconfig.node.json. Keep everything else.

  5. Open the copy’s index.html and start a game, to check the story still plays. It no longer shows error dialogs.

The copy now holds index.html, favicon.ico, manifest.json, service-worker.js, and the folders assets/, engine/core/, js/ and style/, with engine/LICENSE. Without step 4, the starter game alone has 367 files; after it, 53 (ten of them are hidden .gitignore files that keep the empty folders), plus your assets.

Zip it

Most hosts take your game as a single ZIP file. Select the files and folders inside the copy, not the copy itself, and compress them into a ZIP with your file manager’s compress or ZIP option. That way index.html is at the top of the ZIP, where hosts look for it. On a tablet or a phone, you need a file manager that can make ZIP files.

Upload it

Any host that serves files as they are works, and the game runs entirely in the player’s browser, saves included.

  • itch.io hosts browser games: you create a project, pick HTML Game as its kind of game, and upload the ZIP from its website. Its guide for HTML games explains the steps and the limits: at most 1,000 files and 500 MB once unpacked, an index.html in the ZIP, and file names whose capitals match exactly.
  • Any other host for static files works the same way: upload the files so that index.html is at the top of what you upload. The game works at the top of a site or in a folder of it. Use an address that starts with https://: browsers only allow offline play there.

Then open your game’s address and play it through, the way a player would: start it, listen for the music, pick both answers, save, and load.

Update it later

When you change your game, make a new copy the same way and upload it in place of the old one. The game keeps a copy of its own files in each player’s browser, to load fast and to play offline, so two things are worth knowing:

  • Players who come back get your new script and styles on their next visit.
  • If you replace a picture or a sound with a new file of the same name, returning players get it by the visit after their next one: each time the game loads, it asks your host whether the files it kept have changed. You saw the same thing with served games while you work.

Update a released game explains updates in full.

Optional: make the copy with Bun

NOTE

This part is for people with a computer that has Bun installed (see Open your game). The steps above do the same by hand.

In a terminal, in your game folder, run:

bun run build:web

It creates the folder build/web/ with the files players need (steps 1, 2 and 4 above) and prints Web build output: ./build/web. It doesn’t change the debug level in js/main.js: do step 3 in build/web/js/main.js yourself. Then zip the contents of build/web/ and upload them.

A desktop app or a phone app

A web game already plays on computers, tablets and phones. To sell your game in an app store, or give players a program to download, see Desktop and Mobile. Those need a computer and some tools, and the guides say which.

Where to go from here

You’ve made a visual novel from start to finish. From here: