Support our work on Avoyd and open source software through Github Sponsors or Patreon



Juliette Foucaut - Doug Binks - 25 Mar 2019

In-game building is finally here. It's taken us a lot of time to refine and the result seems pretty simple, but we went through a number of iterations for getting in game building working fluidly and intuitively in six degrees of freedom - how do you build a 'floor' when rolling around in space?

Taking the floor example, we started with detecting which surface was currently the player's 'floor'. We then used ray casts to find how far the 'floor' was below the player. When the player held down the build button we clamped the floor axis so they could move around freely whilst building on that plane. When this worked well it was wonderfully easy, but there were a lot of edge cases. For instance when the player was on a corner the auto floor axis detection would flicker between one axis and another. We fixed this by adding some hysteresis. This removed the oscillations, but we still found it hard to use under some circumstances.

In the end we dropped the clever auto-axis detection code we'd been working on in favour of a simple axis select for the floor/wall tool. We kept the 'clamped axis' approach where once a player starts building, the axis perpendicular to the surface they're building is locked. The other build tool, 'Blocks', doesn't lock the axis (it uses symmetrical blocks) which enables more freeform building.

In summary, for now the build system works as follows:

We've kept shapes basic: blocks in 3 sizes (1x, 3x, 5x), and 3x3x1 walls in all three planes.

Building progressively adds material over a couple of seconds until the voxels are full, deleting does the reverse.

Only one material is available: a hard 'ceramic'.

There's no limit to the amount of building you can do.

To build, ensure you have the latest version installed (download). Start the game. Select the tool: '2' for blocks, '3' for walls, and use:

left-mouse to add material,

right-mouse to remove.

Use the mouse wheel to bring the cursor closer to or further from you.

Press the tool number (e.g. '2' '2' '2') repeatedly to cycle between block sizes or wall orientations.

Eventually we plan to add more materials along with some form of resource management for building, and evolve the gameplay to make building a more integral part.

Other updates

(All updates for Avoyd version 0.4.0 are listed in the change log.)

If you have an NVIDIA graphics card, you may have noticed glitches in the sky and environment when looking around. We've hopefully fixed that bug but it would be great if you could give us a shout if you notice graphical oddities in version 0.4.0.

We've tweaked the procedurally generated terrain (linked boxes) to show the various hardnesses of materials better.

We've replaced the player avatar with a more interesting model than a green sphere. It's visible in multiplayer or from the back when you pick the 3rd person view (press 'F1' in-game), and in the screenshots below (front view):

Audio progress

We started working on in-game audio using the open-source library SoLoud. We have some pretty atmospheric rumbles for the drones, which improves gameplay immensely as now you can hear them searching for you.

Playing with audio has also led to amusing results, such as the accidental purring turrets (a.k.a. purrets, thank you reddit) which we're thinking of keeping. You can hear them in action in this video:

Video recorded in-game at low resolution (1280x720). It features the player setting turrets and turrets scanning the environment and shooting at enemy drones. The shooting sound is extracted from the original Avoyd (1999). The purring sound was supposed to be a looping intermittent beep (two sets of descending square waves) which was accidentally slowed down programmatically and ended up sounding like a cat purring.

Whilst working on audio we've encountered some minor technical difficulties such as clipping issues when there are many entities around however, so we decided to postpone releasing the audio until we've resolved these.