Sunday, November 27, 2011

The finishing garbage detail

Programmers sometimes say games aren't about graphics. Maybe we just tell that to mask our graphical-incompetency’s. But since many gamers also seem to prefer fun above slick graphics, there must be some truth in it of course. Nevertheless, graphics fetishists like me always start a game or engine with trying to make it look as good as possible. New shader here, yet another rendering technique there. And once we're happy and proud of ourselves, we find a new paper or another @#$^! engine ruins the vibe by showing a much better looking approach. We spend so much time on catching up with the graphics and polishing things that we almost forget about other aspects such as... making a fun, playable game. Jesus, we're like women dressing & stressing up in front of the mirror for hours before going to a party.

Obsessions are usually not a very good thing, then again I don't agree that graphics aren’t important. Zelda Skyward Sword is, of course, on my December presents listing. Zelda is always welcome, especially with Christmas. But I can't deny that the outdated Wii graphics are becoming a royal pain in the ass. Nintendo games have never been photorealistic highlights, nor they should. But the first 3D Zelda Occarina of Time looked awesome nevertheless. A day & night cycle, (pre-rendered) photo-like backgrounds, fresh water, an open world. It was the perfect transition between the 2D and 3D era. ~5 yeras later, the Gamecube Zelda Windwaker title looked like a quality Walt Disney cartoon. Not photorealism, but still a visual treat, even between the advancing tech used in contemporaries such as Halflife2 or F.E.A.R. And then the Twilight Princess arrived end 2006... The bright blooming tried to mask the Wii hardware that was dated already before it came out. For me, the result was a dark, grainy, empty, dead world. Zelda isn't about graphics, but while others in the series sucked me in by showing a magical, sometimes weird, but yet cozy "check-me-out!" world, the grim TP world felt cold.

And now the turn goes to Zelda Skyward Sword. Didn’t play it yet, but I must say it looks more colorful, and therefore more atmospheric & interesting to me. But still... those jagged non-anti-aliased edges are like razorblades in the eyes. The characters + facial expressions look like 1999 fruit with a face painted on it. And the lack of lighting compensated by lot’s of bright weird colored textures, looks as if your mom washed your underpants together with a whole rainbow. Sometimes tasteful, other times chaotic and messy. Yes, graphics do count, because immersion counts. Well, let's just hope Skyward Sword does what Zelda does best: delivering puzzles, a fantastic world, and an unique experiences. Although it’s going to be difficult to please this old nitpicker who played the same formula since the SNES already :p

Zelda: Windwakerl; not a technical highlight, but a piece of art nevertheless.

More important in our case, how could T22 be scary if it looks like pixel-blubber? The scary moments will turn out in disappointing anti-climaxes if the enemy turns out to be a Doom2 sprite, or a pile of boxes? Now Silent Hill looks like foggy shit as well, but least it's a consistent whole of foggy shit. Keep in mind that graphics is not only about awesome shaders, realtime lighting, big Hollywood blasts or photo-realistic water. From a programmer perspective, I'm inclined to say a proper graphical engine makes the graphics hot-or-not. But how come that games like Resident Evil 4 (Gamecube / PS2) still looks good even without tons of effects? And how come that custom made maps in UDK, Source or CryEngine often don't look good at all? Exactly, don't underestimate the power of art(ists). The better they master their(your) tools and engine-tricks, the better results they can make. Even with a limited technical toolkit eventually.

When looking at our Radar Station that is going to be used for the next tech-demo, I'm not 100% happy with it. Of course, when seeing the same stuff over and over again for the past 10 weeks, you become tired of your own creations. And as a programmer, my focus goes to the graphical bugs and shortcomings instead of the good parts. Normals inverted. Texture missing. Lamp looks like poop. Parallax effect not good enough, bleh. While a normal viewer may not even notice it. But also a non-technical person can probably tell the screenshots are not quite yet “A++ quality”.

Outsiders, but also meself are often making the same "mistake". And if you're a hobby game/graphics-programmer, you're probably guilty too. The mistake of comparing your (unfinished) results with commercial games you just played, or (Photoshopped) screenshots from super-engines. It's good to put high standards, but give yourself a break! 4 hours in the evening versus 50 hours-in-a-week work times. Two-and-a-half artist versus the 101th Airborne 3D-nerd battalion. A null euro budget versus a X(-hundred)-million euro budget. Even if you master the code, you still lack manpower to create comparable results. Unless you’re blessed with plenty of talented volunteers to help you out of course :)

A brilliant engine still doesn't make good looking 14k meshes + textures for you... Sergi spend quiet some time on his newest invention shown above!


I'm writing about this (again) because I was looking at some details while playing the PS3 Uncharted 2 demo. And at the same time I was figuring how to improve the Radar Station in these last weeks. Maybe check some enhanced parallax shaders, add some more secondary detail textures on the concrete maybe... I'd say our Radar Station looks pretty good, but something is missing... Then when looking at Uncharted 2, I noticed the individual textures, objects or shading-tricks (such as reflections or shadows) weren't that spectacular either. Nope. What really makes their environments look alive and realistic, is the high amount of "stuff" stuffed into it. In our case a balcony is typically made out of a few 3D cubes, 2 concrete textures, and maybe a drainage pipe in a corner. In uncharted, there is small crap on the floor, a broken cable hangs on the walls, pots are stacked up, a bit of water dripping in the corner, leafs and foliage growing over the walls, a pile of rubble in another corner, 6 different textures.... And that's just a simple stupid balcony, a lot more detail can be found in the surrounding background.

Not just quality, also quantity matters. Do you know why the 3D office-room in your game doesn't look very realistic? Because it's empty. In your face! Let me guess... carpet tiles on the floor, a white plastered texture for the walls, system ceiling with (only) 1 lamp, a few (cloned) desks with a computer screen and keyboard on top, some chairs, and a few posters on the walls. Oh, and for the detail-connoisseur: a stapler on one the desks! Probably that stapler looks a bit out of place, because it's the only small object in the scene compared to the desks and computers. Now look around you in the real world. In my little office at work, there is more garbage than one can count. Computer here, computer there. Cables, lot's of. Electrical outlets, 6 lamps in the ceiling to lit the small room, airco unit, papers scattered everywhere, plastic coffee cups, garbage bin filled with stinky banana peels, oil-marks on the carpet, little holes and damage on the wall, some unnecessary chairs in a corner, a backpack below the desk, cardboard boxes with more electrical junk, folders, VHS Videos(hu?), circuit boards, tape, screwdrivers, business cards, elastics, plastic crap, pencils, markers, and so on. And I'm still missing a damn stapler by the way.

Even simple scenes carry more detail than you would see at first. Just take a look in a random hallway. Wood-floor, painted wall, stone ceiling... That's only 3 boring textures. But look again and better this time. You’ll notice radiators, cables, wires, unused sockets, cracks, marks, skirting, holes, repaired spots, garbage, and the list goes on and on. 6 years ago we could argument that computers can't handle such large amounts of useless junk to render, but these days it shouldn't be too much of a problem to scatter pens and papers over a desk, or to throw bricks and dogturds over the 3D streets. No excuses!

Here one of my major issues. The rooms are pretty large, and thus the textures need to be stretched out further as well to prevent repeating. But small stuff like these sockets suddenly look too detailed compared to the wall. Putting a slim, pretty woman next to a fat woman makes the fat one look even fatter. The solution? Increase shadowMap resolution, add decals(cracks, holes, paint, damage, ...) on the walls to make them look more detailed, add (a lot) more small stuff nearby. Or even better, less texture stretching & more variants on the texture to compensate the repeating. In other words: more assets > more production > more artists


The real limitation is, of course, the lack of manpower. Currently I have three guys on the assets (in their free time). Julio makes surface & effect textures, Sergi makes objects(and their textures), and Robert is doing a little surprise for the tech-demo. Talking about surprising, Robert just became a father btw! A little, healthy little boy surprise entered our world last Sunday!

