Jump to content

Development Update - Tile Production Process


Aaron

Recommended Posts

Hello all - as Chris mentioned in the development update, I am now the first full time employee at Goldhawk. I had previously been working on Xenonauts in my spare time for about a year as a tile artist, which is what I will talk about a little in this post.

Firstly I should say a little about my background. My previous "real" job was as a software developer at an engineering software company working on fluid dynamics simulation software (I studied cybernetics at university), and prior to that I have also worked as a games/software tester at Lionhead Studios and on other less interesting projects.

I am of course an avid PC gamer and also an incurable tinkerer; I started modding around 1997, eventually making some neat little mods for Operation Flashpoint and since then have been modding pretty much continuously - I worked for a long time on the Forgotten Hope mod for the Battlefield series, and also on a C&C Generals mod called Rise of the Reds. I have done pretty much everything in that time - audio, scripting, modelling, skinning, level building and game design.

About this time last year I met Chris at the Eurogamer expo and got chatting to him about developing Xenonauts, and ended up doing some freelance tile art. About 6 months later I was starting to look for a new job, and Chris was talking about staffing up Xenonauts and getting an office, and so here we are.

Anyway, that's plenty of rambling about me - on to the task at hand.

The tools I use when creating tile art for Xenonauts are the 3D modelling package Blender and the 2D graphics package GIMP. The main advantage of both of these is of course that they are free; when I started working on Xenonauts I actually hadn't used either of these before that much, but coming from Photoshop and 3D Studio Max the transition wasn't so difficult especially given the huge number of tutorials; for Blender I particularly recommend http://www.blendtuts.com/ and, for something more advanced, the "vehicle modelling training series" from CG Cookie is well worth the money.

Planning

--------

So when creating a new building for a tile set, we must of course decide what it should be - we wanted the Soviet town to look distinct from the Western town set, and had decided on a slightly more run down style with some government presence. We also wanted at least one large building that can be used to build a complex centrepiece structure for a map, and for this we decided to use on a mixed use office/archive government build in a somewhat ornate style (at least compared to the buildings around it) as a multi-tier structure.

After that came deciding specifically what it would look like. I already had in my mind one clear inspiration immediately, which was the Soviet archive building that featured in Goldeneye (both the film and N64 game) - it was stylistically suitable and also looked like it could be recreated in a tile-able form quite well.

goldeneye64_archives.jpg

goldeneye64_archives2.jpg

Additionally I poured over lots of pictures of KGB headquarters buildings from all over the Soviet Union, particularly for exterior references, as these all tend to occupy a similar style of building.

kgb_hq.jpg

kgb_hq2.jpg

After that I would normally sketch out each different type of object (windows, doors etc...) that would be needed for the building exterior, just to make sure the designs I had in mind for each individual piece would interlock with each other correctly; at this stage though I am practised enough to be able to do that in my head and combine that with the next phase, which is building the geometry.

Modelling

--------

Creating the geometry of each building piece is one of the simplest parts of the process. I use standard vertex modelling and just extrude, extrude, extrude until I have the shape I need. I have a standard template file for Blender (more on the reason for that later), and each different item gets one layer of this file; this keeps everything related together and means if I were to make global changes, such as changing a colour or texture, it is inherited by all similar objects automatically - this is pretty vital as even tiny mismatches between tiles will be glaringly obvious once they are in the game but are hard to detect during rendering. Here are a couple of untextured tiles:

raw_window3_zps337ffd38.pngraw_window4_zps90836747.png

The next step is applying colour and texture. I do this entirely using procedurally generated textures in Blender, rather than the more traditional way of using static files. The reasons for this are it eliminates the need to UVW unwrap anything (a time consuming process) and it means I can make fairly significant changes to my geometry (Chris is a fiend for revisions!) and the textures will just adjust themselves accordingly and still tile nicely with other pieces. For the interior wall above I have simply applied the appropriate colour (from Goldeneye!) and then set a subtle noise effect all over to simulate slight imperfections in the painted finish - in reality you likely wouldn't see these details from a distance, but having the wall completely blank of any detail would counter-intuitively look quite jarring in the game.

