Sunday, June 27, 2010

As the world turns

Each time after posting another crappy story on Sunday, I'll have a smoke and think about what to do next week. The nice thing about having "small" targets such as the upcoming "movie" (sounds more promising than it probably is) is that you can make a listing of concrete tasks. So, what's for dinner this week? I'm still not really happy with the clothing, but at least there is a foundation and a very useful importer tool now. But there is more than clothing.

When talking about engines, the first word most people probably come up with = graphics. But there is much more of course. Physics, AI and sound for example. But also “less spectacular” aspects such as GUI, menu’s, full-screen support, inventories, scripting and game logic. You won’t impress the crowd by telling that your engine supports easy-to-configure triggers or a highly programmable HUD. But if you want to go further than fancy shader showcases, these are very important components. A game engine without proper support for such things is like a beautiful girl without brains.

Still had to do some visual treatment though. A stupid old chair…? Hold on, it has a fur shader on the green cushion! It's a little bit too rough here, as if it was made from rigid yak fur, but that can be solved easily by making the "hair" shorter, mip-maps and/or fading out as the distance towards the camera grows.

One of the not-so-typical things to do is making a railing system. You know, when Steven Spielberg is shooting a movie, camera's and dinosaurs are mounted on rails and synchronized by perfect timing. In games, predefined rails can be useful for cinematic events as well. Or how about lifts, trains, robotics or anything else that has to follow a fixed path?

The engine already had a "railing" module. This is basically a set of nodes that are connected with each other. Between nodes there are connections that tell how fast to move, acceleration specs, barrel rolls, looking directions, and so on. It's also possible to (randomly) switch when a node is connected to multiple other nodes. Think about setting up roads in a game like GTA, where the CPU can decide whether to go left or right.

Still there were two issues. 1.) Who, what, when and where to rail? 2.) Setting up that rail is a horrible job, especially if you have lots of curves or when the object has to follow it extremely tightly. Don't want to derail trains India style of course. As for the second problem, I chose to make an importer. It worked pretty well for cloth, so why not defining a rail-line in Lightwave as well, where the vertices would be nodes? The engine has buttons and function to move entities such as these nodes, but honestly, why trying to beat the controls from a professional package such as Lightwave, 3DS Max, Maya, Blender or whatever you're using? The target is to make a game, not a superb modeler. In other words, plotting that path goes a whole lot easier in Lightwave. I'm using weightMaps to define additional info for the nodes such as speed and curving. It can still be adjusted afterwards though.

2 polygons and not a single more. I liked the furry velvet look in Super Mario Galaxy. And if the Wii can do it… With all the respect, but Miyamoto should had put some more mushrooms in the Wii hardware. Anyway, no shells or transparent layers for this furry look. I’m using “Steep Parallax Mapping”. An enhanced way of doing normalMapping. I wasn’t really interested in making my brick walls looking bumpy though. Just needed a furry look for that chair. By chance I came across this paper.
Steep Parallax Mapping
Besides parallax mapping and fur, it can also be used for straight short grass. Just a tip…

The other issue is the trigger that puts something on a rail. Trains don’t just drive automatically (at least I hope so). A guy with a moustache first has to hit the pedal. Hence, the whole train first needs to be placed on that rail to begin with. We would call that “spawning” in game nerd terms. To make a long story shorter; game events need to be triggered somehow. For example, unlock a door after killing 20 goblins. Or play Sepultura when opening the toilet door in sector X.

Such events are usually very specific. They depend on the game, your condition, the environment, and so on. You could code all of this into the engine but… that’s exactly NOT the point of an engine. Try to make a strict distinction between general purpose and game specific tasks. Which is why most developers go for scripting languages. No exception here, game rules, AI decision making, object interface, cinematics, and sector events are using Python scripts to get your dirty things done. For example, I could put that stinky chair on a rail when entering sector X for the first time while having a shoe-horn in my inventory.

