Thursday, December 26, 2013

In the year 2014

Merry Christmas assholes, and of course, a healthy & productive 2014! Build a house, find a job, finish school, realize dreams, loose 30 pounds of Cheeseburger fat, merry your woman, finally paint that fucking shed, buy a new car, play less & program more, don't always want to have the last word, learn how to play a guitar, invite your family, start writing that novel, raise your kids, help the poor, be a better man. Whatever you do, do something, and do it with your heart.

As for flaky good promises, here some from the T22 department:
* Finish the official demo movie early 2014
* Finish another little bonus movie early 2014
* Push demo to (Dutch) games magazine & recruit
* Make it possible for artists to earn a bit with their work
* Possibly start a crowd-funding campaign
* Start making a Playable Demo - yes, something you can download

The next official demo should have been finished already, but you know, I'm not a God that can turn things the way he prefers. The good news is that all 3D maps, props and textures have been made. Audio still has to be done, but usually the guys are very quick with that. The biggest obstacle is animating. We have some real animated stuff here, rather than breathing blobs or programmer-"art" Milkshape animations. Besides needing time to produce the animations, it also takes some programming work to handle the incoming files. Let's just say FBX & Collada aren’t very cooperative when it comes to skeletons & rigs.

The other "bonus" is a little experiment I'm doing in the meanwhile. Don't expect too much of it, and it might disappear soon from the internet again because of some reasons, but nevertheless, it should be fun. Below a little taste. It should be finished pretty soon because I'm doing all the maps myself. Yup, programmer-art again, but at least I'm pretty fast once I got my teeth in it. And to make it look a bit nice, we have several textures & props we can reuse by now. Having a library of "stuff" can truly boost the development speed!


What could it be?


The future of T22
----------------------------------------------
Far more crucial for 2014, is how we continue this project. As pointed out above, progress isn't exactly... fast. Honestly, it's way too slow to achieve a "product". Something finished, something that can be sold. Of course the goal is not to make a 30 hour game that beats the shit out of all other AA-titles. Not that I don't have enough story and ideas to create a true full game, but the marathon would be of epical Duke Nukem Fornever proportions. I wish it was different, and three years ago, I honestly thought it would go a bit different, but the bottom-line is that you just can't create a full game with a handful of hobbyists / part-time artists. At least not with the ambitions and quality requirements Tower22 has.

I'm a dreamer, but not stupid. Something has to change, otherwise you'll be reading the same kind of Blog updates, watching some random screenshots, and having a little demo-movie once in a while for the next 20 years. As stated above, the next demo(s) are used to attract new talent. As usual, we'll need guys that can produce 3D environments, props, and draw textures. We also need a few concept artists, and someone who's going to make that damn UI finally. But practice from the last three years taught me that getting people that are A: talented, B: want to commit for free, and C: have plenty of time, is an almost impossible combi. You won't get a full bottle of super quality 100 year old whiskey for free either.

But moreover, if you are lucky enough to find talented people, it seems to be even harder to keep them, or at least have them so much motivated that they are willing to spend a sufficient amount of their time on your project. They simply have other things to do. Usually in the beginning they are motivated, but Tower22 isn't the kind of product you can finish within a month or half a year. It will take years. Of course you can chop it up in smaller milestones or targets, like the movies we have. But even a seemingly simple movie can swallow a year if you don't have the whole team working on it in second gear. I'll spend somewhere between 12 to 25 hours a week on T22. But the sum of hours the rest (~10 men) spends, varies between 0 and 15 hours. Sure there are peaks, but by default, everyone is occupied with study, work, family, personnel issues, freelancing, or just chilling out. If I'm lucky, one or two persons "wake up" for a week, and produce something. Usually they do a very good job, but the pace is too unpredictable to plan anything. It makes the progress slow, and it demotivates another to force themselves spending time on the project even when they're not 100% in the mood.


That sucks, but it happens to pretty much any "hobby" project. Whether it's producing a game, or making music with your super awesome gothic garage band. People need short term satisfaction. Very natural. The reward could be dumping a cool movie on Youtube and getting nice reactions, it could be mastering a new technique and feel proud about it, it could be meeting up with friends and having a nice day practicing your hobby. And obviously, it could also be a cash reward. Hey, you don't wake up every day for work just because you like it so awfully much, do you? Don't worry, 99% doesn't. I like my job quite a lot, yet I still need to be forced to be there every morning, every day, and night if needed. Salary, compliments, challenge, satisfaction, but also a "penalty" when not doing what you’ll have to do, are the well known tools to achieve that.

Components like salary and penalties are often missing in hobby projects. Challenge and satisfaction might be there, but don't underestimate that repeating the same thing over and over again, like making 10 different corridors, isn't exactly a challenge or satisfaction anymore. Even the coolest movie- or game projects are made of hundreds/thousands smaller, repetitive, boring tasks. But at least those employers pay a salary to compensate.




Nobody on the dancefloor
----------------------------------------------
Well, you get the point. Just making another demo-movie and initially attracting 6 new artists, is still no guarantee for future success. In practice, 75% will walk away sooner or later, and/or just doesn't have the talent or dedication you hoped for. You'll be blessed with the remaining 25% (or whatever number), but don't put your tools in a dusty box, rusting away. Making a big project like this, is a team effort. Everyone needs to help & stimulate everyone. Easier said than done, because in pretty much all cases, a newcomer doesn't know any of the existing team members. Duh, that happens at regular work too. Yeah, but at least there you meet your colleagues every day, you speak the same language, and if your boss is a wise man/lady, he organizes events with alcohol a few times. Team-building. I'm a shy guy, so I won't bother anyone with questions or personnel stories. But... if you know you each other longer and they remember you dancing the Macarena, losing your balance and falling flat-out on the floor during that Christmas party, things will go “smoother” from then on. You broke the ice. Literally maybe.

You don't have that luxury with the average hobby project organized via internet. Although half of the T22 members lives in Spain, and a few actually met each other, it’s just very rare that people have a real bond in this context. I wish I could invite them here for a Christmas party and dance the Macarena, but it's just not possible. And making jokes or get drunk together via Skype is... meh, not my cup of tea either. As a result, we don't really work as a team. I'm sure efforts can be done to boost that, using the internet. But me myself isn't much of a very open, social creature, neither do I like Skype, Facebook, Twitter or Social Media in general. Thus, I'm not the best type of glue holding them together.


Social Glue
----------------------------------------------
Right right right. Plenty of issues. We all get it why the Tower22 development is slow and hard. But it wouldn't be Christmas & (almost) 2014 if we couldn't bring a positive message, filled with Hope and light! As for the social contact thingie, I will focus the upcoming demo-movie on Holland. Not that outsiders aren't welcome anymore, but I truly hope to find at least a few persons somewhere nearby. Someone I can drink beer with, invite for a weekend to work on T22, and speak his or her own language if there are difficulties (or jokes to make). A group of friends is capable of doing more than a group of scattered individuals. And hopefully groups of friends can be a fundament for the rest of individuals as well. If you get a new job, you usually try to join a sub-group within the company that feels most comfortable, don't you?

Unfortunately, the Netherlands doesn't exactly have a booming games-business. The only big company I can name, is Guerrilla (makers of Killzone). But I refuse to believe we aren't creative with 3D tools. So I'm hoping a lot of Dutch are just waiting for a fun, nearby project they can hop on. I tried to find Dutch game-dev communities, but either I didn't search hard enough, or they just don't really exists. But, pretty close to my living place, you can follow a game-study since 8 years or something, and we also have a popular games-magazine (also known in Belgium). So, if we can contact them, they hopefully promote us a bit, waking up the regional hobbyists. And if that works out, we could try to do the same in Spain, or other places. Making local clusters, each with a team/beer captain.


Money money money, it’s so funny.
----------------------------------------------
Getting good people is one thing, keeping them (working) is another sport. As said, we lack reward & penalties. Of course I can’t kick someone’s ass because he decided to play FIFA14 instead of making a box with 3D banana’s. But what we can do, is introducing a reward, and “punish” by not giving a reward or the nicer jobs to those who aren’t productive.

Only problem is that I didn’t born in an oil-well. Neither did we win the lottery, or did I chose to be a banker for a living. So how to reward in the first place? It will be hard indeed, but not impossible. There are some ways to create a (small) budget for this project:
• Be patient, be super lucky, and get in touch with a big investor
• Start a Crowd-Funding campaign (for example, “Kickstarter”)
• Open a “Donate” box on this blog and/or the website
• Invest yourself
• Allow artists to sell some of their work made for T22

The first option might be possible if you have a truly nice showcase. But in order to generate that showcase, you still need to produce something first. When it comes to actually realizing a full game, it might the only real option, but it’s long-term stuff. Not something we should count or hope on for 2014.


The Asset Catalog
----------------------------------------------
The other money-making-tactics are easier. The last one for example is something we can start with today. Artist makes something (3D object, texture, audio sample, …), and then puts it for sale on a website such as Unity. The income isn’t meant for T22, it would be too much of a hassle to make deals. For now, I just hope it will boost the artist to get things done properly & ASAP. If he makes 200 extra dollars with a rusty metal barrel, good for him. I’m just happy he made that barrel in the first place. If the summation of assets really generates a big income for artists (which I doubt), we can always re-evaluate this strategy and look for a system where T22 promotes their assets and catches X% of the income. But let’s start simple.