Anyway, I can't expect three men to fabricate whole asset-libraries in a short amount of time of course. So, for now the environments are still a bit empty, and small details such as a pipe or outlets look a bit out of place. Too bad, but there isn't much we can about that now, no matter what shaders you can bake. Now you understand why games have such big budgets these days. The stapler-models alone already requires a production team of 8 artists!

No, but seriously, the men separate from the boys by having well-thought, well-designed, well-filled environments. We should start with research and a huge photo-resource. Then create ideas & concept-art to give direction to the modelers. Then a group of modelers and texture artists that can exactly produce what makes a room look like a room. And finally, an engine + tools that fulfills the artist needs. That's the theory... In practice I made a bunch of maps with my limited skills, and now the other guys try to fill it with some textures and objects ... Oops, that doesn't sound too hopeful for the next Demo :)

Nah, I'm sure it will look pretty good, certainly for a hobby project without a budget. We can be proud we did that all by ourselves in the evening hours. But one has to analyze and place critical notes once in a while, right? At least we have some ideas of how to improve the quality next time. And maybe I should spend some more energy on finding extra concept & 3D artists rather than trying to patch everything with new shaders :p

Before the wole modeling process begins, you got to start with the proper ideas. Bad or boring ideas can’t be fixed by shaders or good looking textures. The Radar Station was based on some cool photographs Julio found on
abandoned-places. Too bad we didn’t had time to sketch good maps first. I just started modeling relative big simple rooms connected with each other. Got to admit the Radar Station wasn’t meant for a movie in the first place btw!


Here some more input a friend gave me after Googling around. Not-so-usual designs are important elements if you want to show something impressive. If Tower22 would only be made of corridors and apartments you see in any other flat, it would become boring very quickly...

Sunday, November 13, 2011

The real deal

Man, heard some painfully awkward "interviews" on the radio this week, while driving to one of our harvesters. Not about Joe Frazier puffing his last smoke, Conrad Murray doing magic with medicines, or Papandreou souvlaki. No, it was about how gamers slept in front of the stores, waiting for Call of Duty: Modern Warfare 3. It's mindboggling when 55 year old people, technically left behind in the Nintendo Entertain System 8 bit era, start asking. "So this video-computer-game is about shooting other puppets with the mouse?". Even more facepalming might be the reactions from hyper enthusiast 16 year old CoD "veterans" explaining what a first-person-shooter is, using modern English generation-X words the interviewer never heard about. Online avatar? Deathmatch? Lagging problems? Shader graphics? 100 frags? LOL?!

Maybe what strikes me most is that this is about CoD in specific. C'mon man, it's just a game. A polished, good looking, action packed one. But really nothing new. When fans told the interviewer about how freak'n realistic this new game is, I frowned my butt crack and had to check my ears. Wha-wha-what?! CoD, Realistic? That's like saying "Cowboy tobacco" and "Whale sperm cells" in one sentence; it has nothing to do with each other. Oh, of course this game *looks* realistic, the visuals are excellent. But isn't this also that game where you kill more (dumb) men you can count, and re-spawn 10 meters back within 5 seconds if you got "fragged"? Imagine that would happen in a Afghanistan...

Yes, I fired a couple of real guns in my life, read the real "Band of Brothers" biography book, watched Ross Kemp almost shitting his pants for Taliban gunfire, seen the Seals on Natgeo, and more important, played Hidden & Dangerous 1 and 2. And let me tell you: you certainly can't kill a helicopter with a tomahawk (axe, the rocket might actually work):
Youtube Modern Warfare helicopter fun
Not only CoD is guilty. Battlefield 3 is inbound dudes. So I watched some in-game footage where a boy and girl had some coop-fun. 5 minutes later, the duo had killed an entire army, caught about 40 bullets without dying, blew up a few tanks that didn't pay attention to them running around with dangerous Javelins, and popped one after another enemy as if aiming a gun is childsplay. And don't get me started on the online features. In theory, you can play a realistic, tactical game. In practice, everyone is running into each other like a Braveheart battle. Cause you don't care about your virtual gamelife anyway. Hence, you re-spawn 5 seconds later after you crashed your helicopter after a tomahawk incident. Realism, my ass.

Those milky Lighting-only testshots always kick-ass. Maybe we should't use (diffuse) textures in this game. Saves a lot of work. The hell with realism.

So, maybe ARMA II is what this old whiner needs. Urr... Much harder, check. Lots of factors to count in, check. Big open maps, check. Realistic weapon ballistics, check. Teamwork needed, check. No stupid re-spawn/regain system, thank God check. Fun... Oh, that's because a real war isn't fun either of course. Truly a realistic game indeed.

Why are the realistic, more serious games so painful? Navigating a soldier is more complicated than doing an emergency belly slide with a Boeing 767 in Warsaw. You need 2 keyboards and 4 big handles mounted on your chair just to move the legs. Why are the graphics mediocre? Why is the A.I. even more dull than in most other action games? Why does such games always contain bugs like getting hit by bullets that went through a mountain, or falling through the floor? You can say a lot about CoD or Battlefield, but at least their mechanics are smooth and slick.

Isn't there a good tradeoff? Well yes there is. Or was, I should say. The last title in this series was released in 2002 I believe. We’re talking about Hidden & Dangerous. Damn I wish they made a new part. That game was stiff and didn't had the brightest opponents either. But at least you were afraid of tanks instead of running into them, throwing grenades. Killing guards, disabling MG42's, sniping patroulles or destroying armored vehicles really felt like an accomplishment. A little more recent example of a well balanced game (in my opinion) is Far Cry. Looked good, plenty action, but also using your brains was rewarding in this title.



Obviously, taste differs and personally I prefer a game somewhere in the middle. It needs to be challenging, realistic, but neither a true simulator. Admit it, killing a helicopter with an axe is pretty cool, and a good laugh is also worth a penny. I think my main beef with these games, is that they are too easy; you simply can’t die anymore! CoD, Crysis, and many others have that auto-regain system and otherwise auto-saves every 20 yards. Or how about Bioshock? You didn't even had to redo stuff after getting killed in that game, the dead remained dead, and you kept all your weapons / ammo. Beautiful game, but not a challenge if you ask me. But challenge does not have to equal realism through.

What is realism anyway, asides from good graphics/sound/physics? Would CoD be more fun if you had to stop and take a crap every six (game)hours? Would Battlefield be better if you need to refuel your Jeep before you blow yourself up 2 minutes later? Would Silent Hill be more fun if the player stumbles over random obstacles while running away from a monster? Would Mario be a good game if that (fat) plumber just jumps 60 centimeters high like you and me? Is a boxing-game good if both boxers hang tired in each other arms every 20 seconds? Could Doom be spiced by only carrying 2 weapons and limited ammunition? Would the Sims be cooler if those bastards sleep 8 real-life hours? Would Tower22 be more immersive if the handyman would smoke and drink beer in the bench every day after work?

Games need to be fun in the first place right? If physical rules have to be thrown overboard, then so be it. If it requires 60 dumb soldiers to shoot per minute to keep the player excited, then so be it. Although I wouldn't call my games "realistic" in those cases, it's perfectly fine to do the impossible. Why else would we need games or movies for? You don't say Superman is lame just because he can fly. In fact, implementing realistic features only works out if it actually adds fun to the game. Though in my opinion, modern games removed too much elements just to make games easier and thus accessible for everyone (=$$$), you play a game to escape from reality. Not to eat bread and tying your shoelaces on the TV again.

