Wednesday, March 9, 2011

Killing Spree

Progress anyone? Still toying around with the ambient-shaders. There is an annoying little bug somewhere, can't really trace it. Each time I change 2 letters in the shader-code, then reload the program... wait 2 minutes (with Windows 7 it suddenly takes 6 times longer to load ?!). Shit, typo in the shader. Reload... In the meanwhile, my daughter and I are watching old 1945 Goofy cartoons on the right side of the screen. In other words, not so much progress.

The others were busy as well. Visiting the GDC (Game Development Congress), doing a CG Society contest, or earning money (not totally unimportant). Most progress was probably done in fantasy-land, in the upper chambers. Drawing floorplans, and Robert made some character sketches. Lot's of ideas have been written down. But... without actual 3D content all those ideas still aren't worth much. Maybe I should make some simple test-maps in the meanwhile. Just to try out some new mechanics that have to be implemented... Such as climbing a ladder.

Hello, my name is Custard pie head. Piece of sketch from Robert looking around the corner. One of the (fun!) things to do is to create a huge base of sketches & ideas. Then a jury (Tyra Banks, Sharon Osbourne and Dolph Lundgren) will judge which ones go to the next round.

I Also had a look at the Crysis 2 Multiplayer demo. Ah, that's always frustrating. Just when you are catching up with all the graphics, those bastards at Crytek sweep the floor again. As suspected, it looks darn good (even though the realtime ambient lighting isn't that accurate). On the other hand, I didn't had a real good chance to observe everything though. Each time when I was looking peacefully at the flowerbeds, bumpmap walls, reflecting floors, or the indirect light casted by a TV, I got killed by some asshole with a shotgun. No, Multiplayer games aren't my piece of pie.

Then I realised again that awesome graphics still don't make a game refreshing. I can't judge Crysis2 based on small demo of course. But asides the good looking futuristic maps (no jungles this time), I doubt if this shooter will be truly innovative (like Farcry was). At least the Multiplayer was the same as usual; 10 guys running around like mad, firing 500 bullets per second, having an average lifecycle of 11,74 seconds.

Multiplayer games... Always enjoyed beating 1.000 Footclan ninja's in Turtles in Time(snes) together with my little brother. Arguing together because of Mario Kart. Sneaked for hours towards German bunkers in Hidden & Dangerous Cooperative modus. Then end up fighting again because either my brother or I threw a grenade only 1 meter far, killing the whole squad. Had quite some fun building custom maps for Age of Empires II, then playing them together with friends. Usually I had a large empire, and the others were placed in slave-camps to break out. Revolution mid-east style. Favorite multiplayer game? Goldeneye (n64). Also liked the Counter-operative modus in Perfect Dark (n64). Why do proper shooters such as Halflife2 never have a Coop or that Counter-Operative modus? Those shitty mods never work very well, or get released 3 years after when you already got tired of that game. Oh, in case you wonder what “Counter-Operative” is: one player had to finish a normal Single-Player mission, as usual. The other could take over control of a random (weak) foe. Pretty fun to look play a map from the CPU perspective.

But "fragging" other strangers in Quake, Unreal Tournament, Crysis or Battlefield? Hmmm... no. In theory those team-based multiplayer games sound like a lot fun. Realistic opponents, real teamwork, headsets, planning tactics, helping each other... The few times I played Battlefield 1942, I stranded up the front cover of a jeep, driven by a guy named "Joop". 20 seconds later the jeep with the two of us drove into a cliff. A tragically but fun dead. Tactics? Everyone who spawned stole a tank or airplane ASAP, then to commit Kamikaze in the enemy camp. So I decided to go bananaz as well, hi-jacked a Aircraft Carrier ship (every soldier knows how to steer those) and crashed the big boat onto Wake Island. To get scolded for "fking n00b!#!", "lame-ass, pls ban that dork" or "GWEG34 ROLFOL" whatever that may mean.

Turns out these soldiers were bloody serious about there defeating the Japs after all. Like real killers, they ran into an enemy base, started unloading their M1-Garand on another Japanese while circling around each other at high-speed in a bloodcurdling duel on life and death. Running, shooting, jumping, crouching, firing bazooka’s, reloading… Who would fall first?! Realism. Now I finally understand what our boys went through in Afghanistan. Running circles around "n00b!" shouting terrorists, throwing grenades at our guys. And even worse, the fallen ones get humiliated; the terrorist "p0wns" him by repeating jumping and heeling on the dead body.

I did the same. With the 7800 tons USS Wake Island. Parents worry that games get more and more realistic.

Either you play it serious, or you make jokes all together. But playing such games with semi-professional 15 year old Killers is just stupid. At least for me. I'm sure a game like Battlefield offers everything to play the game with real general Patton or Navy Seals tactics. But unless you organize matches with clans & playrules where each fills his role seriously(medic, defensive, assault, scout), it just doesn't happen. People don't know each other, medkits are used to knock out the enemy, and dying because of stupidity has no consequences. Just wait 20 seconds (or 2 minutes for Counter Strike) and you'll be back in battle. All that really matters is your score. The more kills, the better. Your teammates help you, they run into the frontline with Duke Nukem Reaper cannons, destroying everything that moves. Then to get killed themselves 2.5 seconds later.

And even if you are slowly sneaking through a map, taking good care of yourself, you'll get banned because of "camping" (staying hidden on the same spot all the time). That's what happens to deserters.