Of course, an artist can’t just sell any object made for T22. Some are real specific eye-catchers or game-items. So what I did, is setting up a big listing of assets in “Asana”, a (free) web-application you can use together for planning and describing tasks. For each asset, I’ll tell whether its sellable or not. If the artist actually wants to sell the asset is up to him. The only thing he has to do is asking permission, and put a T22 logo/link with the asset (which hopefully generates a bit of additional traffic).


Too much liquor filled chocolates this Christmas

Pay-per-Asset system
----------------------------------------------
Asides from telling whether an asset is sellable or not, I also attached a bounty price on each. Wanted, a stinky cowboy hat. Reward 8$. That kind of stuff. The idea is that, IF we have a budget, each asset will be produced for a small reward. If all goes as planned, something like a table or chair object would gain you 16 or 20$. The more complicated or rare objects (or drawings, or sounds, or rigs, or …) come at a slightly higher reward. Nope, you won’t get rich of it (unless you are a robot producing assets 24/7), but it’s always better than nothing. Hey, if you produce one or two asset per week (instead of a small, random amount per few months like now), it would give you a nice little monthly bonus. And maybe even more if you manage to sell the same item as well. Do the math.

The most important aspect, is that people get boosted to keep going. Even on the slightly boring tasks. If 8 artists make 3 assets per month average –which is very reasonable- it would mean 24 assets per month are made. If the total amount of assets to-do is 400, it would theoretically take 17 months to get all the work done. Look, now we can plan something. And I’m convinced that once a couple of artists are really steaming, it’s far more easier for others to get sucked into that flow.

One thing I like in particular about this system, is the simplicity. The artist either accepts or denies the offer. Then in the end, I’ll accept the result. Or not. It’s all on my terms. That makes me sound like Saddam Hussein or Stalin, but the last thing I want is arguing. You know, money “enables”, but also makes people dirty. I can’t verify if an artist spend 10 minutes or 10 hours on an object. I can’t judge how much sweat it took to curve a nurb in Maya. If we had to discuss the reward for each asset, it would become chaos. My way or the Highway (hush, I’m a very reasonable guy).




Go go Kickstart rangers
----------------------------------------------
Nice, but now the real question. How to get that budget? Based on a Playable Demo, I wrote down pretty much all assets in Asana. Each with a reward, a bit of information, whether it can be sold or not, et cetera. Based on the numbers (+ some extra margins), I came to a conclusion that 7.000 to 7.500 USD would be sufficient to get all those assets made. That excludes my programming work btw, since that is very hard to classify in small tasks. I can make a particular technique, but usually it’s never really finished. Anyhow, now that we know some numbers, we can start accepting donations.

I never really liked the idea of asking for money. I see, smell, drunken hobo’s begging for a dime so they can buy liquor and poop their pants comfortably. But, several people here suggested to accept donations nevertheless. I explained my objections, basically telling I don’t want to steal someone’s money on something I can’t 100% guarantee. The most beautiful reaction I got on that, was somebody saying I stole their chances to invest on a product they like to see happening. Touché.

Opening a donation box shouldn’t be too difficult, plus I can donate on a monthly basis myself. As shown above, we don’t need ten-thousands of dollars. Yet, I’m not quite convinced that this will bring us a budget of 7.500 USD. And notice we may need a bit more for web-hosting a 1 or 2 gig demo, or whatever expenses I forgot about.

One popular way to collect a certain amount of money, is using a Crowd-Funding website such as Kickstarter. Our target would probably be 11 or 12 thousand USD. I believe about 2k disappears again into the pockets of the website, so we’ll keep 8 or 9k. 7 or 7.5k is used for asset production, the remaining budget for God knows what.

Getting 11 or 12K doesn’t sound like a bridge too far. I tried to keep it relative low to increase our chances (it’s all or nothing with Kickstarter, you only get your money if the target was reached). The only technical difficulties might be taxes, and the fact that I can’t use Kickstarter as Dutchman in the first place. Oh shit. But I’m sure there is a workaround.


Promises, promises: The Playable Demo
----------------------------------------------
But maybe more important, no one will spend money on vague promises. Tower twenty six? What the hell is that? Obviously we need our demo movies more than ever this time, because without recent stunning visual materials and vivid discussions on the webs, you’ll be doomed. Second, you’ll need to win trust. T22 delivering nothing but a few short clips the past 3 years doesn’t sound like a very wise idea to spend your Bitcoints on. Maybe a few über-hardcore horror fans will do (hello), but we probably need a bit more than that to reach the target.

We need to be open & transparent about our goals. We need to be able to produce something concrete, in a reasonable amount of time. For that, I thought about a Playable Demo. Something you and I can download, for free. A real piece of the Tower22 game. A small piece, say about 15 minutes of gameplay. But a piece nevertheless. Something that will make you hungry for more, and hopefully unlocks bigger opportunities for collecting a budget to produce an actual 1st Episode.

The truth is, we can make that demo in ~1.5 years, IF there is a budget & a bunch of motivated artists. Probably it won’t run like a charm on any computer. You won’t get the best graphics or super intuitive physics. But you should get an interesting little journey through a part of the Tower, including some puzzles, filthy gore, and not so nice entities that keep you running (or hidden under bed). A teaser.



Well kids, once we actually get to the Crowd-Funding phase, we’ll sure notify you again. With a shorter, more powerful text. And with fresh screenshots, drawings, and one or even two demo movies. You as a loyal reader has the right to know what we’re up to. And yeah, we are up to something. We are just as slow as Halflife Episode 3, but at least we try to show you or even get you playing in the meanwhile. But first, enjoy these days. Sometimes, there are more important things than making video-games! Good wishes.

Tuesday, December 17, 2013

Upskirt


I want to ask you something awkward; How about using fixed-camera views in this horror game?


Just draw or photograph the background, no poly penalties, need for impossible shaders, light limitations or other nonsense. Everything was better back then.

Fixed-what? It's not unlikely that some of you younger readers that grew up with almost photorealistic graphics, Virtual Reality and Cybersex don't know that ugly word. Retired readers on the other hand probably vaguely remember old games such Alone in the Dark, Metal Gear Solid or the first Resident Evil games. It wasn't uncommon for early 3D games (and also “2D” adventure games such as Monkey Island, Phantasmagoria or Myst) to put the camera on fixed spots within the environment. Depending on the player position, the game would pick a pre-assigned camera (usually the closest or "best" point of view).

Now why the heck would you want that? Well, on old hardware, it makes sense. A fixed camera only sees a (small) fixed, predictable part of the geometry. No complicated culling algorithms are needed to keep the rest of the environment hidden, out-of-sight lamps deactivated, or prevent off-sight textures to eat (back then extremely scarce) video memory. This gain of performance usually allowed the creators to spend a bit more detail on the fixed scenes. Meaning bigger textures, higher poly characters, or better quality lighting/shadows. Hence, if the environment was really static, they could even take a snapshot, Photoshop it, and project it back in the game as a semi-3D environment. High-end graphics, low pricing.


Despite the static nature, the Resident Evil Remake was certainly one of the better looking games for the Gamecube. Being semi-3D, time and sweat that would normally be wasted on getting the requirements for rendering this as good as possible in realtime, could now be spend on some photoshopping / tuning of each individual snapshot.

Not sure how they did it, but probably they baked the static scene into an image with a high-quality offline renderer. In the game itself, a (simplified?) 3D mesh is rendered with this high quality image pasted on top. Being still 3D, the environment can cull the player if he walks around a corner, or catch shadows. Being very simple, more resources are left available for super-ultra-awesome(back then) techniques such as the water reflections, or the relative high poly character.


Of course, fixed camera views don't work very well for 1st person shooters or quick action games in general. You would get sick of the ever changing point of view while rushing through the stage. Another thing, using fixed-camera's sounds like cheating. Powerhouse graphical engines do their best to show as much real-time capabilities as possible (see my silly hunt for real-time G.I.). And in the year 2014, erh, 2013, they seem to be quite capable of doing that. But it’s not just high-res textures and fancy lighting that steals the show nowadays. Dynamics such as destructible buildings, rotating fans with volumetric lighting, or large rolling water waves are the eye-catchers these days. Motion, my friend. Fixed camera's therefore got dated. Probably it still exists here and there, but "Resident Evil Zero" on the Gamecube was one of the last games I played using them, and that was more than 10 years ago.

And before we forget, people weren't exactly charmed by the fixed camera. In RE, shooting a sluggish zombie should be an easy job. But as you often couldn't see the enemy coming from a certain point of view, those slow assholes were still able to catch you. Not fair! Aiming a gun was hard, spotting enemies was hard, and NOT walking like a drunk 600 year old statue was even harder, as the joystick directions change each time the camera changes.


And then there was Resident Evil 4. Third person view, fluent aiming system with a nifty laser pointers on your gun, a slick & agile Leon Kennedy that could roundhouse kick doors, and... shoot, it wasn't scary anymore. Leon's new super-abilities made killing zombies childsplay. To prevent the game from getting pathetically easy, they swapped the slow zombies with hordes of somewhat smarter, and especially faster, "angry farmers". The tactic of Surprise (Boo! a zombie in the closet!) was replaced with the tactic of Overwhelming. Murdering a single “Cabron” was still easy, but having fifteen of them chasing you with burning torches and rusty manure forks could be risky if you let them pin you down in a corner. Mobility & making fast decisions was the new name of the game, and changed Resident Evil in a radical way.