Ok, the reason for these white shots was testing a simplified ambient method. I'm still fooling around with a realtime G.I. method, but since my laptop doesn't have that much graphical horsepower, I tried a simple method for lower end cards (and distant area's). Each vertex here has 3 pre-calculated ambient-occlusion values: Sky-occlusion, Ground-occlusion and Environment-occlusion. Depending on these 3 factors and 3 colors, the ambient will be calculated. Since we do this per vertex, it's wise to subdivide your geometry a bit (forgot that here).

How realistic will T22 be then? In the first place, T22 needs to be scary. And easy games just aren't scary. So don't expect you can kill a monster with 5 headshots in a row. That's why I never really understood the negative comments on the camera-angles, limited ammo, and stiff controls in (old) Resident Evils. What do you expect? Rushing through the mansion like Duke Nukem? Oh wait, they actually listened to the fans, and changed these points in RE4 / 5. Quality fun games, but scary? No.

Other than in many other genres, human shortcomings such as a limited stamina, fear or not being able to do Chuck Norris roundhouse kicks, are valid (realistic) limitations. Just as long as the game doesn't start feeling unfair. You need to escape or defend yourself, but certainly not in a too easy way! Testing and tweaking the rules should become an important development phase later on. The goal is to create some "Holy shit barely survived that!" moments.

As you may have read, you won't be confronting monsters all the time though. How to fill the gaps then? Another oddity of horror games (and movies) is that it doesn't have to be a funride. When looking purely at gameplay, Silent Hill is pretty boring actually. You don't play it cause it feels so good. You play it cause you want to find the clues, and cause you like to test your heartbeat. I don't want to make excuses though, so we'll try to add some "fun" by doing focusing more on exploration and puzzle braincrackers. As for realistic elements, a day-night cycle, sleeping and maybe even eating are floating in the idea clouds indeed. But it needs to be integrated in such a way that it feels necessary, not an annoying repeat, and enhances the way how puzzles or confrontations can be solved. If it doesn't, the feature should be scrapped.


But yeah, Tower22 is probably not the type of game everyone will enjoy ;) Maybe the comments on CoD are just out of jealousy ;) Asides from bums, I don't expect people to sleep in front of the stores when(if) T22 finally comes out. It doesn't matter though: we'll make what whatever we please, not what sells. And isn't that the essence of making innovative, good stuff?

Wednesday, November 2, 2011

In Control

Countdown, 7 weeks remaining. Funny to see the productivity rises as soon as there are deadlines and to-do lists. Yep, if you want your team (and yourself) not to be sleeping at the job, keep making (sub)targets and easy-to-follow plannings. Or as they would say in Full Metal Jacket, keep throwing hand grenades at Beastman to keep him sharp.

That felt a bit unnatural to me at first, cause basically you're asking your helpers to work hard(er), without giving them a salary in return. But trust me, it's better to push a bit and keep everyone at work rather than kindly asking if one could do asset X somewhere within the next 50 months, if he likes. Don’t forget why an artist joined you in the first place: to create awesome stuff! The more clear the targets, the more being produced, the more enthusiast people are to add their fifty cents.

As for my own progress, I pimped the water with some fluid-dynamics and pretty realistic ripples caused by particles or stuff falling in the water. Improved the parallax effect a little bit for some stone floor, fixed some annoying bugs, and currently I'm breaking my neck (again) at particle-lighting. There are dozens of ways to render particles, but usually the combination of overdraw and complex particle shaders (lighting & shadowMaps) quickly halts your performance. And blending all those damn sprites into a realistic "cloud" is tricky. With simple additive blending, your fog quickly becomes a radiating Fukushima cloud. With classic transparency the quads start biting each other and fade-out the background unpredictably. One second it looks good, the other second it looks as if the air was filled with pregnant flying elephants.

Blurry particle mess. Trying to use lights and shadows on them.

We'll talk again when/if I get those particles working properly. Usually when there is a problem or a new technique that has to be done, I start browsing the internet (really?!). And more than once, I stumble on the feature-lists, brief implementation details, or jealous-making screenshots of other A+ engines. Cryengine, UDK, 4A, Unity3D, Ogre, and so on. I could be proud that my own home-made-hobby engine somewhat approaches the (commercial) big players when it comes to rendering quality. Not saying "Engine22" looks better, but for some free-time plumbing, it isn't that bad.

Yet at the same time, I sometimes wonder why the hell I'm even trying to make my own engine. What's the point? You're not going to win it from the others. Why not making Tower22 with the Cryengine? All those cool water, fog, particle, lighting and whatever LSD tripping effect you’ll need, is ready to kick ass there. And asides from graphics, it has physics, sound, AI scripting, pathfinding, GUI, multiplatform support, editors / tools, documentation, and so on.


Ok, my budget of 100 euro is probably not enough to buy a Cryengine license, but there are cheap or even free engines out there as well. The point is, as a development team, you can actually focus on the game itself instead of an engine + tools that have to be made before you can even start. "Make games, not engines" (Plato, 347-428 BC), that's what they told us. Now why oh why Lord, why do we torture ourselves trying to make something that is A: outdated as soon as you take a crap for 5 minutes, B: takes an awful lot of time, C: unlikely to beat other existing products? Seriously, it reduces the chance of your game ever seeing daylight, unless you have a big team of nutty professors.

Are we just stubborn, or too pride maybe? For me, picking another engine (and throwing overboard my own stuff) feels like surrendering. It's like getting credit for something you didn't do yourself. It's like those modern cars that can automatically park themselves. Any man would say "Auto-parking my ass, watch this honey!".... (bump).

At times like that, I have to remind myself why I'm doing it again. And honestly I can't give a perfect answer, other than I like to program my own engine! If we would switch to a ready-to-use EngineX tomorrow, there is not much left for me. Tweaking some shaders, write some A.I. scripts... yawn. I would become like the redundant manager at the office. Walking around a bit, asking stuff... "Everything ok here?", "Need some coffee maybe?". I can't help the artists much, other than giving directions and feedback. Neither can I compose sound, or make awesome concept-art. And then we have an engine. No idea what really happens under the hood... It just works.

Nah. That sucks. Now I remember why I'm programming again; the need to learn new techniques. Moreover, I want full-control. If something needs to be tweaked, every last bit should be familiar stuff. I rather program my own devices just to be sure it works (or doesn't work) as expected. And I hate flying cause I don't have any control over it. Hmmm... sounds like some sort of psychological issue...

The same scene without particles.

"Make games, not engines". But the same people also say that modern engines are way too much focused on graphical wow-stuff rather than solid gameplay. I disagree that graphics aren't important at all. How about immersion? If Tower22 had to be played on a Wii without shaders to create a scary dark atmosphere and good looking monsters, it will probably suck. Hey, you don't watch Low-Definition TV either, do you? Nevertheless, they have a point of course.

Each engine has a certain feel. No matter what level you play, or which modification you download, certain mechanics and atmospheric aspects keep the same. IdTech has a sci-fi touch, Cryengine excels outdoors, UDK games have a blueish look, and all three are mainly made for first person action shooters. This may work out for game A, but not that well for game B. Although Crysis looks better than its predecessor "Far Cry" in every possible way, I enjoyed the old game much more. Subtle differences in controls, other game-rules, other map-design, different A.I., different pace, different overall look.

When building a game on a certain platform, you automatically inherit some of its DNA. Both the good and the bad aspects. When using Cryengine for T22, the look might be more crisp & flashy instead of a blurry nightmare. And I'm not so sure if I can make one big roaming world instead of loading separated levels. And how about the A.I.? T22 Monsters are completely different than stealthy North Korean soldiers... And how flexible is the engine when it comes to playing weird horror tricks? Like Demo1 that replaced the first room with another room after the monster-chase.

In short, T22 is a complete different game than the action shooters that gave birth to most of the popular engines. But since you can't make a racegame on a soccergame-engine either, I doubt if there exists any engine that does exactly what I want for T22. See? Need to be in full control.

Improved water. The snow that drops on the water creates ripples. Bigger ripples will result in actual 3D waves. Yeah I know, I still have to post another article about water.

