Sunday, March 28, 2010

Groovy sound bytes

Another week wasted. No poop for me this time though, Nah, this weeks turn was for our little daughter. The doctor sais she has an ear infection (again), but so far the antibiotics aren't really working, and she has a serious ugly cough. As if she smoked cigars for 16 years. Problem is that she can't really tell what's going on yet. One hour she is happily destroying the house as usual, 10 minutes later she sits there as a zombie, throwing up on daddy's new shirt.

So, I spend a few days at home. And while she was asleep I still got a chance to research a few things. Maybe one of the reasons many game-programmers are always focusing on the visuals is because they are, well, pressentable. If you want to impress or motivate yourself, create some new shaders or 3D maps and capture a screenshot. However, many game aspects are invisible techniques. Enemy AI, path-finding algorithms, entity structures, editors, scripting, and how about sound?

So, this week I can't really show you something again. But I found quite interesting stuff about sound. So far, sound was just a matter of playing .WAV files or streaming some music. Later on OpenAL added 3D sound to my engine, including some cool reverb ("EAX") effects like firing a shotgun in a sewerpipe or underwater. But there is more than that. Managing the many sound resources in the limited memory is a challenge. And how about 'true' 3D sound? Did you ever notice the noise dims when you close a door?

As you may have noticed, most parts of the game will be indoor. Meaning there will be a lot of occlusion by walls, doors, and thick ceilings. Basic 3D roll-off calculations like OpenAL offer are not enough to get a realistic soundbyte. It matters a whole lot if you shout in the open-air or inside a closed complex. Not only for you as a listener; also enemies who use their ears to detect threats.

I'm pretty sure OpenAL can be tweaked to do this kind of stuff, but I also had a look at FMOD this week, another Sound API used in commercial games, including Crysis. Commercial usage requires a license, but you can still download the full thing, including a handy tool called "Designer". So far I always had to create my own editor for defining sounds, properties, channels and so on. Possibly that was a waste of time, because Designer offers a nice toolset and testing environment to create a sound library.

Besides that, FMOD has functions to setup a 3D world-mesh to do the occlusion I discussed earlier. Too bad it doesn't have functions to test if AI enemies can hear you as well at a certain position, so I still have to figure something out. We don't want the enemies to cheat by hearing your squeezy farts through a 6 meter concrete wall of course. But nevertheless, I'm impressed by FMOD. In fact, I'm creating a wrapper DLL right now. Time to finish, I hear cigar coughs...

Sunday, March 21, 2010


Not much productivity again this week. I thought my toilet adventures were over, but the shit still hits the fan, literally! And after almost exploding a few times last week, another parasite infected me: "Vista Security Tool 2010". Spend the whole damn weekend fixing my laptop. I hope the creator of that thing gets a real Ebola virus for wasting my, oops, F#ck!ing time.

I didn't had any viruses last ~9 years (neeeeeever visited any dirty sites, I pizza-promise), but all of a sudden a typical Windows Vista screen was popping up and showing several severe virusses. Thanks for reporting, now fix it will you? "In order to protect your computer, you must purchase Windows Security Tool". Purchase? Fuck you. But the virus warnings kept coming, and that annoying "Security Tool" kept prompting me to buy it. I got suspicious. Microsoft certainly knows how to earn money, but not this way. Of course, my other guards were playing poker and didn't notice anything. Anti-Vir couldn't detect any virus, Ad-Aware didn't even start. Thanks for nothing.

Turned out that the virus warnings are fake, BUT that "Vista Security Tool" itself is a very real threat. CPU was busy 100% all the time, continous (fake) warnings, no internet access, and even a few blue screens. Extremely annoying. I managed to download Spyhunter and Spyware Docter. But of course, these assholes also first detect and then ask money before you can fix anything. Finally a potion of Spybot free), Anti-Malware, and CrapCleaner(what a coincidence) seemed to kill the threat. If you are pulling your hair out for the same symptoms, check this out:

