PAXsims

Conflict simulation, peacebuilding, and development

Wargaming with Unity

One good thing to come out of the pandemic has been another, much more enjoyable, pandemic: Rex Brynen’s zombie appocalypse skirmish game, Viralpalooza:

Played in a dark inversion of Mr Roger’s Neighbourhood, the webcam-view of the game turns regular tabletop miniatures gaming into something closer to a first person shooter.

Here I am, stealing a cybernetic soon-to-be-sidekick while the rest of the party throw hand-grenades at zombies.

We also played a modern armour campaign, and good golly webcam view completely changed the experience. 

Oh my poor Bradleys! Note to self: keep moving or ARTY will smoosh you…

Rex put Red and Blue in different breakout rooms and hopped between with the game view. There was real line of sight, including more-effective-than-you-might-think terrain made from books under the fabric. Here’s Blue mechanised infantry (dead centre) making a sneak-attack straight down the High Street on Red at the far end of town, having been able to creep up completely unobserved below the brow of the hill.

There was real fog of war with the miniatures difficult to identify. The infantry tokens especially were difficult to spot and impossible to identify at range. Smoke screens were magically effective. We had some jolly moments with minefields (hilariously Red managed to pick the safe route through the field, but then reversed out over the mines, bwuhahahaha) and artillery strikes on buildings.

But most of all, the nature of the battles were an order of magnitude better than a standard tabletop setup because neither side really knew where the others were. Our final battle of the campaign was a last stand on the outskirts of Tallinn. If Red had just rolled down the Highway it would have been an easy victory. But Red assumed we’d have it covered, and instead sucked themselves into a battle to take a village as a staging-post to the final push. Blue’s irregulars were perfectly suited to this task, and we held them off for a victory. This was a battle that would never have happened if we’d both been able to see each others’ pieces maneuvering.

There were down-sides to the zoom-and-webcam setup. For one, the camera is still a little god’s-eye-view, more so in the modern armour game for using smaller-scale miniatures. It’s not always easy or possible to get a webcam down into the right position. A fibreoptic inspection camera could do better, and overhead cable-management, but we’re playing on a budget ;-)

Meanwhile in Unity, camera positioning is the easiest thing in the world—plus there’s scope for more ambitious terrain and special effects…which got me thinking: could I make a Unity game where God has a strategic game style camera, allowing them to move freely about the map, to place, move, and remove units, and give the players a view of the game from the eyes of their units only ?

I whipped up an extremely hokey concept demonstrator to explore the idea and it seemed promising. So, wind forward 18 months (I’ve been busy!), and behold my adorable toy soldiers:

Here’s Rex Brynen’s heroic squad emerging from a smoke screen, all guns (and RPGs) blazing, surprising a bunch of Nazis, viewed from the about-to-be-killed eyes of said Nazi light-machine-gunner. The hex grid you can see on the floor is a clever projection for measurement, showing the centre US grunt’s movement ability.

Design Concept

The aim of the game is to be a virtual box of miniatures and scenery: no rules, no restrictions, just the ability to place, move, and remove objects like real tabletop gaming, with the player’s-eye-view of the board.

Yes, computers are excellent at rolling dice and calculating probabilities for you, but the point was to be a blank slate to bring your own rule set to, rather than to implement a specific game (40k, D&D5e, modern armour, viralpaloza, etc).

The only ‘calculations’ to go in are a line of sight check visual in the style of using a laser pointer/spirit level from a tabletop game, and a range measurement device (test-play above is using a hex grid, but it can be a square grid, a straight-up ruler, or whatever you want to project). Everything else is presumed to be handled as you would in a physical game, with dice-rolling, look-up tables, adjudication etc.

It’s designed to run alongside Discord for voice/text comms rather than piping any of that through the game, but will include a top-down map with anotation functionality to communicate intent to the DM and team-mates. Here’s the temporary Zoom solution and Rex’s intent for this turn. His objective is that large (burning; he threw an RPG at it) building in the centre of town.