==============================================================================
So, making games or engines? That entirely depends on you. What is your ultimate target? Learning how to program a game, or (quickly) making the actual game? Are you willing to spend an awful lot of time in researching (new) graphical / A.I. / scripting / physical / whatsoever / techniques? How much time do you have anyway? In case you aim for a complex game, you can safely add at least 4 extra development years if you plan making your own engine. Or make it 8 years, in case you never did it before. Cause you'll be scrapping and redoing parts, if not the entire engine, several times. And last but not least, is there an existing engine that does the things you want?

Here, I made a little dr.Phill test for you.

1. Target?
----0 [a] Release a commercial game
----1 [b] Enjoy my (finished) game
----3 [c] Make a game & sharpen my skills
----5 [d] Learn how to make games
----6 [e] Make a (commercial) killer engine

2. Available time / release date?
----0 [a] 1..2 years
----1 [b] 2..4 years
----2 [c] 4..8 years
----3 [d] I can travel through time. It doesn't matter.

3. How much time can you spend on it each week?
----0 [a] Little. Other things to do
----1 [b] Not so much (5..10 hours)
----2 [c] Pretty much (10..20 hours)
----3 [d] Unlimited, I dream code.

4. Are you working alone, or together with artists that require tools?
----0 [a] Big team (10+)
----1 [c] A small team (<10)
----2 [b] Han Solo
----1 [d] Not relevant, no complex tools needed

5. How complex is your game?
----0 [a] Think in terms of Halflife4 & GTA7
----1 [b] Pretty complex
----2 [c] Pretty simple
----3 [d] Extremely simple. Atari stuff.

6. How important is the quality (graphics, physics, tools, and so on) for you(& team)?
----0 [a] Very, very. A+ quality only.
----1 [b] Pretty much, but I don't have to win
----2 [c] Make games, not graphics

7. Do you like building your own tools & editors
----0 [a] Boring
----1 [b] If I must...
----3 [c] Love it

8. Do you like reading technical papers?
----0 [a] My ass does
----1 [b] Not really, but if I must
----3 [c] Yummy

9. Do you have experience with coding engines?
----0 [a] Dieselengines? No.
----1 [b] A bit
----2 [c] No / a bit, but I'd like to learn
----3 [d] Sure.

10. Are there available (free or commercial) engines in the genre you're aiming for?
----0 [a] Yes, and I can get those
----1 [b] Yes, but I'm not sure if I want to pay for that
----3 [c] No / Yes but not in my budget

11. Where's your heart at?
----0 [a] The creative aspect (making game contents, maps)
----1 [b] Create / Tweaking the game (scripts, A.I., ...)
----3 [c] A mixture of both
----6 [d] The technical aspect (coding stuff)

Now sum the points (max = 35, my score was 22 btw). The outcome is based on absolutely nothing, but at least it got you thinking right?

0..12 points
You really don't have time for technical bullcrap. What you want is a game, not a technical course. Don't torture yourself too much with programming, cause it's likely bringing you nowhere. Don't forget to make fun in the first place. Grab the engine / platform that fits best, and realize your dreams.

13..18 points
The goal is to make a game, but you don't mind getting your hands dirty. Or maybe your type of game is pretty simple, so wrapping up your own code shouldn't be too much of a problem. Don't forget there are intermediates. XNA or Ogre for example will help you with the coding, but you are still in control.

19..26 points
Either you really like to learn how to make an engine, or the type of game you want to make simply forces you into making your own gearbox. An actual release of the game itself will be the cherry on the pie. Go out and play, but don't forget it's not a crime to ask for help or use some ready-to-use libraries.

27..35 points
Nerd ;) You don't give a shit about games really, you just want to do the stuff that the other big boys do, don't you? Whether you can realize a killer engine or not, go ahead and feed those brains.

Monday, October 24, 2011

Up yours


Tactical plans sir.

Another big name wiped off the Risk playboard. Saddam, Bin Laden, now Ghaddafi (or whatever his name is spelled). Who's next? Il Kim 3000? Obama? Don't know what to think of Ghaddafi's fall. I'm “glad” it got taped on film so we don't have to get in doubt with conspiracy theories again. Well, what say about it… He didn't give a fair trial for his opponents either, and dictators generally suck anyway. Then again, Libya was relative rich and developed compared to some other countries in the region. Iraq turned into a hell-pit when Saddam got chased into a hole, and I don't trust the extremists who are ready to jump into this Arabic Spring either. From a dictatorial system to a deep religious system... not my cup of tea.

I hope the youngsters who started these demonstrations can really create a better future without chaos, war, dictators or religious bearded dresses telling them how think, what to do, and what not to do. A tolerant place based on freedom, tolerance, and common sense. But the problem in these locations is that the word usually goes to the one with the biggest sable/AK-47, rather than a democratically chosen intellect with vision. Although… democracy has become a joke in the Western world as well. Can't remember anyone asking me about whether we should join the war in the mid-east, give more power to Brussels, how to deal with near-bankrupt countries in the EU zone, or if we should "free" Libya (for their own (oil) interests). A “No.” from the people still gets turned in a “no but, Yes - with some chocolate sauce”.


The big guys play their game anyway, no matter what we think of it. As long as we're happy with our house, car, widescreen TV and “What’s in Store!”- Bodytoaster Pro, they can keep milking tax and wipe their ass with it in any that pleases them. It's the 1% versus 99% story. A small elite of... fuckers, decides what happens in the world. Whether Ghadaffi should deliver oil, or sleep in a supermarket cooling cell. If banks should be saved whether they screw up or not. When & where to fight a cozy war to bring “Democracy”. Which other cool overpaid jobs they can get via the Old Boys network. And what we, -99%-, of tax-cows should know and do to keep their thirsty machine running. The Bible sin "Greed" is a nice summary of it all.

That's where the Occupy movement comes from I guess. Sounds I'm an anti-capitalist too. Well, not really. In my opinion, those who work hard should earn more than those who lay in their bench every day, bitching about everything. And a bigger salary should motivate people to use their talents instead of putting everyone behind the same factory conveyor belt. Listen up, there's no such thing as a free lunch. Instead of complaining or envying others, you'd better try to accomplish something yourself, and accept that there will always be people with more money, more women, more success, and more golden teeth whether they really deserve it or not. BUT, a system with a small superrich elite that does dark, unverifiable things stinks. But hey! What are you gonna do about it? Unless we really start rioting and build improvised tanks and Anti-Air pickup trucks, the elite probably doesn't care less about another demonstration. Hence, five days later the mess gets cleaned up by a couple of (hard working) garbage men, paid by our own tax of course. Face it, we know too little and have too much to lose to stand up against it. Bend over please.

I don’t see that happening at the Occupy demonstrations… By the way, those Libyans had some excessive welding classes last months!



Enough politics.
So how's the progress on that next little movie? ...Movie? For those who didn't know yet, we're trying to show a (tech)movie end this year. Or begin 2012 in case things get messed up, but the goal is to give you a Christmas present. Don't expect a "cinematic"-horror-gameplay movie though. It's merely a flythrough, showing some engine graphics stuff, and most of all, the audio, 3D and texture work that has been done by the T22 team.

No secret, the goal is to attract some more 3D/Texture/Concept art people with that demo. Cause we really need it! In the Blog statistics (love them), I saw one was Googling for "Tower 22 release date". I bet you can find a T22_Install.exe on some murky Torrent website within a few years, but we really still have to start on this game! That's right, other than the assets you've seen in this Blog, a half-working engine, and a story + ideas on paper, there is no game content yet! The reason is pretty simple. I want to start on the game when:

- The team is big, talented & motivated enough
- The engine works "good enough"
- Development tools are "good enough"
- All the design & plans have been clearly documented
* In the meanwhile, we build 1 or 2 more demo’s. At least one is planned for 2012

In other words, I don't want to build Tower22 on a fundament of shit. The good news; the engine + tools are going pretty well, the paperwork is scheduled, and the team is growing slow but steadily. Hopefully the Tech-Demo gives it another boost. Making a game isn't easy, so compare it with getting the Titanic into movement. But I have faith in it!

Do you know what's annoying? Rendering white paper without getting blinded by HDR bloom.