I can't leave you with empty hands again, so I did manage to produce some pretty nice
screenshost this week, if I may see so. I moved to another test apartment with a better view on my Soviet style city. The textures are stolen from Halflife2, but I think it's a pretty good job for someone who is A: not a modeller or architect. B: not a texture artist. C: has diarrhea.

Programming progress is hidden in the small details. The roof antenna's and foliage on the balcony are transparent surfaces with double-sided lighting and can also cast shadows and scatter the lightrays now. Whoopie.

Sunday, March 14, 2010


Hmm, nothing fancy to report this week. I spend most of my precious time on the toilet this week. Too much jalapeenos or something. And fixed a few software bugs that were at least as annoying as my endless sanitary visit. Just one of those weeks where nothing works well.

I did some stuff on paper though; map design. At some point you need to proceed and create some actual game-content, or at least a prototype of it. Making a single good looking, isolated test-map is pretty easy. But how the hell to create a complete world that should cover hours of solid gameplay? Games are for little kids, bla bla, but the design process is at least as complicated as writing a book or moviescript. Not only the technical part. Choosing fascinating scenes (filmset), making up a game idea that is enjoyable (plot/genre), writing a smart story (script), using cool characters (actors), supportive graphics, sound and music, and so on.

That's why most games (and movies) copy proven concepts from each other. For example, it turned out that 2 hands in front of a camera, a shotgun, and a bunch of demons or chattering soldiers is a guarantee for success. But what if you're trying something new? Not that every single piece I had in mind has never been done before, but there is not much reference when it comes to some of the key gameplay elements, and neither for the environment. When making a map, you deal with lots of factors at the same time. Especially when doing an adventure/puzzle game like Zelda, Metroid or Resident Evil (earlier versions). To give you an idea:

- Not too small, not too big
When I buy a game, I'd like to be entertained for ~12 hours, AT LEAST. Games tend to get shorter and easier though. Developers get lazy, and/or games are targetted for the "casual gamer" (bleh) instead of hardcore Japanese who can finish Super Metroid within 20 minutes while doing a sushi contest. But yet another reason, making high quality content has become a lot harder. 30 years ago a hobbyist could draw Pac-Man out of 6 pixels on a sunday evening. These days each model, map, sound effect or texture is a piece of art on its own.

In some cases the player needs to feel attached to the maps as well. To give you that "honey, I'm home" feeling (Zelda villages). Or in case of a horror game, to provide the player with (false) knowledge of the environment. Fear often lies in the knowledge something bad may happen, rather than the graphic scenes them selves. However, the bigger the maps, the less knowledge the player has about the individual locations. Bigger is not always better.

- Let the maps Serve your type of gameplay
When making an action shooter, you need obstacles, objects to take cover, and eventually multiple routes to assault the enemy. When making Super Mario, you need platforms, pits and plumbing pipes. A race game requires a curvy circuit. If you don't, the gameplay will fail, completely.

- Serve the story / set the athmosphere
When the story plays an important role, the maps will need to support that as well of course. Resident Evil cannot do without the scary underground labs. And what would Star Wars be without the wild variation of planets?

- Please the eye
As you may have noticed, this game will take place in a skyscraper. But making 100 levels made of appartments, elevators and corridors is... boring. Make sure there is enough variation and "wows!" to drag the player through the game. Screenshots of dusty corridors alone won't attract anyone.

- Respect the theme
At the same time, stay close enough with the main theme. You don't want Star Destroyers in cowboy games. Silent Hill is scary, Metroid is a lonely sci-fi adventure, Zelda feels like a fairy tail, WO II: "Battle of the Bulge" is about... WO II, Battle of the Bulge. And guess what "Need for Speed is all about". Mixing up just any idea you may have is not going to work. Keep consistent. Sounds logical, but at the design phase you often get biased on ideas that may not really fit in the story.

- Horrific
As for our horror theme, well, it needs to keep you feel unpleasant all the time. Resident Evil 5 is a fun game, but I won't call it horror anymore. Zombies on motorcycles with rocket launchers? Come on. And how many scary movies have there been made the last 10 years anyway? In fact there were 2 or 3 "Scary Movies", but let's forget those quickly. Making someone feel truly scared is maybe even more difficult than making someone cry or laugh his pants off. The game maps needs to build constant tension. But one wrong decision can break this feeling. Just making a bloody stinky map doesn't work for long either. Humans quickly adapt to the situation you know.