Don't get me wrong, RE4 was/is an extremely addictive, fun, action game. One of the few games I finished multiple times in a row. But scary... meh. An adrenaline rush yes, but not the type of game that makes you want to hit the "Power Off" button because you aren't in the mood for nightmares. Ironically, some of the people that complained about fixed camera's and stupid door scenes, now complained about RE not being so scary anymore. No shit Sherlock.


The typical top-down camera's, close to the player, didn't really help to get an overview of the situation. Zombies could be anywhere. Behind you, uhm, under your feet. Oh, and in closets of course.

Not saying that it's impossible to create a scary game without door(loading time)sequences and fixed camera's, but I think a lot of people missed the fact that RE was scary partially BECAUSE of that damned camera. Zombies were slow, doors opened slow, the game was slow. You could hear them moaning, but couldn't tell if or from which direction they exactly would come, as the fixed camera rarely gave an overview of the entire room. That made cowardly sniping your foes down from a safe distance, almost impossible. You had to wait if/when they entered your TV screen, then quickly shoot them. Slow & cheesy terror, but yet it worked. Basically, the camera just made the game hard enough to be scary.

Having first-person-view powers on the other hand would make you a God, running through the house like The Running Man, shooting or avoiding everything in your way, finishing the game within 30 minutes. It's the reason why modern zombie games like "Left 4 Dead" use gigantic flocks of upgraded super-zombies. If they didn't, the game wouldn't be a challenge, and thus not fun at all. But as described in my previous post, a continuous flood of raging monsters and blood usually doesn't make a game scary. The classical Resident Evil ghost mansion atmosphere is gone (and even if they attempted to re-create the old feel, the story has become so absurd and stupid with the 20 sequels, that it can't be saved).


Another reason to chose fixed camera's (or at least partially fixed, it doesn't mean the camera is always frozen on a single point) is to boost the production. Hmmm? Making an engine that renders potential big environments, is tricky. You have to cull invisible objects, fall back to lower LOD's for distance stuff, decide which lights are used for casting shadows, make sure everything in the background is loaded before you can see it, be careful with resolutions and object counts, et cetera. Well, I like that challenge, but we have to be realistic as well: we don't have billions of people, hours, resources and money to create a big-ass game.

Asides from technical issues, picking fixed camera views allows to cheat as well. Usually I have a pretty good idea how an environment should roughly look. But in a setting that repeats itself a lot (flat = apartments, corridors, apartments, corridors, app…) it's hard to make each corridor unique. The more square meters you have to decorate with planks, wallpapers, blood decals, paintings, cracks, flowers, or whatsoever, the harder it gets. And everything you make, has to look good from all possible camera-angles. Shadows, specular highlights, lamp halo’s, volumetric shafts, lens-flares or reflections can create an interesting scene. But view the same scene from the other side, and the result might be dull because those elements didn't quite work out from that particular position. You can’t just snap an World-Press photo from any angle either.

With a fixed camera, you can for example keep the ceiling invisible (I hate figuring out how each ceiling should look different). If you chose to render a certain wall or object from a distance only, you don't have to produce a super detailed mesh or normalMap for that object either. If the lighting doesn't work out fully for angle-X, you pick angle-Y instead rather than tweaking parameters forever that enhances one scene and screws up another. Hey, you'll do that all the time. Each time when I take a screenshot for this blog, I'll try to pick a point of view that looks the best.


Like a photographer tries to find the best spots and angles, Camera's can be placed to serve the scene in a certain way. Same door, but the top one looks more threatening due its size, as the camera was placed in "Dwarve perspective".