Again that chair? Sorry, I didn’t have much other furry friends to show so far. About the shader, the result of the marching loop is a height factor that can be used to give an offset to your texture coordinates. I’m using this height as a texture coordinate for a small lookup texture that gives a shade value (height ~0 = bottom = dark, or sand for grass. Height ~1 is tall = bright).

As for that movie, I need some scripted events as well. To make life easier, there is “Cinematic Script” in the engine. Basically this is a set of one or more timelines with scriptcode. Just like in all other scripts, we could use it to spawn objects, put shit on a rail, play sounds, and so on. But also interactive events like making the player bash a button to stop his head being chopped off by an angry chainsaw zombie. Cinematics does not necessarily mean that you lose control over the player. You are the puppeteer, script whatever you want.
- 02:40 Ridge comes in to tell Barbara that he was cheating with her dog.
- 03:10 Barbara cries and shouts "how could you, after all we went through together"?
- 03:13 Ridge tells it was Forester and Brooke who made him doing this
- 03:42 Barbara's dog comes home after work and decides to play open cards, he is pregnant.
- 03:43 Pregnant from Barbara's step-parrot
- 04:10 Claudia storms in to announce she will marry for the 7th time with Andy
- 04:46 The phone rings, Andy died in an ufo accident
- 05:00 Title screen "next time in As the turd turn"

Sunday, June 20, 2010

Let the games begin

Yer all watching the game? Football I mean? I'm not a big football fan (or from any other sport), but I like the vibe a festivity like this brings. Good excuse to visit the bar on a normal working day, eating "bitterballen" with mustard, watching grown up men acting like idiots, and of course criticizing our football players while most of us are already tired after a 10 meter sprint. Luckily Holland is still in the game for the next rounds, so we don't have to miss the orange flags and silly collectors garbage from the supermarkets yet.

Kinda funny an event like this shakes up the whole planet. After all, it's just a game right? Oh well, guess we all like games. Why else would I try to program one? I used to play videogames quite a lot in the past, but lately I only start the console or PC sporadically. Probably because 75% of my free time goes into this project, but there is also something else going on. I bought Mario Galaxy 2 one week ago, which is a great game. But still, the magic is a little bit gone. I don't blame Nintendo, it's just my mindset. I'm getting old and boring, my fantasy is getting rusty, and I just can't get that fanatic anymore (which is why I wonder about grown up men fighting each other for a game of football).

Games just don't suck me in that much anymore. I really wish I could switch over to my younger years when playing Mario, GTA, Zelda or anything else. But hey, you can't stop that process. Let's water the flowers and knit a nice warm trouser for my grandson.

Proudly represented, or something

When I DO play games, it's typical that I prefer the older ones. Red Alert, Doom2, Farcry, or even Crusader no Remorse. For some reason, they have a higher "fun factor" if you ask me. Nostalgia plays a big role of course, because it’s reminding me to times where I really enjoyed that game. But maybe old games were actually more fun as well…? I don't know. But I must say there are some "shortcomings" when it comes to gameplay nowadays.

While old games were often difficult (and frustrating, tortured my SNES controllers many times), games these days are often short and simple.. -accessible-. In games like Metroid for the SNES you had to figure out everything yourself. But now you have a GPS navigator and a personal assistant that leads you through as if you were retarded. Clues to puzzles are more obvious, and especially the “quick-save & load” takes away lots of the suspense in my opinion. In Mario 1, you had to restart the entire f#cking game if you got hit by Bowsers fireball in level 8. No wonder these final boss battles were bloody tense and joysticks would fly around after failing (it was always the controllers fault, it didn’t jump). In Call of Duty, -supposed to be a tense and somewhat realistic game-, you can get killed 16 times per minute. Press a key to jump in the action again. It doesn’t matter if you snipe, throw grenades or kill that Taliban with your helmet. Just keep loading and you’ll pass sooner or later anyway.

Thanks to cheating cpu in Mario Kart, impossible jumps in Mario 3 and terrible games like Adventure Island I was patient enough to finally get that !@#$@# curtain working. Sort of...Normals aren't 100% correct.