If I had to make a multiplayer game, I would the force the players to follow a 2 week bootcamp with a fixed assigned group of fellow-recruits, under the lead of capt. Sobel. Then when they get killed during a campaign later on, they have to restart or shut the game and do their homework for school. But hey, that's just me. I'm old and grumpy, and a few billion others enjoy p0wning each other on a chaotic battlefield, so maybe I should shut my mouth.

Will T22 have multiplayer then? Hmmm, probably not. Although I do like co-operative games. Or maybe let the other one take control of the enemies. Only problem is that story/puzzle driven games usually don't lend themselves very well for multi-player, because of the specific triggers. If you get locked in a room with a time-bomb that requires a puzzle while the other is sitting on a toilet two stores below, the scripting sequence could mess up. You really have to design a game for cooperative action (like they did in Resident Evil 5 for example).

On top, a horror game like this won't be that scary anymore if you can baseball-bat opponents like a bunch of drunk hooligans. And since T22 isn't exactly a combat game, having a partner doesn't add much value. You could just as well invite your mother to look over your shoulder at the PC screen, helping with solving puzzles. But who knows... Despite my grumbling above, two doubles the fun. But maybe we should finish a second demo first, don’t you think?

Got a couple more building photo’s from a friend. I couldn’t decide which was the worst so I just posted one. Dunno what kind of architects they had there, but it looks like someone won a box stacking contest from the local supermarket. Hey, if you live in one of those things, feel free to send us a vacation card!


  1. USSR architecture:

  2. And thank you!
    That first busstop picture hits the spot :)
    That sci-fi rocket looks kinda cozy with the lights on actually.

  3. Rick, I know it is totaly unrelated to the post;) but could you recommend me some good easy to understand tutorial about making water? I don't want anything fancy cause I am OpenGL beginner :)
    The water doesn't have to be ultra realistic, just to imitate it to the certain degree. However moving waves would be nice...:)

  4. Can't recall any tutorials, except those from But unfortunately, that site is down. But Nehe might have some as well.

    Let's see where I started a long time ago...
    The most simplest form
    * plane(quad) with transparency applied (look at GL_BLEND and transparency options)
    * Don't apply diffuse light on water, just overall ambient for now.
    * load a seamless blueish wave texture. Before rendering the quad, enable that texture (glEnable(GL_TEXTURE_2D) , glBindTexture(myWaterTextureHandle ... )
    * To make the waves roll over the plane, apply UV coordinate shifted. When you render the quad, just add an ever increasing value to the S and/or T values of the texcoords (glTexcoord2f( s,t ))

    If that succeeds, you can go a step further with:
    * Make the waterplane a quadgrid (eventually with LOD) instead of a single quad. Then let the CPU calculate the height of each vertice based on "wave calculations". The formula itself can be pretty complex, but there should be plenty on internet.
    * Use specular lighting from the sun on your water. You need to make a quadgrid instead of a single huge quad though (or apply a pixelshader that does per-pixel lighting). OpenGL has some fixed parameters to setup a lightsource & material specular color.
    * It is possible to make reflections without using shaders at all. But if you are going that way, I suggest to start studying shaders anyway.

  5. Thanks Rick, that really helps me a lot :)

  6. Rick one more question regarding lighting :)
    If I want to do an animated water with a mesh then for each frame I need to recalculate mesh's vertices normals? I am afraid that this takes a lot of CPU time...

  7. Yes and no. A modern CPU can easily do (ten)thousands of such calculations. But if you are trying to render the entire Atlantic Ocean...

    That's why there is LOD. I suppose you are rendering a grid of quads for your water. You can reduce the gridsize as the distance grows. Thus detailed waves for nearby, just global ripples for a distance, flat huge quads for the far background. I have to admit I never tried LOD on heightfields, but that technique is quite old so there should be plenty of tutorials.

    Usually shaders are used for these kind of calculations. Because GPU's are a lot faster with vector math. It's not nescesary, but keep it in mind. Another note... maybe you don't need normals that much, unless you want correct specular lighting or more advanced lighting tricks. You probably don't need basic diffuse lighting anyhow.

  8. Thanks Rick.

    You say that I don't need normals that much, but how will I accomplish waves "curvature" without lighting? If there won't be a light the interpolation between vertexes will not exists and the end user will see the triangles, right?

    I think I will need like 300 vertices. I know that this is not to much for the modern CPU, yet it feels somewhat wrong to calculate normals at each frame for them...

    Are you saying that with shaders I can take up a mesh and calculate normals by the GPU?

  9. For proper lighting you do need normals indeed. However, basic water from the old days often only used a simple ambient color (light position / normal do not matter then). The effect you describe happens when you apply diffuse and/or specular lighting. I would disable diffuse lighting. But if you want specular light from the sun, you do need your normals yes. However, you probably need more than 300 vertices to get a nice specular highlight though (or use per-pixel lighting via a pixelshader).
    What you see here is (probably) just 1 big flat quad, but with a normalMap to do the normals. You'll need pixelshaders for this though, and using a flat quad doesn't work very well for a wild ocean with waves of course.

    300 vertices is nothing. Don't worry about that. When doing animations on the CPU ("skinning") you do more complex calculations for thousands of vertices.

    > Shaders
    Yep. Or at least if you know the positions of your neighbor vertices. If you compute the "wave formula" inside the vertex-shader, you should be able to figure out the positions of neighbor vertices. Otherwise you can do it the advanced way via geometry shaders, or texture-maps. But that might be a little bit out of the scope for now.

    My advise:
    - Program a grid
    - Look into LOD in case you plan larger water surfaces, or detailed waves
    - Use ambient lighting
    - Compute normals and add specular lighting from the sun/moon
    - If all works well, start on shaders