Again, I'm not saying Tower22 will suddenly change the camera. I always had this game in mind with a First-Person-View, so I'll try to make it that way. But the advantages mentioned above -some extra difficulty/fear + easier technology + less assets to produce in huge detail- sound very attractive. Think of it this way, would you rather have a finished game that cheats with camera's, or no game at all because it was too much work for a group of hobbyists? You know most FPS games either look mediocre, or had a super-budget and a very experienced team making it. If a fixed-camera can help us, we shouldn't just drop it because it sounds old fashioned and people complained about it (and then complained RE4/5/6 weren't scary anymore).

Anyhow, to you, the Fixed-Cam would be:
* Still have no clue what is
* No,no! NO! NOOOO!
* Don't like it, but if it helps the production of this game...
* Don't care, I'll play anything
* Fuck yeah, I missed them ever since

Sunday, December 1, 2013

Bloody hell

Horror game, blood. That matches like meat & barbeque, gunpowder & boom, baby & poop, Japanese & Hentai, or Eurosong festival & shit music. And T22 is no exception, although I believe buckets of blood don't necessarily make a scary setting. In contrary, overdo it, and it becomes an ordinary chocolate-cake throwing fight. Some of the more bloody movies I know, where more humorous than scary. While the real messed up movies weren’t that gory at all usually. Though The Shining had a few short bloody scenes (the flooding corridor & slashed kids), the major fear effect came from an overall, slowly evolving madness in that hotel. We all know the twins, but to me, the particular scene depicted below, was the most disturbing. I still have no idea what the hell I’m looking at here. And it isn’t just the picture that’s absurd, the way how the bear/dog/whatever costume guy(?) slowly bows back, is just freaking unreal. Bad dream, bad dream!

Speaking of The Shining, I picked up “dr. Sleep” a few weeks ago, Stephen Kings official successor to The Shining. Little Danny becomes a big drunk Danny –like daddy-, and tries to make something useful of its life and unfortunate gift to see dead people. In the meanwhile, a cult of vampire like “human” is cruis’n through USA, feeding themselves. With paranormal kids.

About halfway the book now, and all in all it’s an amusing read. But scary… maybe I’m too lazy to get myself scared, but it just didn’t really happen so far. Dan’s fight against his visions and alcoholism is very convincing. The vampire family on the other hand may have been better in another book. Twilight or something.

Anyhow. Back to blood and intestines. One thing that annoys me in quite a lot of movies and games, is that –despite modern technology- they don’t always draw it in a convincing way. And I’m not talking about German games (in Germany, all organisms have green blood). You shoot a zombie, and instead of old dried brown chunky guts, it sprays pink juices. You blow up a bunch of soldiers, and all you get is some flying ragdolls and orange sticky “Gak!” flying around. You chainsaw a bear in half, and 4 seconds later the room looks clean again as all the mess was cleaned up by invisible Mexicans. If the blood doesn’t look disgusting, the whole “eeeww gross!” effect will be ruined in a split second.

Mortal kombat
Bicycle-kicking someone in the face would spawn some greyish sweat-stuff in MK1. Something with censoring. The second MK on the other hand opened Pandora’s box. A single uppercut could spawn three ears, six eyeballs, and more liters of blood than a human can actually carry. Excellent!


Three heads?! I'm not kidding, the very first shot I found on MK.

As I said, a movie or game doesn’t necessarily need blood to be scary, but if we do it, we’d better do it good. I liked how Doom3 or Silent Hill did it for example. Silent Hill didn’t forgot to hire invisible Mexican cleaners, the entire SH world looks like if God took a gigantic crap on it. Thin bloody splatter diarrhea to be more precise. Blood doesn’t automatically generate a scary setting, but in Silent Hill everything is so dark, foggy and dirty, that you almost can’t breathe. Literally. Discovering a clean, “normal” room in SH feels like a relief. The continuous overwhelming “filth” brings the player in an unreal, nightmarish, uncomfortable setting. Doom3 wasn’t that much of a shithole, but I found it really interesting to study the shiny specular lighting (quite new at that time) on the bloodpools and slimy intestines that penetrate the Mars base. Then looking at a modern game like Crysis 2 again, the blood effects look like Play-Doh.

Tower22 will become quite bloody here and there, though the focus is not on gore. Most of the environments won’t be decorated with pig stomachs, and neither will you decapitate a whole lot of monsters. But if the red magical fluid makes an appearance, we’ll do our best to make it look like Hell. Easier said than done though. And this is where the post becomes slightly more technical. Since realtime fluid dynamics are still far away from games, most blood effects are based on decals and flying particles. If not done carefully, particles quickly become like a simplistic MS-Paint Spraybrush of red pixels.

Decals might be a bit easier, but also have some special features. Like most liquids, blood is reflective. But not for too long, as it gets soaked by the surface, resulting in a dried, dark-red / brownish spot. To simulate such characteristics a bit, you’ll need to pick a good blending method. Standard transparency methods may result in a red pool that doesn’t blend very well with its underground. Multiplying seems to work much better, but I found the resulting colors still too reddish and bright in my test cases. So, I implemented a “Color Burn” blend method. It doesn’t always work out either, but on the majority of somewhat darker undergrounds in T22, you get a nasty, dark & rich fluid.



Another effect you rarely see (last time for me was in Duke Nukem 3D), are the fluid dynamics itself. Once a decal splats on a wall, it sticks there as if you shot a red paintball pellet. If the surface is smooth, the fluid would likely pour down though. Or how about shooting someone wearing a nice blue sweater? If games support decals on characters at all, they often show you a big reddish hole straight away. In reality, you may not see anything for a moment, then a darkish circle starts appearing and growing on that nice blue sweater. Not very relevant for T22 monsters, as most of them will be naked likely. But the point is, if engines would put just 0,1% of all their graphical artillery into making a bit more creative blood effects, the world would be a redder, uhm better, place. Since the majority of super-heavy-weight engines is made for shooters, it’s quite weird that they stick with 10 year old cheap tricks for gun wounds. Or maybe that has more to do with keeping the age limit below 18 for sales…


Used ingredients here: a projective decal with lots of red, some reflections, and a burn-blend modus. Bon apetit!

Monday, November 25, 2013

The Business Traveler

No games, nor programming today. Instead, I wanted to put down my first trip to the States, goddamn 'Murica, Stars and Stripes and bold Eagles. Everyone has an opinion about our infamous cowboy friends. Varying from an example of freedom, technology and overall Coolness, to arrogance, war-seeking and financial crisis causers. Whatever you think, the overall trend hasn’t been a positive one in general.

With a bit of common sense, you can understand the average American isn’t directly responsible for big shot bankers screwing up, or its blood thirsty policymakers with double agenda’s. Just like the average Iranian isn’t responsible for its malicious regime, or average Russian for their corrupt not-so-Gay leaders. Of course, we vote for such leaders and people sometimes say “A nation gets what it deserves”. Western greediness reflects in its policy, narrow mindedness will bring scary leaders, and overall lack of IQ didn’t do much good in this world either. But what I’m trying to say is, it isn’t all black & white. Europe having a bunch of greedy crooks in Bruxelles doesn’t mean the average European supports them. Hence we didn’t even democratically vote for them.


Moon Shiners
------------------------------------------
But when I think about America, the words “Dumbness”, “Overdramatic” and “Shallowness” come to my mind. And not just “thanks” to MTV shows such as Jersey Shore or Supersweet 16. Man, I truly hate MTV. A few millennia ago you could watch nice music clips on that channel, but nowadays only the stupidest of the stupidest show their stupidity on MTV, compiled for ADHD children with a maximum concentration span of 4 seconds. But not just MTV, even Discovery or National Geographic turned from informative into nonsense documentaries. I don’t give a crap about crap talking crab fishers. What exactly is informative about a bunch of guys buying garage junk? If you aim a camera at some Dutch folks in an office, they will nervously giggle and hide for the camera, not knowing how to behave. But in America it seems as if everyone was born on (sex)tape. Shameless arguing all the time instead of just working, and sharing their deepest emotions with the camera. It’s as if the average American person could switch their emotional state from “I’m like soooo happy” to “Oh my God, Oh my God, oh my God!” to “I hate you, I want to die” in a split second. What a ridiculous show.

Right. These kind of TV shows imply a shallow, instable American character. Add Hollywood on top where action hero’s jump of buildings on a daily basis or music stars inspiring our kids while walking half naked on the stage. All in all, a weird bonanza, and you understand the rest of the world has kind of a weird image(mainly caused by Americans themselves) of the USA. The scary part is that, despite its dumbness, we (European) still swallow and copy this “lifestyle” regardless.

Well, time to visit America and see if it’s really all about hamburgers, big mouths, crying pregnant teenagers, and Duck Dynasty.


As you may know, I program harvesters for a living. This lady comes from our American partners. For a change not a million times bigger than its European counterpart, but big-ass nevertheless.


The “Yank Tank”
------------------------------------------
If I had to book a vacation to America, I would probably visit a big city, visit touristic spots, and still don’t really know what America is all really about afterwards. Well, I definitely want to make a Hangover road trip with friends one day, but basically the expensive flight tickets stopped us from doing that so far. Fortunately, you don’t have this cost consideration when such a trip is work-related. And neither will you see much of the touristic spots. 99% of the American landscape is filled with wild nature, farms, and widely scattered tiny villages. Cities like New York or L.A. are definitely important as an American “export product”, but we easily forget about the rest.
For work, we were visiting a partner company (Oxbo). You might have seen their machinery on cornfields for example. So, you can probably guess that these meetings didn’t take place in a big city. Swap the Devil Advocate skyscrapers for Countryside & construction plants in the middle of nowhere. Well, almost nowhere. Minnesota doesn’t have a dense population, but small cities or Minneapolis were still within reach with only 45 to 90 minutes driving… Which sounds like an infinity for a typical Dutch guy like me. If you drive for an hour in Holland, chances are very big you crossed a border and speak a different language.

We often make jokes about Americans and their obsession for oversized cars plus additional oil thirst. We wooden-clog-cheese-windmills know everything better; we pick the bicycle. Good for the environment, good for our health. But we tend to forget that the Netherlands is a miniature compared to most other countries in the world. In contrary to Holland, most of the American infrastructure wasn’t designed for cyclists. Hence not even for walking. But even if it was, I don’t see you carrying shopping bags for more than a mile, or going to work if you had to bike for more than 40 minutes. Cities or larger villages might be different, but the country side is really a far stretched version of what we are used to. And probably due the low population density, facilities like shopping malls or schools are combined as big buildings somewhere on a central location. Whereas we have lots of small shops and little schools spread all over the place. In other words, you won’t be anywhere without a car in America. At least not if you prefer to arrive in time on your job and rely on goods from a shop.

The size of the cars on the other hand might be a bit ridiculous. Not just the landscape is stretched, everything is stretched. The very first thing I noticed in America when leaving the airplane was the toilet. It was made for a Brachiosaurus. Then we rented a car. I was just explaining my colleagues I was looking for a car after many years of being carless. Not too big, not too small. Volkswagen Polo or something. Well, that would look like a joke in America. Every single car in that airport garage was at least twice as big. I can imagine a pick-up car is useful on the countryside, but c’mon. Also the automatically opening/closing doors and Kingkong sized cupholders (not one but two) in the car doors confirmed my prejudice about ordinary “bigger better fatter”. Even though the majority of the population is still sort of religious, Modesty is difficult to find sometimes.
Where we say “enough is enough”, they aren’t ashamed to step further.
Don’t hold on back on comfort.


Speaking of big vehicles, games, and our work. Received a nice email about a game called “Landwirtschaftssimulator” (agricultural-machine-simulator). Seems that a company called “Giants Software” made this game in 2008, and also used some of our Ploeger machines. The German guy who mailed was busy upgrading the 3D models of our machines in Blender. I don’t expect this game to beat GTA V, but it fills me with proud to see your work back on the field, Youtube, or even in games by enthusiasts. Maybe I should stop T22 and start helping them hehe.


Pork-stuffed Fries with crusty lard please
------------------------------------------
BUT! We drove quite some days before we had to refill the tank. So for such a beast, it wasn’t that consuming. And as for fat… I may have to watch my mouth. Because from all people I have seen there, I was probably one of the fattest myself. And no, I’m not THAT large either (big boned, you know) so the average person just wasn’t really obese. At least not where I visited.

Yet America is dangerous when it comes to easily gaining those pounds. As you saw, we take the car for pretty much everything. And although these area’s weren’t crowded with homo sapiens, the letter M occurred more than just once. It seems to me, that "having a good time" is really about stuffing yourself here. In (North) Europe, kids gather in narrow streets filled with bars to get themselves drunk (and get annoying). In America kids gather in plaza’s filled with restaurants to stuff themselves (and get fat). Again, this subtle cultural difference probably has to do with factors such as population density, norms, or a 21 age limit for alcohol.

Anyhow, the food wasn’t automatically hamburgers only. Actually, I had tasty & creative meals most of the time. And you can grab an orange with your breakfast, eat a banana at work, have lettuces with diner, or order water instead of Cola. But the problem is the temptation. I had a normal breakfast with juice and cornflakes. And… an extra doughnut or syrup wafer. Just a little one, but still. Lettuces have a fattish dressing, and the extra cheese on an otherwise healthy pasta doesn’t help either. On top, the proportions are fairly big. In Europe you pay a goddamn fortune for 2 thin sauce stripes on an empty plate. In America you get more than you can eat for a fair price. Same with the drinks. They really seem to love Cola. A guy next to me in the airplane ordered a Diet Coke. Sounds ok. But you can skip the word “Diet” if you order another 6 in a row like he did.

All in all, the extra yummy calories are everywhere, and since ordering food or going to a restaurant is so normal here, you can quickly fall in bad habits. You don’t have to, but it requires some discipline. So, it kinda surprised me to see the average person not being chubby in this region.

Bone apetit. Barf.

Land of the Free
------------------------------------------
“Fat” isn’t the right word here, but “Big” applies very well when talking about pretty much anything else. Obviously, there is space enough on this continent so why don’t make the roads wider, the parking spaces bigger, the buildings larger, the ceilings higher, and the toilets bulkier? At least it fits with the landscape, which is impressive. Of course I only saw a tiny, rural portion of America. It wasn’t very hilly, but the large cornfields, dusty roads, forest patches and rivers running behind the houses deliver a much more adventurous landscape compared to the boring Dutch one.

Don’t get me wrong, I can really enjoy seeing our cows graze in the green grass on a foggy morning. But it’s all tiny, and very “man-made”. Holland is absolutely flat, and tiled in a systematic way. Every square inch is used for something, and it’s nearly impossible to find a random point where you can’t see another house, road or lantern. We adapted the landscape to our needs. Truly a specialty of the Dutch, and very efficient. But at the same time, not very exciting to explore. Hard to find some wild nature here in the first place. America on the other hand adapted to the nature, and that gives some spectacular sights now and then.

What I liked is the variety of houses in America. Not a single one looked the same. Most made of wood and a bit old fashioned maybe, but I like that. In Holland we have qualitative good stone houses that can survive a storm. But they all look exactly the same, and the tiny fenced gardens aren’t exactly what the Americans would call “freedom”. It’s a bit ironic when we are accusing the Americans for playing Big Brother and spying the world. While we are being watched every single day. Maybe not by shady agencies, but by our very own neighbors, in our silly little gardens. If I give a party or fire an air rifle, the neighbors could complain and call the police. Which is why we have dozens of, sometimes absurd, rules to regulate everything. No campfires, no fireworks, no noise after 22:00, can’t paint your house in any color, can’t just plant a tree in your garden or make a shed that raises above the fence, no this, no that, argh.

And then I hear an American guy in the car talking about he bought gunpowder or likes to shoot with a real gun in his garden. Not a problem, because he can’t even see his neighbor houses. Now who is free really? Of course rules differ in the cities, and every pro has its con. Freedom isn’t for everybody. But I understand more and more why Americans are keen on their privacy, and patriotic about their forefathers who made this all possible in the first place. When talking about the Weapons Act, it’s quite obvious that there is a correlation between the quantity of guns and accidents. Obviously, one shouldn’t have access to a gun when he or she is in an emotional state of mind. But at the same time, it’s a deep rooted American principle to be “Minding my own business.“. He should be able to whatever he Goddamn pleases to do, whether that is owning a gun or making a rocket launcher in the shed.

We European want freedom like anyone else, but at the same time we don’t resist while one after another prohibition gets added to the book. Really, we, and especially Dutch, are tame sissies compared to the American in some of these aspects. Think whatever you want about war, but saying I’m ready to fight and die for my country –believing in its principles- really is something. Sure there is hypocrisy and stupidity about quite a lot of things in America, and their foreign policy hasn’t been honest I think. But we European shouldn’t forget that our wealth and privileges didn’t came from nice talks either. Rakes, fire, wars, exploration, colonies, protecting our believes. Pacifists can be pacifists because blood was shed to make a foundation first. Americans might be a bit too dramatic, we on the other hand might be too naïve.

Working all day and having early sunsets, it was hard to capture a "real American" scene. But basically this shot could have been taken anywhere in Europe just as well... Except in the Netherlands then, where you'll find a house or pig-shed otherwise every square meter.


Average Joe
------------------------------------------
Hamburgers, big cars, patriotism, a little bit more comfort requirements than really needed. But more important, how is the average American? Well, on our meeting I met Americans from West, East and mid-north America. Way too little people for making up reliable statistics, but nevertheless. I didn’t recognize any Snooki, George Bush, Hulk Hogan or Honey Boo Boo behavior at all. Which is a good thing. Well, not a surprise really, but they were all just normal guys. No emotional shouting and hugging at work, just capable people devoted to their work. Most are open, and have a good sense of humor. Neither did I found them shallow. The guys who I met before remembered a lot of what I told them in earlier conversations about family, hobbies, et cetera. “How is Tower22 going?” for example. Just a signal that they were actually listening and also the new faces I met were genuinely interested.

The funny part is that these guys were talking about shows like Duck Dynasty or MTV Cribs with the same kind of disbelief / amazement I have. In other words, those TV shows really don’t represent an average American. Although, at least that was what one of the guys told me, it can vary quite when going to the cities. They considered the Las Vegas people for example “crazy”. Course, every country has differences between provinces, rural and urban, or layers of society. And in America those differences might be a bit more extreme. But don’t forget the country is huge as well. I think an East coast American is a lot more similar to a West coast American than a Western Europe Frenchman compared to a Eastern Europe Bulgarian. Cultural differences are a lot bigger in Europe really.


Another detail I noticed was the company hierarchy. In Holland it’s not uncommon to have the CEO eating sandwiches with the warehouse guy. Hence I’m not really high in the company hierarchy (though I’m the only programmer in Holland so I’m in sort of an exceptional situation), but I can walk in the director’s office any time and make a joke. Which is quite different than neighbor countries such as Belgium or Germany, where (as far as I know) the hierarchy is far more strict. I expected the same from our American partners, but it really wasn’t. Big chief shaking hands with the intern boys, remembering my name and have a chat, et cetera. Obviously, I like that. Although I believe in respect for the higher ranks, and discipline is sometimes dangerously low in some (Dutch) companies, people feel more involved and thus more productive when being embraced by the “big guys”.

Quite different from what I can remember from the movies, although one of the guys I talked with again confirmed differences between urban and rural companies. What we see on TV is often based on the cities, a different cup of tea. Anyhow, the point is, I didn’t feel like an Alien or “Englishman in New York” as Sting would say. We could laugh at each other’s jokes, have a nice talk with everyone, and learn from each other.



All in all, America isn’t a bad place to live. And neither is Europe (or at least the places I have been). Probably my body weight would quadruple when living in America, and I sure think they can be hypocrite or over-reactive on certain things. But sometimes I also wonder what the hell I’m doing here in a small boxed in house while I could have some serious “get off my lawn! + shotgun” property in America for the exact same price. Anyway. We shouldn’t complain. Neither should we found our judgment on movies and all of those stupid TV shows. We American and Europe have a lot in common (hell, most Americans came from Europe, didn’t they?). Too bad our leaders and other big shots sometimes almost remove the worldwide-relation-grenade pin when screwing up with needless conflicts, Financial crisis or other dumb policy. But at the bottom line, we can get along I’d say, so let’s keep it that way.

Sunday, October 20, 2013

Global Illumination in T22

Let's get techno again: Global Illumination. Maybe you noticed, maybe not, but T22 has some sort of realtime G.I. I probably told that a few times before, but I never explained how it worked. All right, here you go chap.

T22 uses a technique that has no name, because I made it myself (though others probably tried similar things). Or well, I copied ideas from existing techniques, mangled it with my own countless attempts, used some other advice, and added some poohah on top. But if I had to give it a name... "Ambi-Volume-Texture-Cone-Tracing"? Doesn't sound very neat... Anyway, let's explain how it works. Oh, and don't expect a perfect solution. It doesn't look as good as Crassin's VCT (Voxel Cone Tracing), although you could say they "cheated" a bit with powerful computers and a simple scene. Sponza Theatre a simple scene?! Sure, it has quite a lot polygons, but it doesn't have very thin walls (sensitive for light-leaks), and above all, it's just a single scene. In practice, game-worlds are much bigger. For example, you can't bake a whole GTA city into the (GPU) memory, so you have to chop the world in chunks and only process the geometry that is nearby the camera. That is possible with VCT, but updating the Octree that is required for this technique is very expensive.

In practice, all realtime G.I. solutions have problems. Either they won't work very well with moving objects (imagine a door closing & blocking light) / destructible geometry, they only work on fixed small worlds, they require too much power, lack accuracy, or just look terrible. Or all of that. Pre-calculated solutions on the other hand are much faster and offer better quality, but well, they aren’t realtime. That means the lighting won't adapt for shit when the environment or lamps change. Unless you exactly know which lights will change and pre-calculate multiple situations. Don't know how GTA V handles G.I., but I can imagine they bake the lighting for a couple scenario's (day, night, cloudy, ...), based on dominant lightsources such as the Sun, Moon, and pre-defined (street)lights.

For T22 I'm urged to fall back on pre-baked lighting as well. Simply because it looks better, performs better. And an often forgotten argument; it gives a better degree of control. Especially in an unreal horror game like this, you want to play with atmospheric settings. Make rooms much darker than they should be, use high contrasts, or add a stinky orange ambient to a corridor while there are no orange lamps at all. With realtime G.I., it's hard to tell what the result will be exactly. Especially if the results aren't exactly 100% accurate either. Sometimes it looks good, sometimes it doesn’t and you’ll be adding cheap tricks, completely bypassing the (expensive!) G.I.. But nevertheless... making realtime G.I. for games is as attractive as finding the magic recipe for Gold. It's a prestige thing.


Sponza Theatre, not rendered but a real photo for a change. Notice the whole structure is litten more or less, even though the light only comes in via the open roof. That's the kind of lighting we want to achieve. Realtime.


Not quite yet the real thing, but still one of the most promising realtime G.I. attempts so far, Voxel Cone Tracing by Cyril Crassin. Seems UDK 4 is adopting this technique as well.



Voxel-Cone-Tracing convinced me again that realtime G.I. is possible, and with good results. So I gave it a try. The idea in a nutshell:
1- Voxelize geometry - put geometry in octree (in GPU memory, using Compute Shaders)
2- Light voxelized geometry - add outgoing light in octree cells
3- Mipmap octree
4- For each pixel on the screen, sample bounced light with a couple of cone-shaped rays from the mipmapped octree


1- Voxelize your geometry
Like making a lower-resolution Lego/Minecraft block variant of your scenery & objects). Store those blocks in an Octree. Octrees provide storage and searching trees for 3D data. To avoid needing tons of memory, the octree will reduce resolution over distance (thus bigger blocks for distant geometry).


