NSHex Roulette - mixing physical with digital
Tags: gamedev, neuroshimahex, boardgame
Published: 2021-05-11 15:37:45

---
title: NSHex Roulette - mixing physical with digital
published: true
date: 2021-05-10 00:00:00 UTC
tags: gamedev, neuroshimahex, boardgame
canonical_url: https://enclavegames.com/blog/nshex-roulette/
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pbpkmtj4he4bgauvs7pl.jpg
---

We’re big fans of the physical board game [Neuroshima Hex](https://neuroshimahex.pl/), and [NSHex Roulette](https://nshex.enclavegames.com/roulette/) is a digital expansion to that game. We are offering a unique experience to all the fellow players, and it’s free thanks to implementing the **Web Monetization API** as part of the [Grant for the Web program](https://enclavegames.com/blog/awarded-grant-for-the-web/).

## [<svg aria-hidden="true" focusable="false" height="16" version="1.1" viewbox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg>](#paper-prototype)Paper prototype

We’re running the biggest Polish fan site about the post-apocalyptic board game, [NeuroshimaHex.pl](https://neuroshimahex.pl/), since 2010, but our passion for the game started a few years earlier. Fast forward to 2014, when [Portal Games](https://portalgames.pl/en/) (Neuroshima Hex creator and publisher) announces an open call for proposals to send in expansion ideas. We did exactly that with the **Russian Roulette** , which back then was a paper prototype, but got absolutely no response, even after asking a few times every couple of months and sending reminders over the next 2 years (!). I was really sad about it, and thus the project was abandoned for the next couple of years.

![Enclave Games - NSHex Roulette: Paris](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ob5cumm7rjj48vl1oqcz.jpg)

## [<svg aria-hidden="true" focusable="false" height="16" version="1.1" viewbox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg>](#digital-demo)Digital demo

I’m giving talks as a [public speaker](https://end3r.com/speaking/) at front-end conferences since 2012, usually presenting about cutting-edge technologies you can use to build games (Firefox OS, Gamepad API, WebVR/A-Frame/WebXR, Web Monetization, etc) - it was 2018 when I got interested in Progressive Web Apps and was looking for a good demo example for the talk. I decided to dig up the paper Russian Roulette draft and build a digital proof-of-concept - and so [NSHex Roulette demo](https://nshex.enclavegames.com/roulette/demo/) was born.

![Enclave Games - NSHex Roulette: Yggdrasil](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/usih9gvoo388mbat0ice.jpg)

## [<svg aria-hidden="true" focusable="false" height="16" version="1.1" viewbox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg>](#pwa-example)PWA example

The first talk titled _“Progressive Web Apps and board games”_ was given at the [Tech Speakers meetup in Paris](https://end3r.com/blog/2018/10/mozilla-tech-speakers-meetup-in-paris/), and a few next ones followed afterwards. I got a positive response about both the presentation and the app itself, but I somehow couldn’t release the completed version - the project felt too important and needed to be perfect, so I couldn’t force myself into actually finishing it.

## [<svg aria-hidden="true" focusable="false" height="16" version="1.1" viewbox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg>](#nshex-counter)NSHex Counter

Then in 2019 I decided to [build and release](https://end3r.com/blog/2019/09/nshex-counter-an-app-for-counting-neuroshima-hex-tiles/) the [NSHex Counter](https://nshex.enclavegames.com/counter/), which was more of a “companion app” that was designed to help keep track of the tiles used by the player and the opponent, quite popular at the official Neuroshima Hex tournaments in Poland. Since I couldn’t focus on finishing the Roulette, I figured it will be easier to build something similar first, and then use its source code as the base to release the actual expansion, and it worked!

![Enclave Games - NSHex Roulette: cover](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/90a6j5nfc21ul3uwjly0.png)

## [<svg aria-hidden="true" focusable="false" height="16" version="1.1" viewbox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg>](#the-background-story-of-roulette)The background story of Roulette

Since [Neuroshima Hex](https://neuroshimahex.pl/) is a game set in the post-apocalyptic future, the [NSHex Roulette](https://nshex.enclavegames.com/roulette/) expansion introduces the _“Russian roulette”_ mechanism using crates full of military equipment which players can use during their turn, but also traps that can harm them.

_“In a post-apocalyptic wasteland, you never know what you can find in an old abandoned bunker burried deep in the ground.”_

There are five bonuses to pick (Airborne, Detonation, Bombing Raid, Reanimation, and Berserk) which offers unique benefits to those using them, but the sixth one, Headshot, ends the player’s turn violently. You can use every bonus only once, but the Headshot returns to the pool when used - that’s why the longer you play, the bigger the chance of losing.

![Enclave Games - NSHex Roulette: gameplay](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aytzajhyhptiyu03b4ho.png)

## [<svg aria-hidden="true" focusable="false" height="16" version="1.1" viewbox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg>](#web-monetization)Web Monetization

The app was created with the [support from the Grant for the Web program](https://enclavegames.com/blog/awarded-grant-for-the-web/), where we experimented with creative ideas that could be monetized with the new **Web Monetization API** - I think the digital expansion for the physical board game fits nicely.

The implementation of the API is rather straightforward: first, the payment pointer is added in a meta tag to the header of the index.html file:

```
<meta name="monetization" content="$ilp.uphold.com/k4eJGQUDF9nw" />
```

The rest is done in JavaScript - an `if` statement detects if the visitor have an [active Coil membership](https://coil.com/?ref=end3r):

```
if(document.monetization && document.monetization.state === 'started') {
  // monetized content
}
else {
  // non-monetized content
}
```

Since it’s within the Settings of the app, we can safely assume the monetization already loaded in the browser - if it was something to be showed on the main screen we’d probably use an event instead. If the user is monetized, they will see the screen on the left, and if not, the one on the right:

![Enclave Games - NSHex Roulette: Web Monetization](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5u7297jx6xglh81h0o5v.png)

It’s a simple implementation, there’s no backend validation - this is more for fun than profit. The stats are collected anyway, so you could play the game as a non-monetized user, [register through Coil](https://coil.com/?ref=end3r), and see your statistics from the very beginning.

## [<svg aria-hidden="true" focusable="false" height="16" version="1.1" viewbox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg>](#next-steps)Next steps

This is a weird kind of project that “started” 7 years ago, had a few stops along the way, but was finally released. At some point I decided to not wait for Portal and do it myself, and then see what happens.

Since the original concept was suppose to be a physical expansion, some bonuses were using tokens to mark units getting bonuses, but they were scrapped for the sake of not needing any extra parts, so the mobile app is the only thing you need to play. This, however, leaves the door open to create a second expansion, **NSHex Standoff** ) (from, you know, _“the Mexican standoff”_, since “Duel” was a name used by one of the original expansions), which could in turn be paper again given as prizes at Neuroshima Hex tournaments and Polish championships.