Milestones: Workstations, cube display, and DISPLACE THE FACE!

As an indie dev, I'm in the fortunate position that lockdown hasn't changed my ability to work on Hexahedra. Apart from a couple of days off over Easter, work has continued apace. Since last month's update I've completed another 32 issues, fixed 15 bugs, and completed three more milestones. The fourth milestone, supporting multiple Workstations in the Unity client, was a major breakthrough, because for the first time Hexahedra really felt like a game. The Issue Spike also has a pleasingly thick stack of completed Post-Its on it, and I'm now wondering if I'll end up having to buy a couple more before the project is over.

So, what improvements has the last month brought?

Milestone 4: Multiple Workstations

I've found there's nothing more satisfying when building a puzzle game than adding a new element to the game, trying it out, and realizing that I'm learning how to play my own game as I go. Adding multiple Workstation support to Unity was the first time this happened. As with various other features (including cube merging that we'll come to later on) I was already at the point where this worked in the core HexSim DLL, but there was no way to set up multiple Workstations in the Unity client.

Once they were added, having branching logic and multiple Command Tracks in a Workstation came into its own. Using a Laser to detect the colour of an incoming cube's face, it was a simple matter to send cubes on to different Workstations based on their state.


Branching based on top colour. Whole milk goes right, everything else down.

But here's where the "ooh, wait a minute..." moment comes. Up until now, it's never been an issue as a player that switching Command Tracks takes a cycle. In the image above, if the laser doesn't cause a branch we'll hit the end of the first track and go back to the start after 10 steps. If we do branch, it'll take 11 steps to reach the end of the lower track. That means that if the Workstations we're sending the cubes to use a single track and reset every 10 steps, they'll eventually get out of sync with the first Workstation. I've always been aware that keeping different bits of the Factory in sync is going to be a major challenge for players, but this was the first time I'd actually had to worry about it during playtesting.

Watch for the Workstations gradually getting out of step.

The multiple Workstations also expand the scope of what players can do to a single cube. Even if there was no limit on the number of Command Tracks in a single Workstation, when a Workstation can only have 5 Devices (and two of them will have to be a Sourcer and a Shipper if you want to complete a level) then what can be done in a single one is pretty limited. New gameplay vistas have opened up, and finishing off this milestone was particularly exciting.

I also found myself adding usability features for my own sanity, in particular being able to reset the Factory to its pre-run state so that I could tweak it and run the simulation again. Up until this point I'd had to stop and restart Play mode within Unity if I wanted to rerun the simulation, which meant re-adding all the Devices and Commands from scratch. This was (just about) bearable when there was only one Workstation, but it was totally unworkable with four. Being able to move the camera and zoom in and out also became necessary. Small things, but they all contribute towards the feeling that this is an actual game.

Milestone 5 - Source and Target cube display

Obviously players are going to need to be able to see what cubes are available to them to work with, and what cubes they're trying to make for their customers. Long term, getting them to peer at a JSON file probably isn't the best system. So now they appear within a couple of collapsing UI elements in the top-left corner.


What do you mean, "that's not a UI"?


Ah, yes, I suppose that is a bit nicer.

There were a few obvious usability features to add as part of the milestone. The cubes can be rotated by dragging so you can see all the different sides, with a button to reset the rotation; you can switch to a net view so you can see all the sides laid out at once in a cross-shape; and for the source cubes there's a little knobbly bit on the top face so you can easily see which way up the cube will arrive. We also display the number of cubes that have been shipped to each output along with the target count, and for the sources we show which cube will be the next to appear, although for a randomized source we'll instead want to show probabilities.

Having spent most of my career making game servers rather than clients, I had quite a lot to learn here, including the mysteries of the Stencil Buffer to get the cubes to not render when not within the bounds of the collapsible UI:


Milestone 6: DISPLACE THE FACE

Up to now the only thing you've been able to do to edit a cube (at least in Unity) has been to repaint faces in different colours. Being able to add and remove cube faces is a major step in adding new functionality to the game, not just because the materials a cube is made up of can be changed, but because it paves the way for cube merging. If two cubes are both missing faces, they can potentially be slotted together to create a (more) complete cube, so players now have the option to work on two halves of a cube in parallel before uniting them and shipping a complete cube to a customer.

Merging was another feature working in HexSim but not available in Unity, although getting it running in Unity did bring a HexSim bug to the surface that hadn't been caught by the integration tests.

Now that merging and panel adding and removing is in, I can start to add partial cubes as input sources, and potentially as output targets as well.

As well as a simple Panel Remover, and an Adder that always puts the same panel onto cubes, there's a stack-based Adder/Remover that allows players to pull panels off cubes and put them back later. Building, say, some partially-metal, partially-glass output cubes from all-metal and all-glass source cubes is now possible.

On top of that, there's nothing stopping you adding a panel in a Workstation that doesn't contain a cube, which will create a new "cube" with only a single panel that can be manipulated and added to in the usual way.

Getting all of this up and running and solving a puzzle by pulling faces off cubes and then merging them was another satisfying "this actually feels like a game!" moment.


Sorry, your browser doesn't support embedded videos.

This is an extremely inefficient solution to a simple puzzle, but it shows what's possible.

What's next?

I now want to start focusing on presentability. I'm keen to get Hexahedra in front of even more people early on so that people are aware of its existence well before it launches. However, let's face it, right now it's a bunch of untextured cubes floating in front of a skybox, it's not exactly brimming over with visual appeal. Even some relatively simple changes to the look of the game will have a lot of bang for their buck in terms of visual appeal against time taken.

Alongside this, I'm close to receiving the first batch of Device designs from Ana Steiner (@PoddlePea). I've commissioned multiple sets, so that different Factories will have different looks, and the first set is nearly ready. These are really intended to be sketches I can pass to a modeller to produce the final game assets, but I'll also be able to use them as placeholders within the game, so we can get away from only having my questionable icons to show us what's going on.

Apart from that, the obvious next features are to keep on implementing additional Devices. The Payload Adder is a likely candidate. This will require going back into HexSim to add new functionality to the simulation, there's currently no support for cubes carrying things around inside them.

Hexahedra has come a long way in the three weeks since the last update. Now that it feels like a game, it's time to make it start to look like one.