Excuse the lousy drawing, I was too lazy to get the perspective right. But you can see how a scene would get "voxelized" roughly. By rendering the "whole" (whatever could affect the GI in your view) scene in slices, you can get the whereabouts of your geometry and their properties such as normal and diffuse/specular/emissive colors. Note that I skipped the plant leafs and puppet. Of course you can voxelize those too, but be aware! It would constantly change the Octree as the puppet moves.

Why Voxelize & Octrees? VCT is based on Raymarching. Any given pixel on the screen will sample incoming light by sending some (cone)rays into the scene. We need to check where our rays intersect geometry. Octrees are a sufficient way to quickly test collisions. Memory is limited though, so we can't store each and every tiny molecule. Instead we store bigger blocks and use an octree so we only reserve memory for locations that actually contain geometry, rather than each and every cubic meter. Once we have an Octree, we can insert geometry data, light fluxes, and other data we may need to know later on.



2- Compute the direct lighting on those voxels
As you would normally apply lights on 3D stuff, you compute the direct lighting for every voxel. You calculate how much light a voxel would reflect back in the world ("diffuse light"), so another surface can pick it up again (indirect lighting).

Papers never explain how they handle big amounts of light, usually you only see 1 or 2 big lightsources, that stupid Cornel box, or an outdoor scene with the sun only. But you could handle multiple lights of course, and the good news is that there are relative little voxels (unless you use very fine resolutions). For each octree cell that contains geometry, you calculate the incoming fluxes from the 6 main directions. Eventually you could use Spherical Harmonics to reduce the amount of floats needed to store this information. So, now your octree cells contain this info: geometry yes/no (or density%)? Diffuse RGB reflected into the -X, +X, -Y, +Y, -Z and +Z directions. In other words, you have a low-res representation of your world, directly lit, into your video card memory. This is updated each cycle btw.





