woensdag 24 augustus 2011

Technical Talk

During the development of Army of the Damned we also started another first person shooter project. The plan is to create a similar game like the zombie game, but with a more arcade type of gameplay and graphics. Today I want to talk about how we are going to do the 'Shooting' in this game. You might think, 'Well it is a first person shooter just like all the others, so what is the point of discussing this?', which in fact is pretty much true. But what we want to do is make all of the bullets visible. Not just instant hits, as we did in the zombie game. The main reason for this is to amplify the arcade feel of the game. It also changes the experience slightly, because it takes a slight amount of time for the bullet to hit it's target.

The technical difficulty of these visual bullets doesn't come with the bullets themselves. They just function on their own. When spawned they move forwards, if they hit something they die. And while a bullet is 'a life', it is visible to the player.
The problem comes when shooting the bullets, or better said, spawning the bullets, from the first person perspective. Normally what you can do to 'shoot' from a first person camera, is just to shoot a ray down the center of the camera's transform into the 3D world. If it hits anything create a bullet hole, hit an enemy or something else depending on what the ray hits. But when having visual bullets, and a visual weapon in view where the bullet appears to be coming from it isn't that simple.

This figure shows our problem:

If we just spawn a bullet at the end of the weapon's barrel, and shoot it in the direction the barrel is facing it will never get to the target the player's aiming for. It does go in the correct direction in general, but this will be unusable when having targets on a decent distance. It will also look very strange because the fired bullets won't move towards the displayed crosshair in the interface, which makes the crosshair in fact pretty useless.

The solution is to shoot a ray first from the camera, the same way you would do when shooting 'directly'. This should give you some sort of intersection point in 3d space. Then it is time to cheat a little. The bullet we are about to create should spawn at the end of the barrel, but not be pointed in the same direction as the barrel. Instead it should be pointed at the intersection point we got from the ray. This will make sure that bullets always travel towards the target or object the player is aiming at. It will look correct because the bullets will always move towards the crosshair in 3D space.

The only problem occours when the first ray fails. We don't have a reference point. A simple but yet effective solution to this problem is to calculate a intersection point far a way from the camera. And then point the bullet to that new location.

Until next time,


vrijdag 5 augustus 2011

Pimping art for stills and print

The past week we've been finalizing our zombie shooter "Army of the Damned". At this stage we need to prepare the artwork for marketing and print purposes, which of course has to look much better then in-game screenshots or standard renders and also must have a much higher resolution. Luckily I took this into account when creating the game's main menu which in-game is displayed at a resolution of 800x450. For this image I tripled the size to 2400x1350 pixels, which is more then enough for what we want to do with it.  
It's always good to figure out what you want to achieve with the image before starting on the artwork, this will keep you from creating art which in the end you don't need.

For this image I wanted to show a detailed player character, some zombies closing in on him and a plane dropping a bomb in the background while keeping in mind the title and menu would be displayed on top. I also wanted the image to have a grindhouse look. After some quick layout sketches I posed the 3D characters and rendered an image which can be seen below.

As you might have noticed the rendered image looks a bit bland, the big zombie on the left has too little contrast and there is no clear light-source, no problem we're going to fix all this in Photoshop!
First we need to determine where the light comes from, in this case most of it will come from the explosion in the background. In Photoshop I placed a layer on top of the character where I painted the lit areas with an orange color and set the layer to color dodge. 
On another layer I painted the shadow area's with a dark color and set the layer to multiply.

Next I added the background which is composed out of a sky, mountain, plane and explosion image. I also added some smoke coming form the gun muzzle. 

The image is getting there but it still looks too clean and the background looks too detached from the foreground. First I added some noise on top of the image and a "scratched film" layer to make the whole thing look old.

When you look closely you might notice the left side of the image has a red hue and the right side a green hue (red=bad guys, green=good guy). This is achieved by adding layer on top set to color dodge (of soft light) and lightly using a red and green brush. 
Finally I placed another layer on top which is set to overlay, with a white brush I painted over the area's which needed to be more brightly lit. These where mainly the explosion area and the players chest.

So that's how you pimp an image!

Cheers, Matt