iakov.dev

Flight over a voxel landscape

· 1 min read

Video

The video above is a flight over the voxel landscape of my new game, the tank game I found a model for a few days ago. Flying the camera over the terrain is the quickest way to show what the world looks like at this stage, before there is much else in it.

I still need to work out how the tank will fit in. It’s a smooth polygonal model, and everything you see in this video is made of voxels.

A tank model for my new game

· 1 min read

A tank model for my new game

I found a free tank model for my new game. The screenshot shows it loaded into my editor, with a camouflage texture spread over three materials that all use the same tank1.jpg.

I’m just not sure it will fit well in a voxel world. It’s an ordinary polygonal model with rounded shapes and a detailed texture, and everything around it is going to be built from cubes.

Google Native Client build of the Glow engine

· 1 min read

Google Native Client build of the Glow engine

I’ve finally made the Glow engine cross-platform. The first platform after Windows is Google Native Client (NaCl), a technology that runs native C/C++ code inside a browser window. The screenshot shows the Tarta voxel terrain rendering in Chrome from a local test page, with a console full of GL errors that I still have to clean up.

What I like most is that a game can start straight from a link. There are no installation steps, and it reaches users on Windows, Linux and Mac OS. I’ll write about the port in more detail later.

A template static member that GCC won't link

· 1 min read

Nobody can know all of C++. The following code fails to link with GCC, complaining about an undefined variable:

template <typename T>
struct core_type
{
public:
	static int m_var;
};

struct test_type : public core_type<test_type>
{
	int m_another_var;
};

template<> int core_type<test_type>::m_var;

If I change the last line to this, it compiles successfully:

template<> int core_type<test_type>::m_var = 0;

And that is the correct behaviour. ISO/IEC 14882 (14.7.3.15) says that an explicit specialization of a static data member of a template is a definition only when it includes an initializer. There is no syntax to define it with default value.

Visual Studio accepts the first version without any error.

Geometry optimisation for voxel meshes

· 1 min read

Geometry optimisation for voxel meshes

I’ve optimised the mesh generation. Until now the voxel mesh was generated as is, and the only thing I removed was the internal faces. That produces a huge amount of vertex data, which is slow to load into the GPU, slow to process on the CPU, and so on.

The new algorithm reduces vertex data by a factor of three to four, though it makes mesh generation slightly slower. There is one more possible downside. The result is no longer a regular mesh, so ambient occlusion based on vertices will be hard to apply. I hope my version of SSAO will handle it.

This is the new version of the mesh generation:

Voxel terrain built with the new optimised mesh generation

Moving the site to Amazon EC2

· 1 min read

Moving the site to Amazon EC2

I moved the blog and the site to Amazon Elastic Compute Cloud, and it took me several days. Until now I paid Hostgator around 10 USD a month for hosting. Amazon has a free option, a t1.micro instance that costs nothing for the first year, and I wanted to try Amazon’s services and play with a virtual machine anyway, so I switched.

First iteration of grass

· 1 min read

First iteration of grass

I’ve been playing with grass these days, and the screenshot above is the first iteration. The grass sits on top of the voxel terrain at the edge of a dug-out pit, with the blocky earth walls behind it.

The texture is the part I’m not happy with. It’s a soft, realistic grass, and next to the hard edges of the voxels it looks like it came from another game. I’ll change it to something more cubic so it fits the rest of the world.

Art for Tarta

· 1 min read

Art for Tarta

I’ve reached the point where my art skills aren’t good enough for the Tarta project, so I’m looking for a talented artist to help with it. If you’re interested, send me a private message or leave a comment.

Here are some pictures from the current stage of development. The one at the top is probably going to be the multiplayer character. It’s a free model from Turbosquid.com, loaded into my editor.

Grass, with a temporary model that will be replaced:

Grass test in Tarta with a temporary model

Bigger explosions

· 1 min read

Video

I spent a bit of time playing with grenades and increased the radius of the explosions. The video above shows how they look now, blowing holes in the voxel terrain.

Everything in Tarta’s world can be destroyed this way, because the whole level is a voxel field. Since last week the server is the one that edits that field, and it sends the changed chunks to the clients over the network.

Voxel field updates over the network

· 1 min read

Voxel field updates over the network

Today I got voxel field updates working in multiplayer. The server is the one that changes the voxel field, and then it sends the result to the clients. The screenshot is the first one I took of it working: a hole in the ground that was dug on the server and showed up on the client.

Updates go out one chunk at a time. A chunk is 32x32x64 voxels, and I compress it with RLE before sending. The transport is UDP, the same as the rest of the client-server communication in the game.