3- Mipmap the octree
On a 2D texture, Mipmapping means you half the size and for each new pixel you take the average of 4 pixels from the original resolution. On a 3D texture, the idea is the same except that you take pixels from layers above and/or below into account as well. And well, you could do the same for an octree. When constructing an octree, you subdivide a cell into 8 smaller cells if it contains anything of interest. So you can do the reverse thing as well. 1 to 8 Minecraft blocks get replaced with 1 bigger Minecraf blocked, made of the averages.

Why we need to Mipmap? So we can "cone trace". See next step.



4- For each pixel on your screen, sample indirect light with Cone Tracing
The key of G.I. is to gather light coming from all directions, bounced off by other surfaces. Simple theory, but extremely hard to do in realtime. A major problem is that we need to sample light from an infinite amount of directions. Imagine you were a piece of concrete wall; everything you can see around you is reflecting light towards you.

At least every pixel on your screen needs to gather this information, but we can only use a very limited amount of rays per pixel, as raytracing or raymarching is expensive in general. Just using 16 rays for example will lead to “undersampling”, as you might have missed vital parts from the surrounding scene.


We can reduce this a bit by letting each pixel look in slight different directions and blur the end-results. But the results are still grainy (as you often see with older 3D software), and you need an awful big fucking amount of rays to get real proper results --> slow.

The idea behind Cone-Shaped rays is that you only need a few rays to sample a lot. For each couple steps that the ray marches forward, we look into a lower resolution of the mipmap we made in step 3. So, as we travel further and further, we sample averaged light from bigger blocks in the octree. Of course, the accuracy will suffer, but it's an efficient way to avoid missing important lightsources & win speed. After all, we need a realtime solution, and big speed drops won't justify the few benefits we gain compared to much faster(and nicer, and easier) pre-baked solutions. Plus, fortunately, G.I. means "low frequency lighting" , so the result is a blur of many incoming light fluxes anyway. For an ordinary spectator, it’s hard to figure out how G.I.should look so its forgivable to make errors… usually.


By sampling from lower (averaged, blurrier) levels over time, we get a cone shaped ray.

So, for each pixel on the screen will fire a couple of those "cones". We check where the cones hit geometry in the mipmapped octree, and then sample the light that was bounced into our (global) direction. The advantage of screenspace techniques is that we sample for all pixels visible on the camera; nothing more, nothing less. Eventually we can do it on a lower resolution to get a significant speed gain. And then upscale the image with some smart blurring finally. Another advantage is that any pixel on the screen can gather light, including objects that weren't involved in the GI pipeline so far.


Glossy reflections
A cool feature of VCT is the ability of adding 1 extra ray to sample specular lighting, giving glossy reflections. The cone-angle would depend on the material glossiness. Highly specular surfaces would use very narrow cones, meaning that we keep sampling from the higher-resolution mipmap levels for a longer time, leading to less blurry results.

T22 doesn't use VCT, but the same technique can be used for sampling glossy reflections. Advantage is that it works on any surface, and it can sample behind the camera. Disadvantages are the low level of detail and the lack of G.I. in the portion that gets reflected; voxels that were not directly lit, won't appear in the reflections either.



================================================================
T22 Adjustments

Cool and the Gang. But I said T22 doesn't exactly use VCT. What is wrong with it then? Well, 4 things:
A: The octree requires a lot of memory (you can win a lot by reducing the level of detail though)
B: Updating the octree is very costly
C: Traversing the octree to sample data during the raymarch isn’t that fast
D: Goddamn difficult to implement correctly. I might be too dumb to do it all right.


The Octree is needed to store the world representation, required for raymarching and gathering light. It can help speeding up the raymarching, and moreover, it’s pretty much the only way to store a lot of geometry up to a relative detailed level. But at the same time, this octree is the Achilles heel of VCT, coding it is nasty, and maintaining the octree is expensive, especially when having to deal with big, roaming worlds. Another in-detail issue is sampling. When doing ray-marching, we have to dive into the octree and check from which cell we are sampling on any given XYZ position. It’s not that bad, but there are faster ways.

When I finally got VCT "working" in T22, the framerate crumbled from a lousy ~18 fps to a terrible ~4 fps. Some nuance, my code isn't very well optimized probably, and it runs on an old 2008 laptop. Anyhow, such a low framerate is unacceptable, and the results weren't exactly great either. The problem arises when mipmapping. Tiny blocks are combined into bigger blocks, but what if 50% blocks are "vacuum" (not filled with geometry), and the other half are walls, floors, or whatever? I decided to give a density value to cells. Now later on, when raymarching, you have to decide where and when to sample. If we hit a 50% occluding block, should we immediately stop sampling, or continue until the sum of occlusions is 100%? The first option prevents light-leaks, but it doesn't work very well in narrow environments. Rays will get stopped at narrow passages (doors, windows, ...), so light from a bright corridor won't get into a darker room. That is exactly NOT we want to achieve, G.I. should bring light to darker places!

Option B isn't optimal either, as it may happen we stop too late (or not at all), and thus gathering light from places we can't actually see. The VCT demo's probably hides this by using a high resolution Octree, sufficient rays per pixel (the less narrow the cones, the less errors), and who knows what else.

Got to mention that the same light-leaking problem occurs in pretty much any grid/cell based solution. CryEngine "Light Propagation Volumes" has this problem, and so does T22's "Ambi-Volume-Texture-Tracing" or whatever you want to call it. At most times, this isn't that much of a problem since it's hard to tell whether the G.I. is incorrect anyway. But at some points, it leads to undesired situations. As said before, you have little control over realtime G.I. so masking such errors can be nasty. And if we are so busy with powders and creams to hide ugliness... shouldn't we just drop the whole technique then? I wouldn't be surprised if games like Crysis actually (partially) did.


Anyway, what we did do in T22, is simplifying the whole VCT process and getting rid of octrees. I picked up something I did before, voxelizing the world into 3D textures instead of a complicated octree, and then adopted the cone-trace idea to fix undersampling issues by mipmapping the 3D textures. So the pipeline is pretty much the same as VCT:
1- Voxelize geometry
2- Light voxelized geometry - put results in 3D textures
3- Mipmap 3D textures
4- For each pixel on the screen, sample bounced light with a couple of cone-shaped rays from the mipmapped 3D textures


A whole lot of effort for a bit of blurry light smeared all over the corridors...

The advantage of 3D-textures is that you can directly insert voxels on the right places bby simply using their 3D world positions. Same thing for reading the textures, all we need is a coordinate. And because the march sequences usually read pixels located at the same spots, we benefit from hardware caching. Raymarching through a 3D texture is faster than traversing an octree, and much easier to work with. But it also has disadvantages: 3D-textures consume a lot of memory. This will force you to reduce the level of detail (thus bigger voxel lego blocks, less sharp reflections, bigger hit detection inaccuracies), and keep the boundaries close. That means the 3D textures will only cover a limited (cubic)space around the camera. Distant geometry must fall back on other GI methods.

Likely, 75% or more of your world will be vacuum, unfilled space. With octrees, you don't sub-divide cells that don't contain any geometry, keeping the memory consumption low for open spaces. With 3D textures, each cubic meter will require the same amount of pixels, whether it’s filled with geometry or not. Could be devastating for large/outdoor scenes, but note that you can stretch 3D textures over a wider space if needed. When the geometry is stretched over a wider area, you can generally do with a coarser grid as well.

