Hello and welcome to the fourth CardLife DevBlog,
I’m Brian, the Lead Coder on CardLife. Seeing as Rich is away at the moment I get the honour of writing today’s dev blog. I’m going to talk about how we’re going to handle terrain in CardLife.
Terrain
Every single week Rich walks over and asks me if we can still have a really big world. I think he’s afraid I’ll find some terrible problem and tell him we’re capping the world size at a square kilometer. But that’s not going to happen. We want the world to be large - at least several kilometers from side to side, surrounded by an ocean - and there are challenges we need to overcome, but that’s one of the reasons I make games.
Last week we decided to start some research into exactly how we’re going to handle terrain. Rich wants to be sure we can deliver on our vision and I want Rich to stop asking me if the terrain will work. I have two main avenues of attack. First of all I planned out all the work needed to make our sheets of card render at the speed we want, with a small enough save file and instant updating in multiplayer. That’s a lot of work! We’re a small team here with just myself and Ed doing all the code for this game. We don’t want to have one of us spending up to a year working on one part of technology.
The second option was to look at some middleware and see if there is anything already out there that could speed things up for us. The biggest trouble with getting some off the shelf package is the unique look of our game. A typical voxel engine won’t draw our flat sheets of card with high detail around the edge. Having a lot of freedom and flexibility in the shapes you create in CardLife is a major priority to us. However, I did find one engine that could do everything we need.
Voxel Farm
Voxel Farm is a voxel engine which gives us a lot of customisation. While most voxel engines will restrict you to cube shapes or flat surfaces Voxel Farm has a nice system that allows us to control where the face of the terrain is drawn. It also allows us to map textures to the voxels so we are able to place grass on top of the terrain and the cardboard edge along the side. This was a particular worry of mine when looking at terrain engines as I really like the look of CardLife and I don’t want to compromise on that. Mike, our artist has done a great job creating such a charming feel to the game.
At the moment I’m playing around with Voxel Farm, figuring out how it works and when it doesn’t. I’m enjoying myself working with the new technology and looking forward to getting it into the game properly. I’ve posted a screenshot of something I was working on earlier today. You’ll see the general shape of the terrain we want to create (although there are a few errors along the edge) and I’ve coloured each voxel a different colour. If you look closely you’ll see how some of the voxels are stretched. Also, if you look in the background you’ll see that the voxels are huge. That allows us to have a massive draw distance without slowing down the game. Don’t worry though, they won’t stand out like that once we get some sensible textures in there. Another thing you’ll notice is how bad my choice of colours are. I’ve been giving myself eye strain looking at this image!
When we’re done the world should look just like it does now. The differences that you’ll notice are the bigger world and the faster frame rate. Hope to have this with you soon!
Cheers,
Brian - Lead Coder