Xenonauts Dev Diary #2

xenonauts tactical

PC Gamer routinely features Developer Diaries: tales of what goes on behind-the-scenes in the development studios making your favorite games. In this entry, Xenonauts Project Lead Chris England talks about the evolution of the look and feel of indie developer Goldhawk's X-COM: UFO Defense/UFO: Enemy Unknown homage. Let us know what you'd like to see developers discuss in future diaries in the comments.

All has been quiet on this blog for a while now. The previous post showed the bare skeleton of the game; the basic systems around which we would build the rest. Three months' more refinement means we can now show off a much better representation of the final game.

The nature of independent development is that community support is needed for success, and we thought we could trust our audience to look past the flaws and see the potential of the project. While our art style came in for a bit of stick, our site has had a significant increase in the amount of pre-orders and forum users. It's good to discover so many people are willing to look past shiny graphics (or the lack thereof) in this day and age, and we greatly appreciate the support we've received.

We hope to start blogging much more frequently than we have been; this post and those following it will each discuss an important system within the game, discussing the mechanics behind it and the ramifications it has on gameplay. This week: the terrain-generation system and the battlefield itself.

Firstly, the tiles themselves. While the key attraction of the game is not its graphics, we are still trying to make Xenonauts visually appealing. We made a decision that the previous Farmyard tileset was too bright and cartoony to suit the Cold War setting of the game, and we've been working on the Industrial tileset shown in this post as proof of concept of the grittier and more realistic style we'll be using in the final game. A few examples are below.

It's not finished yet (there's still work to be done on the ground blending), but we think things have improved significantly since our last outing. The limitations of the engine we're using mean Xenonauts was never going to be conventionally beautiful, but we've worked hard to find a distinct 'look' and we're hoping the hand-painted style will win some admirers of its own.

A few people have asked why it's taking so long to generate tilesets, so here's a quick breakdown of the process: first, every single tile is modelled and textured in 3D. It is then rendered out using an isometric camera setup, and tested in the engine to make sure it has the correct dimensions and basic appearance (and revised until it does). After that, each tile is painted over in 2D to add the fine detail, with damaged and destroyed variants of each tile also being painted for use in the destructible terrain system. (Click to enlarge the images.)

This is not so bad for a single tile, but when performed on a large scale it is a very labour intensive process and represents a significant drain on our resources. We plan to have 7-8 different tilesets, each containing a variety of ground tiles, tileset-specific outdoor props, and 4 different buildings (which also contain building-specific props). The Industrial tileset alone currently runs to roughly 800 tiles (including different variants for each), each which needs to go through that process.

Tilesets will also have unique civilian and AI soldier skins – so in the Industrial tileset you'll find factory workers, and may encounter some SWAT officers trying to deal with the alien forces themselves. In the Desert tileset, the civilians would be in Arab dress and you might find yourself fighting alongside local mujahedeen. This sort of variation is also a lot of work, but not optional if we're to be able to complete in the marketplace against more established strategy offerings.

Secondly, we're substantially expanded the systems supporting battlefield tile properties. Now each individual tile has customisable values for all kinds of attributes – its hit points, whether it blocks line of sight, whether it can be used as cover, the % chance of a bullet passing through / over it, whether it is explosive (and if so, how large and powerful the blast is), and so on.

Further complexity is that each tile has three states – undamaged, damaged and destroyed, with attributes for each state set independently. Thus a damaged piece of cover can offer less cover than an undamaged one, or a window can stop projectiles when undamaged and not once smashed. Sticking with windows as an example, undamaged states can be set to have few HP compared to the walls around them – thus if there was an explosion near a building, it would shatter the windows but leave the structural walls unaffected.

We've also spent a lot of time on sound design, as we feel it is important for immersion. Our sound designer's previous credits include Amnesia: The Dark Descent and Magicka, and he has a pretty neat job – if you're curious, we're put together this short video where you can see him at work on our SFX.

We've integrated sound into the tile properties, so footstep sounds, projectile impact sounds and destruction sounds can be specified for each tile. A different sound is played when a unit walks across dirt or grass to concrete, and it sounds different when a bullet smacks into a metal pipe to a wooden post. This system lets us tailor the sound effects to whatever is in the tile, rather than using generic sound templates.

While individually none of the features mentioned above are groundbreaking, when combined together they provide a powerful set of tools for modelling realistic interaction with the battlefield. Destructible terrain was one of the greatest features of X-Com, and we've been working hard to ensure that our own system is even better than that.

Thirdly, we've improved the terrain generation. With the Farmyard tileset we were using fully randomised maps, which tended to leave lots of empty grass spaces between each sub-map (fields, orchards, barns etc). This, clearly, was never going to make good-quality battlefields - but fully static maps were equally undesirable, as playing through the same maps over and over gets old very quickly.

Instead, we went back to the drawing board and developed a method that combines the best of both worlds, producing randomised maps that retain a coherent structure. This is done by using two editors for map generation – the first a level editor, the second a sub-map editor.

The sub-map editor is what most people would recognise as a conventional terrain editor, allowing users to construct sub-maps from the individual tiles discussed above. When the building or area is finished, it is saved as a small standalone sub-map.

The level editor is quite a basic tool, but it allows people to assemble full maps / levels from the sub-maps created above. However, instead of specifying specific sub-maps to go into the level in that position, the user only specifies a type of submap – ie, a factory. On map generation, the factory sub-map used is randomly chosen from any number of variations of factory sub-maps that are held in the appropriate folder, and placed on the map appropriately.

So even if you were unlucky enough to get the same mission map twice in a row, all you would know is the vague layout – e.g. the top corner of the map had a factory in it. The size, layout, appearance and the exact positioning of the factory would differ from map to map and, with every section of the map being similarly randomised, you may as well be in a completely different map. Coupled with everything mentioned above, this should ensure every mission offers different tactical options and plays out differently.

So, that's a brief run-down of all the systems involved in the generation of battlefield maps in Xenonauts; I hope you found it interesting. The next entry is likely to cover the AI systems we're implementing – both at the strategic invasion level and for individual battlefield units.

If what you've read / seen above has piqued your interest in the project, you can visit our website here or our forums here .

Finally, we're going to be showing the game off in the Indie Games Arcade section of the Eurogamer Expo over in the UK later this month, so if you're going to be in attendance please do drop by and have a look!

PCGamer

PC Gamer is the global authority on PC games—starting in 1993 with the magazine, and then in 2010 with this website you're currently reading. We have writers across the US, Canada, UK and Australia, who you can read about here.