Well, T22 will be indoor mostly, so we aren't dealing with huge spaces. Yet it's still possible we may look beyond the area covered by the 3D textures. So what I did is baking the GI into the geometry vertices (note that the world is tessellated to some degree). Lower-end computers or distant geometry will use the pre-baked GI. And otherwise we compute it realtime. Or both. Medium-end settings will add a realtime bounce with a pre-baked bounce. So that makes it half realtime. Or something. Sounds cheap maybe, but hey, got to think of something. Also VCT would eventually bump to its limits, as you can't make a super-octree that covers the entire world. I believe the relative small Sponza Theatre uses many hundreds of megabytes (or even over a gig) video memory already, though that is a highly detailed octree. Anyhow, you need a back-up (also counts for Light Propagating Volumes).

Another change, or actually cheap hack, I made was in the voxelizing process. Rather than voxelizing the scene each cycle, I pre-calculate the voxels for all geometry. Each chunk of the world has its own array of pre generated voxels (voxel = a position, color, normal, ...). Also dynamic objects have pre-calculated voxels. As the object moves or rotates, the voxels will transform with it. Note that small objects don't have voxels, only objects big enough to really make a difference in the lighting, or doors that block light from another room.

The final raymarching step works pretty much the same as in VCT, except that we sample directly from 3D textures (much simpler). Each few steps we march, we sample from a lower detailed mipmap level to get the cone-effect. And we can also make glossy reflections if we like, although the sharpness isn't as great as VCT's, since the 3D textures contain less detail than octrees. Despite the speed gains, this process still requires a lot of horsepower. So I do it on a much lower resolution. The situation is somewhat workable on my old laptop, but the result is too blurry. You don't see it that much in bright areas, but darker parts that don't catch direct light are smudgy.


Note how the red carpet reflects on the walls. Another nice thing about screenspace techniques is that it will also work naturally for decals we pasted on top of the geometry, such as the top-right hole.

Too bad the buffer is blurry though. Possibly I could get better quality by using a smarter upscale process (UDK does that for their VCT variant), but I'm more hoping my next computer can cope with a higher resolution.


================================================================
Conclusion

The conclusion is that I don't have a conclusion yet. The results I have now are the best I had so far, but still crappy compared to a good pre-baked result. The 2 biggest problems are the blur in dark area's (I already smell the complaints when the next demo will be released), and light-leaks + other imperfections. The results are sometimes unpredictable / incorrect. In other words, I still have to add secondary lights and other tricks to get the lighting as desired. Probably I can fix some bugs with fine-tuning. And the blur can be reduced by using a higher resolution for the final screenspace gathering step. My Desktop is dead so I haven't tried T22 on a faster computer for a year, but another guy from the team had proper framerates (40+), so I expect a modern computer can do miracles when it comes to reducing the blur. It’s very necessary, because despite high-res textures, T22 isn’t sharp compared to most modern games. The G.I. and somewhat poor SSAO are part of the cause.

The real question is, how hard does T22 really need realtime G.I.? Indoor area's aren't much affected by day/night cycles, you won't destroy walls, and there is little movement in general. On the other hand, typical dark horror area's may benefit from full dynamic lighting when playing with flashlights, damaged lamps, or torches. The new UDK engine (which uses VCT or some sort) seems promising when it comes to G.I. but I still wonder how good it really is. Is the effect correct enough, fast enough, flexible enough, and adjustable enough to be used in any situation? I doubt it. Besides, the goal of T22 shouldn't be beating a UDK or Crysis engine on tech features, because that is never gonna happen. The game just has to look good. Or scary actually, whether that requires realistic graphics or not. If pre-baked solutions will do a better job achieving that, we should use those instead. Yet it's so attractive to keep trying realtime G.I. and as the hardware keeps getting faster and faster, we might be able to upscale the current solutions to better looking, more accurate versions...

So, I can't decide really. Which isn't good, because such techniques have a big impact on the end results. Each time we jump to another G.I. system, the looks of the rooms we did so far will (completely) change, and have to be tuned again. "Fortunately" we didn't make dozens of rooms yet, but at some point we have to decide and trust the technique will still look ok X years later when the game is supposed to be finished. It sucks to have multiple options.

Thursday, October 3, 2013

Abstraction V

