WebPlayer
Quest Viva’s WebPlayer lets you serve any Quest game to a web browser. The game code itself runs on the server, with the web browser sending the player’s input and receiving the game’s output.
There are two ways of running WebPlayer:
- run using Docker
- build from the Quest Viva source code
Run WebPlayer using Docker
First, install and run Docker. For configuration, you can create a compose.yaml
file:
services: webplayer: image: ghcr.io/textadventures/quest-viva-webplayer:latest ports: - "8080:8080" environment: dev__Enabled: true
You can then run this using:
docker compose up
WebPlayer will now be running at
The configuration above sets the dev__Enabled
environment variable to true
, which enables the developer mode. This enables uploading a game directly into the container, which is handy for testing - though you probably don’t want to enable this on a production server.
While Quest Viva is under active development, you may want to pass the --pull always
flag so that Docker always fetches the latest version, instead of using a cached one:
docker compose up --pull always
Build from source
As an alternative to Docker, you can build and run directly on your machine.
First, you will need to download and install the .NET 9.0 SDK.
Next, use git
to clone the Quest Viva source code from
Then you can run using:
dotnet run --project src/WebPlayer/WebPlayer.csproj
You should then have WebPlayer running, by default at
Configuration
Home page
You can choose a game to serve on the home page.
You need to specify a Home__File
environment variable to point to the game, and that game needs to be available in the Docker environment. To do that, you need to set up a Docker volume.
Here’s an example that serves /path/to/your-game.quest
on your machine via a Docker volume, which exposes it as data/your-game.quest
in the container:
services: webplayer: image: ghcr.io/textadventures/quest-viva-webplayer:latest ports: - "8080:8080" environment: Home__File: "/data/your-game.quest" volumes: - "/path/to/your-game.quest:/data/your-game.quest:ro"
Update appsettings.json
, like this:
{ "Logging": { "LogLevel": { "Default": "Information", "Microsoft.AspNetCore": "Warning" } }, "AllowedHosts": "*", "Home": { "File": "/path/to/your-game.quest" }}
Debugger
If you’re developing your game, then you may want to enable the debugger.
Set the Home__Debug
environment variable to true
to enable the debugger.
services: webplayer: image: ghcr.io/textadventures/quest-viva-webplayer:latest ports: - "8080:8080" environment: Home__File: "/data/your-game.quest" Home__Debug: true volumes: - "/path/to/your-game.quest:/data/your-game.quest:ro"
Update appsettings.json
, like this:
{ "Logging": { "LogLevel": { "Default": "Information", "Microsoft.AspNetCore": "Warning" } }, "AllowedHosts": "*", "Home": { "File": "/path/to/your-game.quest" "Debug": true }}
When running the game, you’ll see a “Debug” button in the top right corner. Click this to open the debugger.
Developer mode
Enable developer mode to allow uploading a game directly into the container. This is useful for testing, as you don’t need to restart your container to recreate your volume. You probably don’t want to enable this on a production server though. In this mode, if there is no home page game specified, it will link to the file upload page. Otherwise you can access the page at /dev/open
.
You need to set the Dev__Enabled
environment variable to true
:
services: webplayer: image: ghcr.io/textadventures/quest-viva-webplayer:latest ports: - "8080:8080" environment: Dev__Enabled: true
Update appsettings.json
, like this:
{ "Logging": { "LogLevel": { "Default": "Information", "Microsoft.AspNetCore": "Warning" } }, "AllowedHosts": "*", "Dev": { "Enabled": true }}
The debugger is always enabled in developer mode. When running the game, you’ll see a “Debug” button in the top right corner. Click this to open the debugger.