window_se_zps67e553fd.pngwindow_nw_zpsabfd5ef1.png

For the exterior, the bricks have been given a high contrast pattern of dark rendered "clouds" across them to simulate the way they collect water stains and similar marks, while the concrete between them has an even rougher pattern of rendered dark noise to simulate its pitted surface. The window frame I just left as a clean cream colour - it has enough detail on it from the geometry to not need a texture, and applying one to complicated objects at this low a resolution will simply make it look like a mess of noise. Here are some more parts from the complete set:

door_se_zps43626542.pngwindow_upper_nw_zps81ca0de9.pngbalcony_door_se_zps2b14bdd2.pngwindow_upper_se_zps06636c2e.pngsecurity_door_nw_zpsac3bbcdc.png

You can see we have a couple of different variations on exterior wall colour - the idea behind this is to replicate the style many of those KGB buildings have, where the ground floor is a darker colour of brick, with floors above that clad in lighter colours.

Rendering

---------

Once all that is done the final step is to render all the tiles out so they can be put in the game. In theory this sounds simple, but in actual fact it is the part of the process that causes the most headaches, and it has taken me a great deal of experimentation and preparation to be able to get to the step where I can essentially "turn the key" and produce a complete set of renders for a full Blender file.

The main problem is these files are small - only 128*128 pixels in resolution - and each tile needs to fit perfectly in the space between every other tile in the set. It must also always be rendered from the same position, otherwise the rendering algorithm may end up placing the edge of one face one pixel too short - this would be undetectable in the render but would show up in the game as obvious seams between each tile. Lighting must also be accurately reproduced to match the existing tiles in the game (all of which are lit more strongly from the right).

On top of all that, each building has just a huge number of tiles - the basic set of tiles for the Soviet archives has 96 different tiles in it, not counting those for the roof, which is an awful lot of opportunities to make mistakes. It also consumes huge amounts of time - when I first started working on the tiles I was spending as much, if not more, time on the simple rendering and naming process than I was on the actual creation.

Problem Solved

--------------

My solution to this was twofold. Firstly I created a template Blender file in which both the lighting and the camera are set-up perfectly, and I then animated the light and camera so that each frame of animation corresponded to viewing the tile from a different direction. This meant rendering a tile from all 4 of the necessary direction was just a matter of advancing the frame count in Blender by one. I was also able to use this animation method to automate some of the more tedious tasks like rendering doors in their open, closed and destroyed state.

This was a big improvement, but left the time consuming and error prone process of manually naming each frame into the correct format for the game; so I came up with an additional tool to fix that. I found an application called Blender++, which comes with a command line utility called "brend" that can render out Blender files automatically one frame at a time - this didn't solve the naming problem (all the different objects would come out named after the file with a numerical tag), but it did solve the problem of me needing to manually switch Blender. I then wrote a wrapper for the brend utility as a batch file, that worked as follows - you drag and drop the file you want to start rendering onto the batch, and it kicks off a brend of the first 4 frames in that Blender file and then shows you the results - at that point it asks you what the object is, so you would type "window" for example, and then it automatically names each frame with the appropriate name and facing (i.e. does it face NE, NW, SE or SW?) and moves it to a finished; it then asks you if you want to render more, and if so it moves to the next Blender layer (i.e. where the next object is stored) and repeats the rendering and naming process.

This system cuts the time needed to render and name a large set of tiles from several hours to about 15 minutes, and is vastly more robust in terms of avoiding errors. Tiles produced by the process can be dropped straight into the game for set-up, and if there are any tweaks needed it is a fairly simple process to redo the renders again in such a way that the new tiles can just overwrite the old tiles with no need for re-checking the positions. The reliability of this system has also made it possible for me to do more complex building types (such as Nissen huts, which you may not have seen yet) which have curved edges that need to match absolutely perfectly between tile transitions.

Once the complete set of tiles for a building like the Soviet archives is complete it gets put in the game for testing and is also passed on to our very talented 2D artist Mikael, who paints over the tiles to give them that stylised look we use for all buildings in Xenonauts; it is always an absolute pleasure to see how awesome the tiles can turn out after he gone over them.