I know why that is. Kids these days are being said to have a shorter attention span. Or do simple games like these actually make them impatient?? I'm a very patient person, almost never stressed... Maybe because I had to manage my anger and kept trying after Donkey Kong fell in the ravine 30 times in a row. Anyhow, not only the difficulty, but also other aspects of games seem a little bit too polished for me nowadays. Like Hollywood movies, everything is based on proven commercial ingredients. Make a juicy engine with good graphics, 10 hours gameplay, gas-masked opponents that chatter lots of bullshit instructions that makes them sound intelligent, bullet-time action. And as for the hero; a silent stubbled man that drinks black coffee while reloading his shotgun. By the way, his family got killed in an “accident”…

Not all games are like that, but still I think developers experimented more in the past. Resulting in a range from terrible products to unique jewels. I have a feeling that the average quality is better these days, but I'm missing the outliers. Almost as if they are ashamed to put in some new/unique/risky elements. Even the music in games is kind of bland(except GTA maybe). While we were rocking and bouncing in Castlevania, Carmageddon, Crusader, or Command & Conquor, games play it safe these days with classical ambient, mediate rock or jungle drums when the bullets start flying, or just plain silence to keep it serious.

This picture has nothing to do with this story, but I had to post something. Keep reading.

There is a reason for everything. Games have become a million dollar business. Selling rates have become more important than creating an unique product. A good example might be Resident Evil. Although I really like the last two releases, I'm missing the original style. RE1 was a scary and tactical game. 4 and 5 are just shooters that feel very comfortable. The reason why they switched over is obvious: 95% of the positional buyers probably doesn't like the difficult controls, fixed camera's, slow paced action, back-tracing, and difficult puzzles. Resident Evil 4 & 5 are excellent products, but how about the fans of the original? There is not really a substitute  a died out genre, because it didn’t sell.

I might be restricted by money, skills and time, but at least there are no deadlines or persons telling me what to do for this game. Rather than for the money, it’s the passion that drives to make this game. If it would ever see daylight, I doubt if it will be swallowed by the “mainstream” as well, as it’s going to be a pretty different game. Then again, movies like “Reservoir Dogs” or “No country for old man” were pretty different as well… Well, I should be already happy if I could even get near finishing this whole thing. Sorry I didn't produce much visual results this week, but there is definitely work in progress.

Clean sheets son? As for the technical portion this week, I chose to import the clothobjects from a Lightwave file, rather than building grids and defining attachment points in the editor. I can just make any shape in Lightwave, and call it “cloth”. Attachment points are defined with weightMaps.

Since arbitrary shapes are allowed now, I had to change a few things. The constraints with neighbor particles can vary for each vertex. So I pass the lookup coordinates and distances from the neighbor particles inside the vertex data.

Next step; attaching to dynamic bodies. If you wonder why I’m wasting so much time on those damn sheets… One of the characters in the movie doesn’t want to appear naked..

Sunday, June 13, 2010

Stop! Dinnertime!

When I was writing about concept-art last week, I was searching my ass off for one particular picture that actually gives a slight idea how enemies may look like in Tower 22. Years ago, a friend (the same guy from the flat concept) made a clay model for "this" project. Well, the project was based on a totally different story and engine, but plans to make a horror game were already there. Luckily he had a back-up, so here it is:

Claymodel and sketch were done by my friend. Kinda feel like claying now…
Instead of brute, strong, muscular, bloody, angry, mechanical, hellish monsters, we were more aiming for...[looking for a proper word on a Dutch-to-English translator]...malformed humanoids. You don't really know whether to be scared or feel sorry for it. Well, Tower 22 should have somewhat similar foes. And not just because they're cool. They actually fit in the storyline. And no, this is not a result of biological experiments by evil doctors. Although the first ideas for the project where these pictures came from were actually a little bit based on cold war + abandon lab. But I realized that has been done dozens of times before, so the story and environment have become radically different. It's hard to tell what this new story exactly is, because it's the type of game where you start off with knowing nothing until you finish the game. Many of the why's and how's may already spoil the clue. I'll have to carefully pick my words about that.