I didn't answer the question yet. How's the demo progress going? Well, a whole listing of objects(chairs, lamps, junk), textures and audio is still there. But each week I can check three to five assets, so I think the scene has enough material to look and sound properly within two months. No "borrowed" Halflife2 assets this time! As for the engine, there isn't that much noticeable improvement. The sound engine should hear the same with FMOD. The compressed DDS should look the same as the uncompressed TGA's did (I damn hope so!), and upgraded input modules aren’t going to produce anything visual either. There are some noticeable new effects though (asides from quite a lot bug-fixed and little improvements):

- GPU Particles (with lighting)
- Water
- Ice shaders
- Wall overlays (dirt, cracks, snow, frost)
- Anti-Aliasing
- And stuff I probably forgot

Currently I'm playing with realtime water-fluids to replace the stupid rolling ripple texture with something better looking (and for another water article :p). But I'm not so sure if it will make it before Christmas. We'll see. The biggest improvement should be the recording quality! I haven’t been looking for a better way yet, but let’s see if I can use an external device to record the movie so the CPU won’t be hogging and choking the sound.

The (sharp specular highlight) edges on this stinky chair and the drawers in the background are anti-aliased with FXAA. But I’m not 100% convinced. Either FXAA isn’t effective enough (and making it more powerful will blur the entire screen), or the shader has a little bug…

Sunday, October 16, 2011

Compressor, Part 2/2

What the hell we're we doing again? Oh yes, texture compression. In short, the main advantages are less storage space, less (video)memory space, faster loading/streaming, and if you're a lucky guy, a (little) performance boost cause less bandwidth is required. Reason enough to implement compressed texture formats... but how?

When you target OpenGL, you can encode pixelData into the DXT1, DXT3 or DXT5 format. So first (1.) encode, then (2.) store it in a file (a DDS for example), (3.) load the file later on, and finally (4.) send the (compressed) pixelData to the videocard. Sounds pretty complicated, but we have some nifty tools.

==========================================================
1. The Creation
==========================================================
Load a (raw) image, such as a bitmap or TGA file. Then encode it to a DXT format (or BC in case you target DirectX applications). So... we have to dig in compression algorithms now, right? Of course not. Don't reinvent the wheel, be lazy, and make good use of existing tools.

You can download an existing convertor tool or try to find a plugin for your favourite painting program. There are plugs for Photoshop, Paint Shop Pro, Gimp, Paint.NET... These plugins typically convert a common image format to a DDS file. You can skip step 1 and 2 of this tutorial now, peace of cake. Have a good look though. Not all convertors have equal quality and export options.

When my mobile research-lab was crunching on DDS, I had an old version of Paint Shop Pro though. Just ordered a new version (PSP X4), but no cool plugins at that time. I tried some other exporters, but they usually gave wrong output. Inverted RGB channels, flipped images, Lena changing into a guy, et cetera. Some claimed ATI has a good quality exporter, so I tried this instead: ATI Compress


Too bad, this is not a ready-to-use convertor, not even a command-line tool(I hate those, too lazy to type). It's a DLL you can include in your own programmed tools. Normally I would pass, but with the lack of good exporting tools so far, I gave it a try. And I got to say, it wasn't that hard at all (getting into C++ again took me more time). The ATI library is pretty straight forward. It has a function to compress raw image data, and some basic utilities to read/write DDS files.

1.- Load input image (bitmap, buttmap, tga, png, ...)
2.- Generate Mip-Maps (if you like)
3.- Let the ATI Compress library generate compressed pixelData (for each MipMap level)
4.- Store it as a DDS file (or your own custom format)