- Make it smart
Just like in Metroid or Zelda, this game has puzzle elements and backtracing. Find a grapple beam on one side of the world, use it on the other side. The placement of items, locked doors and hidden sections must be done with great care. In some games the puzzles or secret sections are too obvious, resulting in an easy, not challenging game. At the same time, make sure backtracing doesn't get annoying. Make sure the already visited area's will keep surprising by introducing new stuff or allowing you to use your new abilities / items each time you return.

- Spread the butter
When drawing your first map, be carefull not to put all the cream here already, or you will run out of ammo soon. People don't like movies that start spectacular and then fall back long-winded. Create a couple of climaxes and let the game/maps bring you there smoothly.

Well, imagine to keep all those factors in mind at the same time, then draw a map... Good luck! Allright, another long post finished. I didn't have new graphical content, so here's a screenshot from my earlier engine. The shot is more than 3 years old, but still a nice one.

Saturday, March 6, 2010

From dusk till dawn

Everyone has his memories. Christmas, first girlfriend, being drunk and puking pizza's over a car for the first time. Happy joy joy. As for game memoires, Zelda: Occarina of Time (N64) was one of those milestones. It's not my favourite of all Zelda's, but it sure brought loads of beautiness at that time. Asides from the usual Zelda magic and the fact it was the first 3D release, being able to walk free in a "big" open world was epic. This is what 3D was supposed to be. Not only freedom on the XYZ axis, but also freedom in the things you do. This was one of the first games that didn't push you through. You could take a break and enjoy the sight at the Lon Lon Farm with a bottle of milk.

One of the effects that made my mouth fall open was the day / night cycle. Those days I didn't had internet articles spoiling all game details before even buying it, so it was a big surprise when the sun suddenly arised after my first night stroll on the Hyrule fields. I didn't believe my eyes... Did this game had a realtime clock? Yes, and not only that, the environment was dynamic. It could also start raining or thunderstorming at a random moment. People would go in and lights inside houses went on at night. I spent lots of time just visiting the villages at different settings to check how it would look and feel.

Damn, I really whish I could experience such a "Wow!" feeling again. These days games do not really surprise anymore. Not even the almost photorealistic sunrises at the beach in Crysis. Been there, done that. I'd like to see it again in Virtual Reality maybe, but I guess that still takes a while.

Yet, day/night cycles or dynamic weather aren't used that much. Of course, GTA and Zelda have them. The Sims a little bit, although somewhat poorly done (buy expansion pack #1234). Crysis can do it, but does not have the clock running by default. There are two reasons I can think of why not doing it. A:) Not needed / desired. If you want a night mission, it shouldn't go daytime after 5 minutes. B:) Technically not possible... due static ambient lighting / lightMaps. Graphics fine-tuned on a single setting.

Like discussed in an earlier post, having dynamic light is not so easy. Outdoor area's such as the Crysis jungles or GTA cities have somewhat predictable lighting(sun, duh). Indoor scenes on the other hand often have a more complex setting that is difficult to compute. Rendering the sky and clouds is difficult enough already, but doing the lighting properly might be even more of a challenge. Still, I think a day / night cycle can add value in my game. In fact, you're looking at it on these shots. There are no clouds yet, but the sky changes, stars fade in, overall contrast/brightness is adjusted, fog changes and a light-scatter effect is applied on the sun. Too bad the view outside is dull with those 2 ugly buildings. But imagine what you can do with forests or a city skyline...

It's not only about the visuals though. Watching the clock will be an important aspect in this game... And since 90% of the horror games/movies are always at night, this might give some variation. One of the reasons that makes me curious about Alan Wake. And the only somewhat scary scenes of Resident Evil 4 were at daytime, just because it gave an eerie surrueal feeling. In other words, this game won't be dark with thunders on the background all the time.