Either way, guys like this one share the building with you. And since you don't have a BFG9000 or full automatic M60's to clear the path, you'd better watch your back while mobbing the corridor floors... That should give a slight idea of what the game should feel like.

But enough about that, I was aiming for a little movie right? I wasted almost 2 weeks on those stupid curtains (cloth FX, see 2 posts earlier). In my little test-app, it worked great, but in the engine the curtains would deform to a polygon massacre. First the UV coordinates were wrong again due a shader compiler option I inserted 3 years ago. Later on the gravity was basically pulling harder than the spring constraints that keep the material together --> making an infinite stretch. Couldn't figure out why, until I realized the relative low framerate(30..60) was causing this.

You know, physics don't like low framerates, especially not when they are varying as well. So I could do two things: do 100 iterations(corrections) to get it right. Or fake a fast framerate. I chose the second option. Don't want to give up too much performance for a stupid piece of cotton. The end result isn't even that bad. Instead of ultrafine cotton that slips through your fingers, the curtain now moves more like an old dusty patch that has been peed by 200 cats over the years. That's what I call realism. Still, I’ll have to fix some bugs and make a system to hang those curtains / cloth into the world in an user-friendly manner. A "Granny's Attlier" panel in the editor.

Got to fix the tablecloth shader. It's 100% cotton, but it looks more like a piece of rubber stolen from a SM dungeon somewhere...

But hey, what’s that? Thought cloth didn't work?! No, but LightWave does. What you’re looking at is a pre-baked model. For lazy (or bad) modelers like me, you can just create a subdivided plane and let it drop onto the table. Lightwave will do the whole simulation, and you’ll just lay back and watch. Once you're happy, save the result back into a model.
Lightwave Cloth Manual
Little youtube movie
Well that sounds easier than it was. I spend the whole weekend figuring out how it exactly worked, and adjusting parameters. Besides, the simulation runs f*cking slow. Hit the run button, wait 5 minutes, and then hopefully the tablecloth didn’t curl up or fall through the table. I doubt if my engine does it better, but deffinetly a lot faster.

Another problem was the polygon count. The tablecloth in the Lightwave simulation had about 100.000 polygons. That's a little bit too much for a (not-so-important) ingame object, don't you think? So I dug into some plugins to reduce the polygon count. And since I didn’t want to lose the small details from the high-poly tablecloth, I found another handy tool that generates normalMaps by looking at the differences between the high- and low detailed model.
Lightwave plugin to reduce polygon count (WITHOUT loosing UV coordinates!)
Lightwave plugin to generate a normalMap by comparing hi- and low-res model

Holy shit, are those REAL animated sprites on those candles?! Bet ye are. They even distort and blur the background (a little bit too much). After all those many effects, a simple animated flame wasn’t supported by the available shaders yet.

The result is a not so spectacular table, but at least we learned some new tricks and got hands on some crucial tools if you’re into LOD or bumpmapping with Lightwave. Furthermore I programmed some “motors” to make things move this week, but let’s keep that for another time. Yet, there is still one last thing I’d like to report; if your Wii is gathering dust, do yourself a favor and check out Mario Galaxy 2. Yahoo! Our daughter must be wondering what’s wrong with daddy, happy as an eight-year old.

Sunday, June 6, 2010

Concept Art

Don't want to sound lazy, but I didn't produce much (visual) results again this week. I got home from work at 01:00 night a few days, and on top I'll had to draw a poster for my uncle who was celebrating his 60th birthday last Saturday. Drawing posters? Yeh, I'm not an artist but once in a while I'll draw a ‘famous’ head as a birthday present for friends. So far we had:
- Sadam Hussain --> In one of his better days
- Chuck Norris --> Worlds strongest man, end of discussion.
- Steven Seagal --> The man who breaks your arm 90 degrees
- Henry Rollins --> I am a liar!
- Terminator 1 --> On his motor with shotgun, but with a dog's head
- That goofy truck from the movie Cars (for my little nephew of course)
- Paul Teutul --> The old grumpy motor guy with hydraulic oiled muscles
- B.A. Baracus --> I ain’t get no plane fool!
- Micheal Jackson --> The zombie from Thriller
- Jan Peter Balkenende --> Our cool looking prime minister)
- David Hasselhoff --> Including lots of 80’s breast hair
- Peter North --> Admit it, you know what guy I'm talking about.
- Duke Nukem

And in the past I used to draw monsters and stuff sometimes. Visitor Kyle probably knows this Prey character. I liked the concept art, so I made a copy on paper with ink & pastel.

Pastel drawing. Original was concept art from Human Head Studio's, Prey

The dog of one of my friends used to drive around with a shotgun

Not that bad, isn't it? Shame my skills on a computer aren't that good. But it brings me to an interesting topic though; Concept Art. Most games start with a scratch somewhere. What the hell were they thinking when a fat mustached red plumber was drawn on paper?

Concept(art) is important. For fans, it's like the aperitif you'll get in a restaurant. For the developers themselves artwork helps them on their way. Instead of modeling an expensive 3D character right away, they first make 10 different sketches to see which one is the coolest. Or to discard the idea if none of the sketches really impresses. It's a common way to work for games, designs, movies, and so on.

So, how about "Tower 22 concept art"? Uhmm... I have that game-document I wrote about in an earlier post. And lot's of Soviet flat photographs. But except from schematics and maps, there aren't really pretty pics so far. Shame, come to think of it. But then again, making art takes time as well. And it's darn difficult to come up with good stuff. Horrific stuff in this case.

Original from a Quake 4 drawing contest. Can't recall the original creator

There are actually a few Tower 22 concept drawings. Here's one of the first quickies, made by a friend. It's not really Soviet, but it shows a huge ugly building nevertheless. Visit for better design work.

Sometimes concept-art kick's ass, but too often I'm looking at angry Orcs or double D bitches with blades bigger than themselves. World of Warcraft rip-offs. I'm trying to stay away from that. If I'll draw something, it better be good. To be honest, I’d rather wait for someone who really masters the pencil to draw characters or environments, otherwise I’ll might embarrass myself. The drawings above aren't that bad, but they're all copies of existing photo's/characters.

Anyhow, you haven't seen a monster yet (except that big ugly bag of polygons), but they should play a major role in Tower22. Unlike Doom3 where you kill complete Hellish battalions, there are only a few monsters that will return through the entire game; they will be the stars of the show. In other words, they’ll have to be really damn scary/bizarre and imposing. Otherwise it’ll be like watching Terminator with Jim Carrey as the T100.

Sometimes I'll let my fantasy on the loose just before falling asleep. As you go “hibernate modus”, bizarre creations sometimes might fly by. But usually it’s already too late to reach the sketchbook and put down your ideas into detail. Sweet dreams. What I need a sick fucking bastard that produces such images inside his head on the fly all day. Nevertheless, this might be one of the most difficult challenges as for the game design. There are plenty of fictional characters, but only a few have the X-factor. If you ask me…
- Mario & Luigi Simple.
- Mother Brain Super metroid. SNES. Epic end-boss battle.
- Mancubus & Cyberdemon Doom2. Did you know Cyberdemon can kill entire level 8?
- Tyrant Resident Evil Remake. Cool cinematics.
- Tank Quake 2. 100 tons of sluggish metal & servo’s.
- Duke Nukem Don’t have time to play with myself.
- Snake (the old one) Metal Gear Solid. Because he’s old, and he smokes.
- Sack boy Little Big Planet. Want to squeeze him.
- G-Man Halflife 2. But who is it?

And probably I forgot a few. Guess I like the monster design from iD software in particular. And what are your favorites?

Damn I'm looking good.