Mip-Maps ?!
In case you never heard of them, Mip-Maps are smaller ("blurred") variants of your texture. Pretty simple, half the size until you reach a 1x1 resolution. So a 256x256 image gets a 128, 64, 32, 16, 8, 4, 2 and 1 variant. But... why would you do that? Well, when looking a textured surface from a distance, one screen-pixel may have to sample from multiple texture-pixels. This can result in pixelated/blocky results, especially for textures with a high-frequency details or pattern such as black-white tiles. When you have mip-maps, the renderer will (automatically) pick a smaller, more blurry, variant to suppress this annoying artifact. A little downside is that mip-maps require extra image space (though the smaller resolution variants really don't take that much).

Sorry if you died from an epileptic attack.

OpenGL / DirectX have functions that generate mip-maps automatically for you. However, generating them takes time! So each time you load a texture that uses mip-mapping, you're wasting even more time with generating them. That's why some image formats (such as DDS) supports the storage of pre-fabricated mip-maps. So instead of rebuilding them each time again, you store smaller variants of the texture ready-to-use in the image file. In other words, it makes the loading times faster.

==========================================================
2. DDS File-Loader
==========================================================
Once your file has been generated somehow, you got to load it again in your app. I chose to use DDS files. Pretty obvious, cause this format supports compressed pixelData, storing prefab mip-maps, and even cubeMaps or layered (3D/Array) textures if you like. On top, it’s a common standard in Gameland nowadays. Monkeys see, monkeys do.

Luckily the DDS format is fairly easy. Mainly cause it doesn’t store its pixels in a wacky way. The array of pixels is stored exactly as OpenGL or DirectX expects it. This makes DDS fast to read, as you don’t have to swap bits or do other tricks before you load it to the GPU. It’s 1 on 1. But wait… D-D-S… stands for “Direct-Draw-Surace”… Isn’t that DirectX slang?? So we can’t use DDS in OpenGL apps?!

It is a DirectX thing indeed, and yep, you need a header file to get things working. But don’t worry. It’s not that your OpenGL program changes into a malformed Siamese twin with DirectX. Download the DirectX SDK, or if you are a Delphi user, you can use this: Clootie DX Pascal headers
Then include “DirectDraw.h / pas” in your program. Done.

// Delphi code.
function TEX_LoadFile_DDS( filename : string ) : TTexData;
var
ddsd :_DDSURFACEDESC2;
fileCode : array[0..3] of char;
factor : integer;
bufferSize : integer;
readBufferSize: integer;
pFile : THandle;
readBytes : Longword;
begin
{ Open file... Calling Powdered toast man }
pFile := CreateFile(PChar(filename), GENERIC_READ, FILE_SHARE_READ, nil, OPEN_EXISTING, 0, 0);
if (pFile = INVALID_HANDLE_VALUE) then begin
showMessage( 'DDS Load Error: Cannot open file ' + filename );
Exit;
end;

{ Verify if it is a true DDS file. Not made-in-China fake stuff }
ReadFile( pFile, fileCode, 4, ReadBytes, nil);
if (fileCode[0] + fileCode[1] + fileCode[2] <> 'DDS') then begin
showMessage( 'DDS Load Error: file is not a valid DDS file.'#13+filename );
CloseHandle(pFile);
exit;
end;

{ Read surface descriptor.
A struct that tells what we can expect in this file. }
ReadFile( pFile, ddsd, sizeof(ddsd), ReadBytes, nil );

case ddsd.ddpfPixelFormat.dwFourCC of
FOURCC_DXT1 :
begin
// DXT1's compression ratio is 8:1
result.outputFormat := GL_COMPRESSED_RGBA_S3TC_DXT1_EXT;
result.isCompressed := True;
factor := 2;
end;
FOURCC_DXT3 :
begin
// DXT3's compression ratio is 4:1
result.outputFormat := GL_COMPRESSED_RGBA_S3TC_DXT3_EXT;
result.isCompressed := True;
factor := 4;
end;
FOURCC_DXT5 :
begin
// DXT5's compression ratio is 4:1
result.outputFormat := GL_COMPRESSED_RGBA_S3TC_DXT5_EXT;
result.isCompressed := True;
factor := 4;
end;
else begin
{ Not compressed. Oh shit, didn't implement that! }
result.isCompressed := False;
showMessage( 'DDS Load Error: Uncompressed format not supported!'+#13 + filename );
CloseHandle(pFile);
exit;
end;
end; // case ddsd.ddpfPixelFormat.dwFourCC


{ How big will the buffer need to be to load all of the pixel data
including mip-maps? }
if( ddsd.dwLinearSize = 0 ) then
begin
showMessage( 'DDS Load Error: dwLinearSize is 0!'+#13 + filename );
CloseHandle(pFile);
exit;
end;
if( ddsd.dwMipMapCount > 1 ) then
bufferSize := ddsd.dwLinearSize * factor else
bufferSize := ddsd.dwLinearSize;

{ Allocate pixel buffer, then read the (compressed)
PixelData (containing 1 or more MipMap levels) from the file }
readBufferSize := bufferSize * sizeof(char); // Calc buffer-size
GetMem( result.pixels, readBufferSize ); // Allocate memory
ReadFile( pFile, result.data^ , readBufferSize, ReadBytes, nil);
CloseHandle(pFile); // Close file

{ More output info }
result.width := ddsd.dwWidth;
result.height := ddsd.dwHeight;
result.numMipMaps := ddsd.dwMipMapCount;

{ Do we have a fourth Alpha channel doc? }
if( ddsd.ddpfPixelFormat.dwFourCC = FOURCC_DXT1 ) then
result.components := 3 else
result.components := 4;
end; // TEX_LoadFile_DDS


Just a shot. Playing around with ingame contrast here...

==========================================================
3. Pumping to the video-card
==========================================================
The final, and probably also most easiest step, is loading the (compressed) pixelData to the video-card. No worries, it’s pretty much the same as generating any other texture. Start with the daily stuff:

glEnable( GL_TEXTURE_2D );
glGenTextures( 1, @resultHandle );
glBindTexture( GL_TEXTURE_2D, resultHandle);
// Texture settings. Using mipmapping here...
glTexParameteri(GL_TEXTURE_2D,, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR );
glTexParameteri(GL_TEXTURE_2D,, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
glTexParameteri( GL_TEXTURE_2D, );

Next we send the pixelData to the Twilight zone. One little thing to keep in mind is that we might have loaded multiple mipmaps, all in the same array of pixelData. So for each mipmap level, calculate the bytesize and offset in the array.

if textureData.usingCompression then begin
if textureData.outputFormat = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT then
nBlockSize := 8 else
nBlockSize := 16;
{ Size of mipmap level 0 (original size) }
nHeight := textureData.height;
nWidth := textureData.width;
nOffset := 0;

{ Send the compressed mipmap(s) data to the texture }
for i:=0 to data.numMipMaps-1 do begin
if nWidth = 0 then nWidth := 1;
if nHeight = 0 then nHeight := 1;

nSize := ((nWidth+3) div 4) * ((nHeight+3)div 4) * nBlockSize;
glCompressedTexImage2DARB( GL_TEXTURE_2D,
i, //mipmap level
data.outputformat, // DXT1,3,5
nWidth,
nHeight,
0,
nSize,
pointer( integer(data.data) + nOffset)
);
nOffset := nOffset + nSize; // Offset in pixel buffer next time
// Half the image size for the next mip-map level...
nWidth := (nWidth div 2);
nHeight := (nHeight div 2);
end; // for i
end else ...

Texture quality
Last, here's a little Kung-fu trick. Probably you noticed the "Texture Quality" setting in most games. Chose between "Godlike, medium or fucked-up". Obviously, computers with lower-end hardware and/or limited video-memory should pick a lower setting. And you want this option too, don't you? Pretty easy. Just skip the first mipmap level(s) in the loop. This way OpenGL will only deal with smaller textures, as the higher level(s) get disposed again. That's all you need to know for now, Daniel San.

Saturday, October 8, 2011

Turbo marketing

No more calling home for Steve Jobs. I'm not really familiar with Apple products, but condolences to his beloved ones and many, many iFans. 56 is not an age to die, especially not if your head is still full of ideas and ambitions. Rest in peace Steve.



Pfew. The storm of emails and reactions is a bit over now. If you thought that demo movie was scary, I got my nerves in the throat as well last week! Having this unexpected, “massive” attention on the project is great free advertisement and can open doors, but is also scary at the same time. We hobby-developers, C++ and Turbo Pascal nerds may think T22 is sweet. But the common man who just wants to play a good game looks from a different perspective of course. It's either a cool product, or a piece of shit. If you buy a car, you don't care how much love was put into it, as long as it drives properly. In other words, T22 sort of got a little stress-test.

And... should I look for another hobby (such as whispering horses, playing flute, collecting Iranian stamps), or are we still standing? I suppose so :). Most of the reactions we're positive, a few hated it, and a couple found the second half of the demo movie an anti climax. Ugly HUD logo's, scripted shift!-run! (“QTE”) sequence, a goofy monster, and what in the devils name was that fat sprite doing at the end?

Taste differs of course. Especially when it comes to horror. I’m scared of clowns and porcelain puppets, others love them. Though some responders might have skipped the fact that this little demo-movie was done by a programmer without real art skills, in a 10% finished engine. Do you really want to know why the last part was scripted so much? Ok then... stair-climbing physics were still so bad that the player couldn't run up in a decent tempo. So I putted him on a rail, just like that goofy monster :D The available assets were very limited, which is why the weird robotic-hand comes from this test-model I made years ago in 5 minutes:

Third person?


Oh well, as long as the Angry Video Game Nerd doesn't say Tower22 is shitcrackers and he rather eats boiled apeballs, I guess we're ok. But sure, we still have a looong way to go. Rome wasn't made in one day either, especially not in the late night hours after a day of plumbing work! It's funny to see some think that we're actually almost done with a (sellable) Indie game. For example, I got mail from a website, asking if we could send a copy for review, as soon as the game is playable. I wish we can, but... do you have a minute?

As said before, we first need some more artists at least. The good news is that, just before T22 showed up on the internet, an extra person offered his help on the audio (when not busy with real work). Say hello to David Garcia Diaz(Espanol gringo):
http://davidgarciadiaz.com/



The whole thing got me a bit thinking about... the Power of Internet (oooh). The reason why I'm not shouting T22 of the roofs, is because I like to make sure I show something good. Friends and others sometimes ask me about showing it to publishers, sending it to website X, doing aggressive marketing, and so on. Ok, I’m not trying to beat CryEngine or UDK, but showing half baked garbage is like cutting yourself with a knife. Imagine Apple shows a cheap plastic, not-white-colored, monochrome, clunky prototype of the iPad6. Jobs would beat the hell out of the marketing team!

It definitely becomes clear that internet can be a jump platform that launches you sky-high. Think about young talented boys & girls that suddenly got famous via Youtube. Or the amount of clicks Half-life fan websites get every day. But the Internet can also be a deep pitfall. To show you, here some professor Dolittle statistics:

amount of views on this Blog on an average day: ~50
...(half from them are looking for an Albert Einstein picture, or stuff like Horseporn)
amount of views on the Blog on Friday 30 September: ~2.000
amount of Youtube views last 10 months, 1 week ago: ~2050
amount of Youtube views today: ~28.500

Enough ego tripping, but see what I mean? Because of some "advertisement", the numbers mega-quadripled. If, say 80%, of the viewers leave with a positive feeling about T22, we can be proud on ourselves. On the other hand, if 50% or more doesn't really like it or even hates it, you have a problem. Now Tower22 doesn't involve money, commercial stakes, and neither was it under development for many years already. But imagine your product, blood-sweat and tears, got burned because it leaked in an unfinished state, or just because the majority doesn't like it? I can imagine some developers must feel really, REALLY bad if their (life)work receives a lousy 5.0 on Gamespot, only 2 stars at IGN, or a Crocodile Dundee Turd award for the worst game of 2011.

The first blow is half the battle. Now we weren't prepared to fight actually, but all in all, we can breathe a sigh of relief. Reactions such as "Thanks, another set of underpants ruined", "Dont give up on this!", or people who like to buy this non-existing game are heartwarming. More than ever we have good reasons to keep developing. Cause there is a lot to improve! For one thing, it's time to have a website that explains things a bit better. Although it's really fun to see people speculating about the game;

- Demo1 was a programmer "art" movie with very limited assets
- I know, too much (motion) blur sucks
- Don't worry, I hate QTE too
- The game is far from finished. First trying to form a proper team
- The game is not in Russia. Sorry for the confusion. But yes, the setting is inspired on it.
- Yes, the game is all about the story, and I won't tell you. Hence, some of the team members don't even know the story! Top secret shit.
- The genre is a platform-survival-music game. Ok, survival horror then.
- It all takes place in a massive building. Though it’s not only dusty corridors and Soviet-IKEA apartments…
- No military, failed experiments or spooky hospitals in this game.
- Most the time, you won’t see monsters or other badguys. Slow suspence, getting winded up, claustrophobia and sound should do most of the terror.
- The player is not named Robert (unless we really can’t find a name. I didn’t name my own daughter yet either. Picking names is so damn difficult).
- Your character isn’t an action figure, yet he won’t be completely defenseless either
- A next (Tech) Demo is planned end this year
- Another movie that shows bits of the gameplay and boogiemen is planned for 2012
- A true release date indication? When it’s done!
- The game uses a homebrew engine programmed in classic Delphi7. It uses the libraries OpenGL 2x, Cg, FMOD, Python and Newton.


I like to finish this post with quotes that made me laugh, cry, vomit, or piss my pants. Next time we're back on Compression DDS files!

"This shit is trippy",
"Boner at 3:40"
"YOUR MOM is more scary than Tower22."
"He’s a plumber? Now it doesn’t suprise me that at the
.....destroyed apartment the only thing that didn’t collapse was the pipe.
>>"It’s all a cunning plan to increase his plumbing business by making you shit bricks."

"but the monster encounter and very last bit were more than a little ridiculous."
"I can't wait to shit my pants :)"
"You're in my world now? Batman...."
"I shitted my pants. Twice."
"What the FUCK did I just watch?!?
......And who's going to pay for my now-ruined chair?
"Note to self: chairs aren't good at holding huge amounts of shat bricks "
"If i was playing I would of dived the fuck out that window at the end, falling to your death is better than staying in that fucking haunted shit hole!"
"do you play as steve form minecraft? he looks very blocky"
>> "it's actually steve holt"

“fuck watching this again at 1am "just before bed"
“I have a fever, and the onlyprescription is more motion blur”

Friday, September 30, 2011

The plumber

Woke up, went to work, got myself some coffee, parked my ass on a chair, turned on the laptop, scratched my balls, checked the email... holy butcrack.

Wow. rockpapershotgun.com & IndieGames.com, a blog about, yep, Indy games, got notice of T22. Suddenly a lot more traffic on this crappy hole on the WWW, a dozen of Youtube abonnees + jokes, and some articles about T22 on these websites.

I'm shy by nature and hate to stand in the spotlights, but having this attention on your (life)work is great. Got to correct a few wrong assumptions though!

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

...Skyscraper in the Soviet Union...

I mentioned the word "Soviet era style" several times. But... T22 is not really in the Soviet Union. The theme is certainly related, not only on the map design, but in the end the story has not much to do with Stalin & comrades.


...You play as Robert...

Thanks for the name suggestion! But honestly, Robert is a real-life person who is busy designing the player. The protagonist himself has no name yet! But I bet Robert is pleased!


...Then what the # is the game about?!...

Uh... It's hard to tell without spoiling things. The whole story and game is one big quest basically. All I can tell is that you are a caretaker doing jobs for the boss in a big (sort of Soviet style) skyscraper indeed.

And after a while, you do want your freedom (back). So the player, codename Robert, wants "to break free. God knows, God knows I want to break free." "I've Fallen in love"... wait, that's Queen. No love for Robert here!

And yep, the building is pretty much abondon. You'll try to puzzle/search your way out, which makes it a bit different than a zombie slasher or action game. But that doesn't mean you won't get your hands dirty eventually! Be prepared to be affraid, very affraid.


The demo movie is a bunch of scripted events btw. The game itself should give freedom. You decide where to go, when to go, and what to do if something happens. But hey, I wasn't that far programming ;)


...The sound hurts my ears / too much blur...

The sound, SSAO and motion blur are making havoc in this movie indeed. Partially because unfinished business, partially because of the cracky framerate. The movie was recorded on a somewhat older videocard (GeForce 8800) with FRAPS killing the CPU in the background. It made the sound go berserk, and the motion blur even nastier as the deltaTime between 2 frames was relative big.


...I'm a Plumber...

That would be pretty romantic right? Not sure if "a plumber by trademark" means I'm doing a proper job, or actually being a plumber? Too bad. The truth is, I can barely hold a baco. Never ever ask me to fix your toilet, unless you want a sinflood! In real life, I'm programming operating systems for pharmaceutical machines, warehouses, and my sweet 30 ton babies:
youtube1
youtube2


...Out soon...

Oh dear :) Don't want to spoil the party, but this game won't be out anywhere soon. Since we try to put the visual standard pretty high, and the T22 world is going to be kinda big, there is sh~tload of work to do. Programming the engine further, and having some maps, models, textures, sounds and animations would be nice too.

Do you remember the famous words "When it's done!". Well, that game is "done" all right. I'm going to say the same :) But seriously, the current target is forming a team, rather than creating the game right away. I can dream all I want, creating a "big" game with just a few hobbyists is not realistic.

So let's see if we can ensemble enough talented people to create a game in our spare time... Or at least make a good start, and then look further to get this baby on a more professional level. Doing this Blog and demo movies are part of the strategy; hopefully it attracts talented people!


That still sounds like a little boys dream, and... yes, maybe it is. So what? It doesn't mean it's impossible. The people we have here now are capable to create a game like this. The only problem is the lack of manpower so far. Let's show those bastards you don't need a 30-trillion budget to create a good game!



Ever thought about sending this pitch to a publisher?

Yes, but the project is still pretty premature. As said, a team too small for mass production, lot's to add to the engine (including fixing the motion blur! ). First things first, then we'll look further. At this point, I simply can't promise anything to an investor. Unless we work 400% on it maybe, but I don't think the other girls in this house would appreciate that :)


What to expect anywhere soon then?

* A second tech-Demo movie is targetted end this year. Not a "cinematic" horror movie like before, merely a showcase of the Radar Station map we use to test objects.
* A third horror-gameplay movie is targetted somewhere next year.
* A (simple) website end 2011 / begin 2012
* In the meanwhile, collecting more people. Currently we are looking for 3D environment mappers, environment concept-artists, possibly 1 more audio dude(tte), and a texture artist. In 2012 we'll be needing an animator as well.
* When the team is big enough and oiled, we'll start creating actual game content.


"Julio Iglesias is in charge of the concept art?.
You mean the singer?"

Yes.


What color of underpants do you wear?

Transparent-blue or with a panda print.


Halflife2 / Source MOD

No, it's not a Source MOD, neither using another engine such as UDK. it's all coded in-house. And Yes, quite some contents from the first demo movie are from HL2 indeed. Not that I wanted to, but how the hell is a plumber/programmer to create those textures and sounds then? Creating that monster (and animating it) required the maximum of my programmer-art skills. Got to start somewhere. Can't attract good people if I show stuff like this!

Excuses, got to play dirty sometimes. The next movie however will have our own textures and sounds though. In fact, pretty much most screenshots on the Blog from this year are using our own texture sets.


"This stupid video made me broke my Shift key"

Apologees, we'll send a new one.


...Amnesia / Penumbra...

T22 is quite often compared to Amnesia. And that's a good thing! They managed to put down a f#cking scary game with limited horsepower as well. Though it's not inspired on Amnesia. Never heard of the game until recently when one of the team members gave me a link. As a matter of fact, I don't know much horror games anyay. Only played a Doom3, a few Silent Hill's and Gamecube Resident Evils. And Amnesia made me poop my pants. Isn't that ironic?

The gamestyle is a bit similiar though. In Amnesia, instead of fighting, you run for a single enemy that wanders the area. A lot more terrifying if you ask me, although the ability to defend yourself once in a while would be nice...


... The fat lady at the end of that Demo movie, wtf?...

That was just a joke, putting that photo of my girlfriend there. No, Polish women aren't that fat :) Though this woman is as flat as a 2D sprite as well.

Thank you all for reading and your (positive) feedback. It makes it all worth! Back to work now!

Saturday, September 24, 2011

Compressor, Part 1/2

In case you are a programmer or texture-artist, you probably have heard about DDS files or texture compression. But if you are like me, you may have skipped all those articles. Pfff, compression, who needs that? Bitmaps and TGA files work for me, Pixel-data is pixel-data right? Besides, I've been taught that compression makes the quality worse, and reduces the performance because in the end, your pixels still have to be decompressed to a raw format. So what's the point?

Well forgive my ignorance. Guess I'm still traumatized because 12 years ago, I couldn't figure out why my sprites had jaggy pink edges when using JPEG files. Oh yes, the compression did that. But although the quality / performance arguments are valid, texture compression actually gives some nice possibilities. In this post, I'll write about using DXT compressed textures in your OpenGL program, and the DDS file format that can store this format.


1. For beginners: (de)compression
------------------------------------------------------------------------
For starters, as the name sais, compression is a technique to store (large) buffers of data with some tricks to reduce the size. When it comes to images, we usually have a big array of bytes. In a classic RGB (24 bit) image, each pixel takes 3 bytes. 8 bit for red, 8 bit for green, 8 bit for blue. Some images also have an 8-bit alpha channel, which makes the total size of a pixel 32 bit. Calculating the total buffer size is easy:
.....width * height * pixelSize. 512 x 512 x RGBA8(32 bit) = 1 MB

Cool, but 1 megabyte for a pretty small texture is huge (1 floppydisk!). Older photo camera’s would have their SD cards full after just a few clicks. So, that's why JPEG is often used. JPEG uses Huffman encoding, which is based on the probability a certain piece of data (pixelcolor) occurs. If we only have 20 different colors in an image, we can index the pixelcolors with a 5-bit (=32 possibilities) code. Further compression can be done by giving frequent colors a short bitcode, while rare colors get a longer code. Well, for a way better description, check this.

Smart huh? However, compressing the image has three main disadvantages. First there is usually quality loss. You probably have seen blurry blocks in JPEG images, especially when the color contrast is low. To put it simple, most compressed images NEVER reach the quality of a raw format (such as BMP or uncompressed TGA / PNG). Then again, if the resolution is big enough, compression settings are ok, and/or the small details don't really matter anyway, the loss is acceptable.

Second problem is the decompression-time. It simply takes some more time to convert the cryptic pixelmess to a raw format. Your video-card needs to produce raw (RGB 8-bit) pixeldata first, before the monitor can show it. Compare it to translating a Chinese movie to English. First a translator has to write down the English subtitles or do voice acting before it can be shown on TV. This process takes some time.

A third little problem is the compression itself. Just like decoding, encoding takes some extra effort as well. Luckily computers are fast these days, so you won't really notice. However... it's not fast enough to do many textures on the fly while rendering a game. This is why it usually happens "offline":

1.- Create your image (photograph / paint / capture raw data)
2.- Compress it in whatever file format
3.- Load in your application
4.- Decompress it back to raw-data
5.- Use (render) it.


Usually some quality loss is acceptable.


2. Compression & realtime Graphics
------------------------------------------------------------------------
So far, the only main advantage of using compressed images, is the reduced space on disk. You can't just load a JPEG and send it to the video-card texture memory right away. Nope, first you'll have to decode the data, then send a raw buffer of colors to the video-mem. So in the end you are still using the same amount of memory, it took extra time to decode, AND you lost quality. In other words, screw JPEG or any other compressed image format for graphics.

But wait. Things have changed a bit. Video-card memory has grown a lot last 10 years. From 32 MB to a gig or more. Unfortunately, games grow even faster. We want ultra-high res textures, and LOT's of them. Using all those textures at the same time requires quite a lot memory space, and bandwidth. Bandwidth? Imagine 10.000 hungry fat guys. You need 100 mcDonalds trucks to transport hamburgers. If all those trucks need to travel through a tunnel at the same time you get traffic-jams. Wouldn't it be nice if a single truck can carry more hamburgers, ending up with less trucks?


So, the graphic masters came up with compression algorithms specially designed for video-cards. I'm a newbie here as well, so I can't tell you the fine details, but you may have heard about DXT1, DXT3, DXT5, S3TC, BC1..7. Each of them is a compression method. Picking one is a trade-of between quality and space, and it also depends on what kind of image you want to compress (a normalMap, a simple blurry texture, a grayscale image, transparency yes/no). The compression ratio can be up to 1:6, which means a 1MB texture becomes ~170 kb.

The way the pixels are trashed together, is compatible with OpenGL / DirectX. That means you don't have to decompress the pixeldata first, before sending it to the videocard. No, you can send the packed buffer right away. That means the video-memory will be spared as well. Decompression happens on the fly by the hardware. I'm not sure if there is no performance penalty at all, but it seems the hardware can read compressed data just as fast as raw data. In fact...
you can even boost the performance! Remember the mcDonalds trucks? Since you need to transport less data on the buses, there will be less bandwidth issues as well. Now you probably won't notice this is you were only using a few textures anyway, but complex scenery such as a FPS game can benefit... Up to 20% according to some!

So far only 10 different textures are used in this snapshot. Or well, actually 20 as most objects also use a second or third image (normal/emissive/specular/height Map). Most textures have a resolution of 512x512 or 1024x1024, RGBA. So in total, there would be around (1024*1024 * 4(rgba) * 20(textures) = 80 MB of texture data pumped around every cycle (mip-maps, shadowMaps and deferred buffers not included). With compression, we can reduce this to ~20 MB.

Another cool detail is the loading time. Since you don’t need to convert stuff, and your harddisk or Blu-ray has to read less bytes, streaming goes faster. Who doesn’t like fast loading times? Tower22 streams maps and textures in the background while playing, so faster streaming is certainly nice.

Advantages
+ Less space required on disk / CD-Rom / Floppy disk / Blu-ray / Tape
+ Smaller files are loaded / streamed faster as well
+ Pre-build mipMaps in DDS files make the loading even faster.
+ Less space required in the video memory
+ Less bandwidth required. *Could* be a performance win.
+ Less quality maybe... but you can use bigger resolutions as well!
Disadvantages
- Quality loss. In some cases, compression is not worth it.
- Extra offline steps for the artists to produce compressed (DDS) files.

About the quality loss, this depends a bit. Matt(MJP) gave me some tips:

* Chose the proper compression methods
......- DXT1: Lower quality, higher compression, 1-bit alpha only(on/off)
......- DXT3: Better quality RGB, 4-bits for the alpha. Suitable for transparent ...... textures like foliage or a metal fence/grate.
......- DXT5: Suitable for images with smooth alpha channels or for normalMaps. Compress R and G, reconstruct B in shader.

* Use the right compression tool (nVidia, ATI, Microsoft, ...). Some do a better job than others, so carefully pick your weapons.

* You could pick a bigger resolution to compensate the quality loss, and still use less space in the end in some cases.

* Keep the option to use uncompressed textures, in case the quality sucks too much hairy balls.


Okidoki, but how in the name of SaintCrap can we make use of it? Consider three steps:
1.- Create a file with compressed image data... DDS files!
2.- Load the file in your program
3.- Create a (OpenGL/DirectX) texture using the compressed data

Next time, I'll tell you how to create DDS files, how to load them, and how to create an OpenGL texture using an (DXT) compressed image. Now it's time for beer.