Puberty
-------------------------------
And? Finished GTA V already? Dan and Sam Houser sure are happy you and I bought a copy. At my age (I'm 104), you don't get carried away with game-hypes anymore, but GTA V was one of the few titles that made me a bit nervous just before its release. Didn't want to sleep between 16-year olds in the Shop entrance, neither wanted to download the game for the PS3. Downloading sure is a good invention, but I wanted to revive some nostalgic youth struggles; waiting impatiently forever for a game, reading the same game-(p)reviews sixty times, hopping on the bike for a 10 km ride to a nearby city, wasting all the money your grandparents gave on a holy CD-Rom. Then bike 10 km back, faster than the wind, install the game on a PC slower than a turtle, and then.... bang, not enough hard-drive space + video-card driver not supported. Teenager rage.

Patience comes as you age, so I waited one week before taking the good old bike again. The madness and endless-16-year-old-queues storm should be over by now, so after work on a lovely autumn evening, I stopped by the shop and then... bang, sold out. Lots of shops with the GTA bad guys on billboards, but no discs. Next shipment would be in 4 days. Arh, same old shit again. Now I remember why they invented internet again. Seems I can bike home 10 km again, on that lovely autumn evening, empty handed. Adult rage.

The "charm" of being a kid + birthdays / Christmas (or "Sinterklaas") is having to wait for your present. Not just a few days, but weeks or even months. It eats your patience alive, it's a crude test. Vivid fantasies of how cool the game would be, making others tired with your talks about it, sleepless nights. But then, when unwrapping the present finally... priceless. In the end it doubles the pleasure and unforgettable memoires of your game. But anyway, I just downloaded GTA V as soon as I got home. I'm not 14 anymore.


So, booted the PS3, went to the online store, purchased the game, and then.... bang, not enough hard-drive space. Whut?#! What kind of 1998 message is that? I just purchased that shitty game, and now it won't install? It's as if this game isn't meant to be played by me. The rest of the world plays it, but apparently I can't. Well nerds, if you have a PS3 and stumbled over this post because of the same bullshit, here's what to-do:
1- Steal your little sisters laptop (or grab another old one) - must be FAT32
2- Remove its 2.5" hard-drive
3- Back-up stuff from your PS3 / write down your passwords / store login info
4- Open the panel at the bottom of the PS3, unscrew, and remove the disc
5- Hey shit, that HD looks almost the same as my little Sister's laptop HD!
6- That's right, just swap them
7- Download (on your PC) the latest PS3 system update and put it on a (FAT32) USB
8- Boot the PS3. It will come with a warning message. Insert the USB, press 2 buttons as told.
9- PS3 will reformat the hard-drive and installs the update as it would usually do
10- There you go big boy, a PS3 with a BIG hard-drive
11- Put the old PS3 HD back in your sisters laptop, she'll never know what happened

Be aware that everything on the old laptop HD will be removed. You can also buy a 2.5" HD, they're cheap. Another note, read about the maximum RPM the HD should have before putting it in a PS3. Forgot the exact number, but it seems that faster HD's may overheat the PS3! Don't say I didn't warn.

It took some swearing, but the game was downloading now. And then... bang, bedtime. And another day of work first. Next evening I could finally enjoy the game. Or no, I couldn't. At least not right away because smacking hobo's, stealing cars and blowing up prostitutes is not exactly the kind of thing you should do with a 5 year old daughter on your lap. Had to wait a few more hours. Then finally I could play my goddamn game. It didn’t go exactly as planned, but the waiting and bit of stress just might have increased the value of this game. If you never fight for the good things in live, you don’t know what good is.

Who would have thought that THIS(1997) would grow to a 270 million dollar production?


Serious Reality
-------------------------------
Verdict? Well, I leave that to yourself, countless other game-websites, and maybe for a future post. Besides, I’m far from finished. But in short, yeah I’m quite happy with it. It was worth the struggle (and price). Didn’t expect less either by the way, although GTA IV was a slight let down compared to GTA San Andreas (one of my all-time favorite games). Sure the physics were a lot more fun, the graphics were up-to-date again, and it offered a whole new package of missions and absurd crook dialogs. But… it didn’t have the warm atmosphere and humor GTA:SA had. It looked a bit cold, the protagonist was a bitter Eastern European, and the virtual city transformed from a over-the-top ridiculous nineties ghetto neighborhood, into a more sober and serious world. GTA IV took itself too serious. Or maybe… GTA IV got too realistic.

And that (finally) brings me to the topic; games & realism. And I’m not talking about the correlation between virtual and reallife-violence. If you can’t understand the difference between hurting virtual people and real people, you’re a nutt case. And that counts for idiots inspired by games (or movies/book/music/...) committing crimes, as well as “professional” paid criticizers that fail to recognize that humanity just isn’t all about flowers and humblebees. Freaks will get their inspiration whether there are games or not, and the most violent places in our history and present, aren’t well known for their Playstations, gory horror movies and internet porn. Violence is in your head, upbringing, culture or environment. All a game might do is making the spark. Our ancestors played football with human heads long before FIFA came out. Period.


As said, I found GTA IV a bit too realistic. Not just the (outstanding) visuals, also the way how your character or pedestrians reacted on the environment was all a bit too “normal”. It seems GTA V took a bit of the arcade element back into the game, and I find the atmosphere as a whole more humoristic and laid-back then its predecessor. Maybe the setting just leaves more space for happy feelings and over-dramatic characters. Los Santos is based on Los Angeles, whereas Liberty City from the previous GTA is based on New York. Never been in America, but based on prejudices and stupid television shows, I’d say the northern west-coast folks are a bit more ‘normal’ than their southern east-coast counterparts. Add the absurdity of Hollywood (Vinewood in GTA) and sunny weather giving sunstrokes to people, and you’ll get the clue.

(GTA San Andreas, PS2) Thanks to realism, you won't likely see this again in modern GTA's; the character on the bike (you) doesn't look cool enough, and AI would tell the homies in the background not to walk in the middle of the streets. A bunch of street thugs teaming up isn't very 2013 anyway. Oh, and the two left guys are identical twins?

However, GTA V is still more serious and realistic compared to its older brother GTA: San Andreas. Obviously it looks twenty times better… or should I just say twenty times more realistic? Because what exactly defines what looks good or not? What is it with “realism” anyway? I see realistic landscapes and interiors all the time, in real life I mean. But I’d only label a few of them as “good looking”. Nevertheless, in game graphics, “good looking” is often related (or confused) with “photo-realism”. Achieving this is a big, technical, challenge. Being able to code an engine that renders correct lighting, awfully real characters or beautiful reflecting oceans, breaths quality. It has become an indicator for what is good and what not. Even though good looking games still might be boring as hell actually!


Mondriaan, you rascal
-------------------------------
Maybe this somewhat weird indicator comes from the childhood. I’m not a pro, but I can draw pretty well (on paper, not digital). Back at elementary school, the challenge was to draw stuff that looked more detailed and realistic. Yep, without understanding shaders and physics, we already learned how to draw a reflective water-pool, or a shadow casted by a tree. You learn which colors can be used to draw a realistic scene, and which to avoid. You spend a lot of time figuring out how to get the perspective right, instead of having the cars floating above the grass on a white background with purple clouds. The closer a drawing comes to a photograph, the better you could draw. In my little world at least.

This is quite different from abstract art. And as a realism-fetishist that spends too much time on tweaking shaders and implement G.I., it may not be very surprising that I’m not a big fan of abstract art. Correct lighting and tiny details are a proof of craftsmanship in a painting. Can’t exactly see those skills in a very abstract painting, containing some splatters and vague stripes or simplified versions of objects. To me, those who paint abstract, are either genius (or psychotic), or they just don’t master the techniques. Unfortunately, the latter is true for quite a lot hobby painters. Hey, if you can’t draw, just throw some shit on the canvas and come up with a silly story about emotions and deeper meanings to mask the lack of skill.

Of course, this bold statement needs some nuance. To stay in art terms, it isn’t all black and white. A photo-realistic image still doesn’t have to be interesting at all. As much as I admire craftsmanship, the definition of art isn’t necessarily the technical quality. Art is art if it manages to trigger emotions, thoughts, a feeling, or if it amazes. A blurry warm orange canvas that brings you in a summer evening mood is a success. A tile-comic hanging in the bathroom, making you laugh while having a dump, is a success. Music that makes you think about your beloved ones with a little tear, is a success. A cruel war-scene photograph, making you think “Damn I’m happy I wasn’t born there”, is a success. Sort of.

That means an abstract piece of art can be good just as well, as long as it manages to trigger that emotion it was supposed to trigger. But honestly I often can’t see the relation between some angry purple discontinued streaks and the dock workers that work 16 hours, leading to broken families caused by an evil consumer-##society. An indefinable mess of metal bended pipes in the center of a roundabout isn’t a success either if no one understands what it is. Maybe we “normal people” just don’t get the clue, but neither does every so called experts. It’s like tasting wine. A few really know what they are talking about, others just want to distance themselves from the beer drinking plebs, but wouldn’t taste the difference between a Merlot Duc du La Prevert 1897, and Pißwasser with strawberry flavor. Being high-society or a rebel takes some faking sometimes.


I shouldn't have a too big mouth, my skills aren't that awesome either. Though I made far worse things on a drawing tablet. The background is kinda abstract by the way.


Imaginary friends
-------------------------------
Anyhow, games aren’t that abstract in general, simply because they would become unplayable at some point. But not all of them try to achieve photo-realism. Nintendo for example never did. Zelda Skyward Sword (Wii) looks a bit as if it was drawn with aquarelle, having slight blurry streaks instead of sharp high-detail textures. Well, in the case of the Wii this was probably needed to mask technical capabilities as well, because the Wii hardware is well… not so good. But they did a good job putting down this different style. So did “The Windwaker” with Cell-Shading by the way. No hi-tec graphics, but both games managed to suck you in a fairy-tail fantasy world. And thinking about that… would a fantasy world still look like a dream if it was rendered über realistic? I guess not. Another example. Remember the movie “Sin City”? This movie is black & white for most of the time, except for the blood effects that make an extra gory contrast this way. This filter gives a dark and raw atmosphere, but also keeps the movie closer to its inspiration; a comic book. In other words, good graphics means they represent the theme well, and drag you into a certain atmosphere. Advanced techniques and shaders don’t necessarily produce interesting graphics, though they are often required to achieve the wishes of an artist.

A very good pencil drawing? Or a movie with a real decor and real actors? Whatever it is, it's not the exact definition of photo-realism. Sin City preferred to stick with the comic theme.

As mentioned with violence & games, there is a difference between fiction and reality. Games are supposed to be fiction, giving you capabilities or bringing you to places you would never encounter otherwise. Unless you took a good amount of drugs, there is no way you can jump and fly around tiny planets like Mario did in Mario Galaxy. Unlikely you ever climb a 60 meter tall colossus and slay it, as you did in “Shadow of the Colossus”. Games are all about escaping from the boring reality for some hours. Now here is the crux with Grand Theft Auto. Asides from a few lunatics, you won’t steal helicopters, survive 150 kph head-on-head collisions, and beat up cops every 4 minutes in real life. That’s fiction. Yet at the same time the game tries to be more and more realistic. After all the theme and goal is to create a breathing, real city. Fiction and reality start overlapping here. And I’m not so sure if that is actually a good thing. Although GTA V took a step back to absurd humor, arcade gameplay and just having fun compared to GTA IV, it’s still a different experience than GTA San Andreas, or Rockstars more recent Red Dead Redemption which took you back in your cowboy boots (= fiction).

Some people prefer books over movies, because it triggers your own fantasy to fill the gaps. A book gives instructions, you do the decorations. You decide how the characters look like, the sounds of their voices, or how a scary basement should be pictured. You try to imagine how cold it is if the book describes the Battle of the Bulge. The lack of visuals forces you to use your imagination, which creates a stronger bond between you and the characters / situation. Movies on the other hand will do the thinking for you. All you have to do is sit and watch. Games still require your input of course, but maybe the imaginary portion is getting reduced as well, as the ever increasing graphical quality closes the voids that would require your own fantasy to spice things up. In GTA V, for some reason, I’m feeling less connection with the city, it feels less summery and warm than the GTA:SA world (which used a cheap dose of orange lighting to simulate warmth), and even though the world looks better than ever, I’m less curious to explore every inch of it.


Right... and your point is?
-------------------------------
Well, the point of this story is getting as vague as an abstract painting, and probably my age is an even bigger limiting factor when it comes to getting absorbed into a game. And yes, GTA V is a fine game, don’t worry. Just thinking that increased realism doesn’t automatically make a better game. Certainly not when it comes to game mechanics. Imagine the GTA V character would be tired after climbing 3 stairs, and would be in coma after a head-on collision… Nah that doesn’t work. But I’m not so sure if realistic (not to be confused with “stylish”!) graphics are always the best choice either. Imagine Link would be a bored pimply teenager in the next Zelda game… As explained in other posts, also shooters like Doom or Duke traded their impossible absurd level designs for more “physical-correct” worlds, which doesn’t always please the atmosphere or gameplay element. And how about Silent Hill… the ultra-dense fog which hides 90% of the surroundings (and helps a lacking PS1 processor) makes the world feel like a claustrophobic nightmare, and disorients the player. Probably it wouldn’t be such a good idea to enhance realism by removing the very unrealistic fog.

As for T22 then? I’m still urged to endlessly improve the graphics. But ultimately, the world should look stylish, interesting, old, dirty and especially scary. But not necessarily photo-realistic. The lack of sharpness and an overdose of blur in the demo movies so far has generated some negative comments. Though the motion blur was more a technical problem rather than a well thought design decision, I’d say it contributes to a nightmarish unreal atmosphere. Don’t know about you, but my dreams aren’t rendered in HD quality. That’s not an excuse to keep things ugly and blur the shit out of it, but one shouldn’t compare a nightmare themed game with the looks of Crysis. Different worlds, different themes, different goals. As with art, whatever it takes to trigger that emotion.