And here’s the RPG-strike, trying to take out the heavy machine gun firing from the upper-floor window. He missed, but did manage to supress firing for a turn:

How does it work?

Cameras: there are two cameras in the game—the god camera with a bird’s-eye-view, and the power to pick up and put down pieces; and the player camera, which shows you only what your units can see (you can look left and right, but you have to ask god to move or rotate the piece).

Here’s God watching Rex’s squad move up to Hellfire Corner:

And Player Cam for the guy to the right of the red door:

Units: this is a pretty loose concept in the game. It’s anything that can be placed on the board—soldiers, tanks, aircraft, or any other kind of player piece—but equally doors and other interactive furniture, and smokes, fire, explosions, objective markers etc. Player pieces have camera positions setup, so when a player selects this piece their game view hops to that. 

I’m 100% sure it’s historically legit that T-Rex was at D-Day.

The units are all held in an ORBAT (the thing on the left in all the screenshots) with fully-controllable heirachy. Players are nodes in the heirachy with access to their subordinate units only. God can re-arrange things during play to give or remove units, and has their own node for NPCs, interactive scenery, and special effects.

Effects: for the fun of it, when units fire they have a firing animation with muzzle-flash and tracer. Explosions explode, fires burn, smoke drifts. The game is presuming turn-based play, so rather than firing a single shot at the time of firing, these are looped so that the opposition can see incoming fire while making decisions during their turn. There’s also some charming lighting and camera effects (simulating a macro lens) to trick your brain into thinking you’re looking at miniatures rather than full-size humans. I have plans to add weather and time-of-day hooked up to turn progression, too.

Architecture

It’s a pretty good fun set of toy soldiers on its own, but obviously the value of this game is in being a networked multiplayer rather than a hotseat or splitscreen multiplayer.

Here comes the sciencey bit:

It’s running with a Node.js server which acts as a relay between the clients. Whenever god updates the position of a unit, that gets sent to the server as a websocket (JSON) packet, and from there to the other clients. The server isn’t doing anything but relaying packets, no calculations or data-storage. 

You can run the server locally, on a LAN, or host it on the internet. I have it running on a free Heroku server. You can also run it without a server and just have a box of toy soldiers to play with.

God is logging all your moves (C# no log4J, lols), so you can capture the game for AARs and analysis, or rewind and try a different strategy, or just save the state of the board to pick up again later.

Artwork

I’m using utterly charming low-poly artwork by Synty Studios. The scenery and units are entirely interchangeable inside Unity—I have this D-Day themed WW2 setup, plus a number of other scenarios (zombie apocalypse, Afghanistan, some epic dungeons, DINOSAURS etc).

Because it’s Unity, there’s plenty of other potential: 

Use Cases

Miniatures wargaming, obviously. Networked for socially-distanced gaming, or to put Red and Blue cells in different rooms, or opposite sides of a room. Even if you’re playing in the same room, the sandbox gives you some rather excellent scenery options beyond the scope of most dining room tables. The most useful feature from my perspective is control of the server for classified games.

Rapid prototyping tool. Want to playtest a new game? Simples: there are no rules to plug in, you can move the pieces any way you like.

Vignette creation tool. Painlessly create visuals for use in other wargames (faux media footage, ISTAR injects, physical game components) or AARs, briefings, virtual battlefield tours, etc. You can create a diorama and screen-capture it without having to know your way around things like Unity or Blendr.

When can I buy it on Steam??

Lols, not yet. For the moment it’s limited to scenery & units I set up in the Unity Editor, and BYO server. Currently beta-testing on Windows & Mac, the user interface is still a work in progress. Leave a comment or drop me a line if you’re interested in using it in anger.

Grr, argh!

One response to “Wargaming with Unity

  1. Daniel Delaney 17/01/2022 at 1:20 am

    I would like hear when it might be available for wider release. This seems a great way to add the “fog of war” to games, esp. now in the era of “remote gaming.” How can I contact you?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: