Archives by Day

August 2018

UFO: Aftermath

Platform(s): Arcade, Game Boy Advance, GameCube, Nintendo DS, PC, PSOne, PSP, PlayStation 2, PlayStation 3, Wii, Xbox, Xbox 360
Genre: Strategy

About Rainier

PC gamer, WorthPlaying EIC, globe-trotting couch potato, patriot, '80s headbanger, movie watcher, music lover, foodie and man in black -- squirrel!


'UFO: Aftermath' - Developer Diary Part 1

by Rainier on March 26, 2002 @ 10:55 a.m. PST

Memoirs: In the beginning, there was a void...

In May 2001 we finished Original War. There are many stories about the crunch time and all of them are true. Original War was very special to us - it was our first major project - and at times we almost lost any hope of ever completing it. But then, you have to go on, even without hope, and this we did and actually sent the gold CDs to our publisher.

Cut to the empty office, one month later. The developers are trickling in. People are actually starting to speak to each other again. It was in this period of void when our producer at Virgin, Paul Whipp, first called me with a tantalising prospect of taking over unnamed but "very big" project. I expressed polite curiosity. And then it hit me: The Dreamland Chronicles: Freedom Ridge. The spiritual successor to X-COM. "Your attention to detail with your love of strategic games. It is perfect," said Paul.

Still we hesitated. Should we be finishing someone else's game? Isn't it too small a task? Or too big? Several things went for the "Yes" vote - the honour, the place in spotlight, the opportunity, the challenge; and at the same time the practical issues - here was the project, already sold to the publisher, the only thing that needs to be done is to sign the contract, and we can get to work. So we said yes, and never have been sorry for it.

Diary: Building a city

Last week we were to send a regular monthly milestone to our publisher. This one was very much anticipated as it should finally show how the game is really going to look like in the tactical mission (so far we used a only a flat, top-down, 2D view to simulate the tactical gameplay).

And really, there came one of those rare moments when several hitherto unrelated pieces fall into place, when untold doubts and reassurances are squashed a verified. To understand what is it really about, I need to get little bit technical.

UFO: Aftermath features random missions that can take place all over the world. The player sees about half a dozen icons over the globe, he clicks one and he enters the mission. A "Loading mission... Please wait..." screen pops up and some silly animation is played. The computer meanwhile works like hell - it takes into account the current strategic situation, the type of mission, the position of the spot, the time of the year and day and assembles the landscape and populates it with enemies. Then it has to sort it, build BSP trees, calculate lightmaps, create container objects, and other nifty things. Now, for your average 3D game, you have a level editor and it does this kind of thing and it takes it a couple of hours. How long are you going to wait before the mission loads?

Of course, you cannot have the pie and eat the pie. You cannot build completely general terrain with the level of visual quality we are now used to in 30 seconds. You must sacrifice some generality in exchange for speed. The question is where to draw a line.

We decided - for the city-based missions - to create several buildings for each region of the world, split them into basic elements, one or two squares wide (one square is three feet) and combine them to create streets. We would have some sort of editor or catalogue, that would load all the existing elements for one region (and there are hundreds of them) and a designer would then create a set of rules for each - this bit goes with that bit, can be repeated only twice, must be at least five squares from a corner, this sort of things.

But when we built the first scene the result was, well, disappointing - in the true sense of that word: we were disappointed because we didn't see something we expected to see. The 3D landscapes rarely look well - the limits on polygon count, texture memory and also on the amount of work allowed and allocated to them - they all combine to make them look quite bland. But our landscape looked even blander, with uniform lighting the repeated textures stand out even more than usual.

Do you know what is a lightmap? (If you do, skip this paragraph) When you create, say, a pyramid in 3D, you do a model (for simple pyramid, this would be four triangles). Then you add texture. The pyramid is pretty much the same from all sides, so you could easily use the same texture on all four sides - this would save you precious video RAM. But now the model will look the same from all sides and this would be both ugly and un-realistic. In reality, even a very homogeneous object has lighter and darker spots - because the incident light is usually non-homogeneous. Now you have two options: you can either use hardware lights - you tell the card that there is a light at coordinates this and this, pointing that way, with this colour, etc., and it will light the scene for you - or you can use lightmap - this is in effect another texture, applied over the first one. The point is that it is only greyscale (it only lightens or darkens the underlying texture) and can have much lower resolution (the card will blur it and you will get the nice soft transitions), so you still save memory. The lightmaps are generally a preferred solution: the hardware lights are limited in number and they can be used for better purposes.

So it was becoming clear we would have to have pre-calculated lightmaps and other options had to be considered. Now, the game is going to have about a hundred missions (at the longest setting). Say, a third of them are going to take place in city. This is about thirty cities. There are say five big cultural areas with unique architecture, so at worst it is 5 x 30 = 150 cities. More realistically, about a hundred, because it is very unlikely that all city missions are going to place in the same region. So why just not build a hundred city levels and put them on CD? This would be a total sacrifice of versatility for the sake of prettiness, but does anybody care? Majority of the players never finish games they start to play, let alone replay them.

But developers have their pride, too. We want to be able to say "endless possibilities" and we all know that "endless" means at least three hundred. So a compromise was made. The designers will use the small segments to build what we call "blocks": it may be one building, or several, surrounded by streets or open area. Each block will be individually lighted and the lightmap pre-calculated and saved. The city level will then be created by combining the blocks. With a hundred blocks per region, and an average level size 5 x 5 blocks, we have 242,519,269,720,337,121,015,504 permutations. Even with a large margin of error, this is endless enough for me (there is subtle error in this reasoning, can you spot it?).

So after this long digression, I get back to the magic moment when we loaded the first block-composed level and yes, it worked! It looked nice! Granted, there are still errors, there are holes where there should be none, some normals are reversed, but it is there, the atmosphere, the creepy, nasty feeling of the world deserted and betrayed, the aura of danger, moving shadows just on the border of your field of vision.

I am getting little bit carried away; and already belying my promise of impartiality, so probably it is time to stop.

Looking forward to meeting you in the next instalment!

More articles about UFO: Aftermath
blog comments powered by Disqus