Anyway I've enjoyed rambling on about this, and hopefully it will be a bit of an interesting insight into how these kinds of old school 3D tiles are produced. As much work as all of the above may seem, I think once the results are in game they give Xenonauts a high resolution look that is fairly unique amongst modern pixel art games.

raw_window.png

goldeneye64_archives.jpg

goldeneye64_archives2.jpg

kgb_hq.jpg

kgb_hq2.jpg

raw_window.png.b57e7a5a44fa763b647ec327b

goldeneye64_archives.jpg.b258e68af7b1843

goldeneye64_archives2.jpg.ee9ca8fb4de620

kgb_hq.jpg.1eac01cc033650aa957a1a80976aa

kgb_hq2.jpg.57192f51da2c5375262cd8a26657

Link to comment
Share on other sites

I told Aaron to write this update because he's producing TOO MANY tiles for me to keep up with on top of all my other jobs. Obviously he's replaced it with producing TOO MANY words for me to keep up with.

At least he's value for money.

EDIT - just to clarify, the 3D tiles are generally painted over by our 2D artist Remus, who does the props and the buildings. Mikael is our other 2D artist, who paints the ground tiles and the things connected with the ground (i.e. the cliffs and rocks and mesas you'll see in the next update).

Both have done very impressive work to get the game looking like it is inspired by the 1990s rather than from the 1990s.

Also, reading this article does remind me of all the technical challenges we had trying to get the units set up to render in perfect isometric setup (I invented a similar system for Maya, but we use multiple cameras and batch files for unit renders rather than Aaron's animated single-camera system). It's all faintly ludicrous now I think about it, but I've been doing it for so long that our convoluted workflows just feel normal :)

Link to comment
Share on other sites

StellarRat - they'd also have be be very talented 2D artists to be able to paint over their own tiles.
True, I suck. But, with enough trial and error I can muck my way through, it just takes me 10x as long as someone that actually is talented. Maybe I should cut off one of my ears, hmmm...
Link to comment
Share on other sites

You could easily add new tiles to the game.

They would look a little odd next to the current batch unless you could do the overpaint.

However if you were to do your own complete tileset that wouldn't be as big a problem.

If your new tiles didn't appear alongside the overpainted ones then the differences would be harder to spot.

Thanks for the write up Aaron, nice to get a bit of insight into the work you have to put in to get that Xenonauts look :)

Link to comment
Share on other sites

Thanks Aaron,

I use lightwave as a hobbyist for 3d modeling and rendering because I had Imagine on my ole amiga from a magazine cover disk and a friend said why dont you try this (Lightwave 3D) and I was hooked, its very interesting to read how a pro can produce a specific set of tiles especialy as you use my favorite tool 'extrude'

Nice work on the tiles so far I am looking forward to seeing them all in the final release.

Edited by MasterArmadillo
Link to comment
Share on other sites

NIce writup Aaron!

For the naming problem, did you investigate the Blender Python API? I just did a quick check and found this function:

http://www.blender.org/documentation/blender_python_api_2_64_5/bpy.ops.image.html?highlight=save#bpy.ops.image.save

I have only touched Blender a few times (not an artist, which is an understatement :)) and never used the API, but I believe that this kind of work is what it is intended for.

I guess the community would love to have access to these templates/scripts required to produce the 3D-tiles, if possible. Any chance of that happening?

Link to comment
Share on other sites

Thanks Aaron, its nice both to get an insight into the mapping and rendering process and also to see where you are going with the Soviet tileset. It is nice to see your thought processes in how you render the central building.

A colleague of mine recent visited Ashgabat, the capital of Turkmenistan. Talking to him about it, one of the stricking aspects of Soviet planned cities is their use of wide boulevards that you find in almost all soviet cities built in that era. ZZZ1010 captures this really well in his soviet street scene in the mapping (http://www.goldhawkinteractive.com/forums/showthread.php/1301-Maps). I think this could make for very interesting game play - wide open stretches (with trees, benches, cars) bordered by buildings, much denser than the western town tileset. Anyway, it is worth checking out zzz1010's thread.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...