Devlog - Game Technology
The technology of Avoyd voxel editor, renderer and multiplayer networked voxel octree game engine using cross platform C++, OpenGL, Vulkan for the GPU rendering, GLFW, Runtime Compiled C++ and enkiTS.
Export Voxels to Optimised glTF Mesh for Unreal Nanite
Doug Binks - # Avoyd # Game Technology
With the recent release of Avoyd 0.26 which added a direct to optimised glTF binary mesh export pipeline, I've made a short video showing how to get your voxel models into Unreal Engine 5+ with Nanite support as scene geometry, and then walk through your model in game.
This post covers the specifities of exporting for Unreal Nanite and how Avoyd optimises meshes for games.
Continue reading
Rapid Development with Runtime Compiled C++ Talk
Doug Binks - Juliette Foucaut - # Game Technology # Runtime Compiled C++
Doug Binks and Matthew Jack gave the talk Rapid Development with Runtime Compiled C++ in 2012 at the Develop Conference in Brighton. It's a good introduction to the technique which has come a long way since.
Runtime-Compiled C++ (RCC++) is primarily designed to shorten iteration times in development - developers can build their project, run it, make changes during runtime and see the results in a few seconds. It is aimed at games development but could be useful in any industry where turnaround times are a bottleneck.
The slides, video recording and transcript of the talk are available:
Continue reading
Voxel GPU Rendering in Avoyd 0.21
Doug Binks - - edited # Avoyd # Game Technology
This release of Avoyd Voxel Editor has been a long time coming, but it adds a significant feature - a GPU accelerated path tracer for faster renders. In this post I summarise the renderer development, cover the performance gains (with data) and discuss future plans.
Continue reading
Optimising Voxel Meshes for Games Using Blender
Doug Binks - Juliette Foucaut - - edited # Game Technology
Reducing the number of polygons in 3D objects helps improve a game's performance. This tutorial explains step by step how to clean up the geometry of voxel models in Blender to prepare them for export to game engines like Unreal, Godot or Unity.
Note you may have encountered 'polygon reduction' techniques under other names such as 'vertex reduction', '3D model optimisation' or '3D model clean up'.
This post covers the following workflow:
- How to use Avoyd Voxel Editor to convert your voxel model to mesh for Unreal, Godot or Unity.
- How to use Blender to optimise the mesh.
- How to use Blender to export to
glTFfor Unreal 5 and Godot, and toFBXfor Unreal 4 and Unity, and Links to guides for importing and configuring the model in each engine.
☛ Update to Avoyd version 0.26 or above:
- You can now export to
.objwithBestoptimisation to skip the manual optimisation in Blender. - If you own Avoyd we recommend you export your voxel model to glTF Binary Mesh
.glbinstead of .obj. This both optimises your mesh better and simplifies your workflow. You can then directly import your.glbmesh into your game engine.
Continue reading
Implementing a GPU Voxel Octree Path Tracer
Doug Binks - - edited # Avoyd # Game Technology
Learn from my mistakes as I implement a GPU voxel octree path tracer based on my current CPU implementation in Avoyd. I cover the C++ to C conversion, buffer upload issues and data visualisation, enhancing the shader error logging along with a basic comparison of the performance on CPU and GPU.
One can program modern GPUs in a variety of languages. However only a few of those languages work well on all the main vendors' GPUs and operating systems: essentially the C like HLSL and GLSL shader languages. Since I use OpenGL with GLSL shaders in Avoyd I choose to write the path tracer in GLSL. (Avoyd runs only on Windows currently but I intend to support other operating systems eventually.)
Continue reading
Importing Minecraft maps in Avoyd Voxel Editor improved
Doug Binks - Juliette Foucaut - # Avoyd # Game Technology
Our Avoyd Voxel Editor has come a long way since the last devlog post about it in 2018, and having just released a significant update which enhances the Minecraft import pipeline this seems like as good a time as any to talk about it once again.
Minecraft maps Greenfield city and Cuirassé DSD-401 by MrBatou imported and combined together in Avoyd's Voxel Editor.
Continue reading
Runtime Compiled C++ Dear ImGui and DirectX11 Tutorial
Doug Binks - # Game Technology # Runtime Compiled C++
This tutorial takes a small DirectX11 project, the Dear ImGui Example, and adds Runtime Compiled C++ to it. This enables us to edit the code at runtime and see the results live, without recompiling and restarting the project.
This is a Windows only project but both Dear ImGui and Runtime Compiled C++ are cross platform. Thanks to Jonathan Bleeker and Milviz for funding this tutorial.
Runtime-Compiled C++ (RCC++) is a way to reliably make major changes to C++ code at runtime and see the results immediately. It's aimed at games development but could be useful in any industry where turnaround times are a bottleneck.
github.com/RuntimeCompiledCPlusPlus/RuntimeCompiledCPlusPlus
RCC++ is primarily designed to shorten iteration times in development - developers can build their project, run it, make changes during runtime and see the results in a few seconds.
Continue reading
Boxes in Space: procedural generation of abstract worlds in Avoyd
Juliette Foucaut - Doug Binks - # Avoyd # Game Technology
The first part of this post describes how we use procedural generation to create environments in our game, Avoyd, out of simple boxes. It is an extension of the 'Boxes in Space' talk Juliette gave at Feral Vector.
The second part shows the trial and error process we went through to create Avoyd's procgen worlds and how we procedurally generate the light and atmosphere.
The third part consists of procedural generation demos, giving complete instructions to create the boxes in space worlds, Menger sponges, trees that avoid obstacles, and how to change the lighting and atmosphere in Avoyd. The worlds created can be saved and used in game.
Continue reading
Procedural python word generator: making user names out of 4 syllables
Juliette Foucaut - - edited # Game Technology # Web Technology
I decided to write this post after reading about a very cool procedural NPC name generator and thinking that it might be of interest to show a much more basic example. This post is intended for people who have never used procedural generation and know very little programming. The examples are written in Python. I'll do my best to keep things simple and introduce the complexities progressively.
The algorithm is basic: names are generated by randomly assembling four syllables. First I'll explain how it's built, then the features I added to it to make sure the names are within an arbitrary size range, and more importantly, unique.
Continue reading
Speeding up Runtime Compiled C++ compile times in MSVC with d2cgsummary
Doug Binks - # Game Technology # Runtime Compiled C++
It's rare for me to read a blog post and immediatly put the information to use, but this post from Aras Pranckevičius, Best unknown MSVC flag: d2cgsummary is one. Within a short time I had cut elapsed compile and link times for Runtime Compiled C++ live coding with Visual Studio by 1.5x, and eventually 3x with total compile time (total time for all compile processes in a multithreaded system) down 10x. This post explains how.
Continue reading
Internals of a lightweight task scheduler
Doug Binks - # Game Technology # enkiTS Task Scheduler
This is the second in a series of articles detailing the inner workings and evolution of the permissively open source multithreading task scheduler enkiTS for C and C++ (including C++ 11). In the first article of this series I covered the external interfaces and their implementation. This post will cover the task threading function, running tasks, and waiting for tasks.
Figure 1: Screenshot of Avoyd being profiled with microprofile and ImGui integration available in enkiTSExamples. Solid bars above named tasks show when threads are active - the wait functionality allows the core to idle or other threads to run.
Continue reading
Implementing a lightweight task scheduler
Doug Binks - - edited # Game Technology # enkiTS Task Scheduler
This is the first in a series of articles detailing the inner workings and evolution of the permissively open source multithreading task scheduler enkiTS for C and C++ (including C++ 11). The interface has evolved somewhat since this article, and whilst I've made minor changes to update it, keeping it fully up to date is difficult, so please check out the full code on github.
enkiTS - Code and basic examples for the task scheduler described this article.
enkiTSExamples - Further enkiTS examples adding profiling instrumentation.
If you're writing a compute intensive programming task on consumer hardware, and you want to use as much of the systems resources as possible, then you'll need to consider multithreading on the CPU. There are a number of ways to approach this, but the current gold standard approach for developers who want both simplicity and control is a task scheduler which can handle data-parallelism (in the games industry a task is often referred to as a job). Task parallelism allows you to run different types of computation at the same time, whilst data-parallelism enables you to run the same computation over a set of data across different threads at the same time. Note that I won't consider Single Instruction Multiple Data (SIMD) parallelism here, but if you're doing computations you probably should. Additionally, I won't cover multithreading methods for handling large latency, such as waiting on hard disk or socket transactions.
enkiTS in our game, Avoyd, being profiled using the microprofile and Dear ImGui integration available in enkiTSExamples. This is an old image of the game and the current codebase uses newer enkiTS API features such as priorities and pinned tasks making for a much more complex task graph.
Continue reading
Normal generation in the pixel shader
Doug Binks - # Game Technology
As usual, whilst working on one aspect of Avoyd I hit a hurdle and decided to take a break by tweaking some visuals - specifically looking at the normals for my surfaces. I added a step to generate face normals in the pixel shader using the derivatives of world space position [see: Normals without normals by Angelo Pesce and the Volumes of Fun wiki on Computing Normals], and immediately noticed precision issues when close to the surface. I'll demonstrate the issue and my quick fix which uses eye relative position instead of world space, before explaining what's happening in full.
Figure 1: The image on the left shows the face normals calculated in the pixel shader using the world space position, and on the right we take the eye relative world space position.
Continue reading
Lighting voxel octrees and procedural texturing
Doug Binks - # Game Technology
In this post and video I'm going to cover the recent changes I've made to Avoyd's technology to add shadows, ambient occlusion and procedural texturing. I'll describe simple procedural texturing and its anti-aliasing, along with the use of voxel octree data to generate lighting and ambient occlusion using ray casts and 3D textures in the game Avoyd.
There's a good deal of information on all of these topics online, and they certainly aren't novel additions to a game - however in Avoyd I'm taking a slightly unusual approach so I thought it worth documenting. It's worth checking out the video before reading further.
Continue reading
Octree streaming - part 4
Doug Binks - - edited # Game Technology
This post follows on from earlier posts on Octree Streaming. You should be able to read them out of order, but you get cake if you read part 1 first, then parts 2 and 3.
The video showcases three players zooming around at high speed in an environment being streamed from one player's PC to the other two, with the recording being done on one of the clients. This devblog post is about the steps I took to get this working smoothly.
Performance tuning is a large and varied topic, so I'm going to concentrate on one aspect which came up during development of the streaming system - framerate hitch removal. A framerate hitch occurs when one frame takes longer than most of the rest of the frames. To the player it can feel like a sudden start/stop. If frequent, the game takes on the feeling of being played on sandpaper.
Continue reading
Octree streaming - part 3
Doug Binks - # Game Technology
The post follows on from the earlier post on Octree Streaming. You should be able to read them out of order, but you get cake if you read part 1 first, then part 2.
This tech update video shows off multiple players rapidly and smoothly editing fairly large sections of the environment whilst in edit mode. Materials and rendering are all still simple debug visuals for clarity rather than beauty, but there's still a fair degree of artistic freedom available. It's a real pleasure being able to carve and paint geometry fluidly in a connected online world.
Getting this to work, and work well, took a fair amount of effort and I'll explain some of the technical details here.
Continue reading
Octree streaming - part 2
Doug Binks - # Game Technology
The post follows on from the earlier post on Octree Streaming. You should be able to read them out of order, but you get cake if you read part 1 first.
Our latest tech update video shows off players moving through the world shortly after joining the game - the video starts only a few seconds after where the last one ends, so about 30 seconds after loading. At this point large sections of the world are still being streamed to clients, but the prioritization of nearby regions ensures detail is present close to the player.
Continue reading
Octree streaming
Doug Binks - # Game Technology
The original Avoyd stored the internal voxel representation of its game world as a standard 3D array. At the time this provided a good trade off between performance and memory for the size of levels we required for a multiplayer PvP game with a fully modifiable environment. In the new version we wanted to increase the size of worlds we could handle, whilst maintaining large view distances.
Our second technology update video shows off how the voxel octree streaming gives rapid loading over the internet.
Continue reading
LAN discovery with multiple adapters
Doug Binks - # Game Technology
I was recently testing my LAN server browser dialogue menu with multiple machines running servers when I encountered an unusual issue. I had two machines, each running a server and a client. On one machine the client could see both servers, but on the other machine only the local server was found. The application had firewall permissions, and since the server was both sending and receiving packets without problem the firewall didn't seem to be the culprit.