woensdag 30 mei 2012

Car reflections

Hello everyone!

Past few months we started developing yet another racing game.. But this time we decided to use Unity as our main development tool, instead of Adobe Director. Unity gives us a lot of possibilities considering performance, 'next gen' graphics and effects for example. Today I want to show you guys one of the graphical effects we are currently working on, the car shader. As you might know, car paint is a reflective material, as shown below.

 
To achieve this effect in our game we need some sort of simulated reflection. This effect is done by using a so called 'Cubemap'. The cubemap contains reflection information/color for the car shader to render. The reflection color is 'Added' to the diffuse color of the model.


The cubemaps can be pre-rendered or rendered during runtime. A cubemap is made using 6 images rendered in 6 different directions from a certain point in 3D space. True realtime cubemap reflection looks very good, much better than pre-rendered in my opinion. But it is also quite 'expensive' for the computer to calculate obviously. For this game we are going to render the reflections for the player car 'real time', since it is a big subject on the screen. The other computer controlled cars will use pre-rendered cube maps.

I also added a 'damage colormap' and a 'damage normalmap' to the shader to simulate car damage.


Greetings,
Joep




vrijdag 25 mei 2012

Serious action!?

Hello all!

Everybody got excited about the new project that Stijn was talking about? A new race game project? If you weren't you should be!

My brother wrote some posts about the same projects as me and the last one was about "A hell called Flash" :P Something about finishing up a menu and interface. In my last post I was talking about finishing up too, so I won't be posting anything new of this project. The reason for that is because... its FINISHED!!!!! Yay! Soon available for you to play! You got to update our Facebook or Twitter page the upcoming days, because we will post a link for this soccer game!!! I hope everyone is as excited as I am, because it's an awesome game and I think you all will love it as well!!

Sneak peak on the stadium of our new soccer game!


But when projects are finished new ones will start. :) This new one will be something real special! And I really like these genres. And so does my brother! We will be updating you all with the most exciting news about our new project! Can't really tell too much, because it's still in prototype, many stuff to do, coding a lot of new stuff!

But be ready for some serious action!

Have a nice weekend everyone, hope your weather forecast is as good as here in The Netherlands, because we finally got some sunny weather: 25C / 74F!!

Greetings,
Michael

maandag 21 mei 2012

Computer Controlled Cars

Dear readers,

Now that Katie Commando is finished and live, I've been on a new racing game project. This racing game will have computer controlled cars. The question is how do we get these cars to be controlled by the computer? In this blog post I'll tell you how we do it.

Getting the car to drive on any road is quite difficult, therefore we ask the track creator to create waypoints that follow the road. Below you see an image of the road with waypoints (shown in green).
We now program the car to follow these way points. We keep track at which waypoint the car is. Then we pick a point on the next way point (shown as a blue dot in the image below). If this point is to the left of the car we make the car steer left. And if it's on the right, we make it steer right. There are a lot of subtleties here, but this is what is basically comes down to.
As for the speed, a car cannot drive at full speed the whole track: in a corner it must slow down or it will go off track. So we compute an advised speed for every waypoint (which is based on the curvedness of the road). If the car is above this speed it should let go off the gas or brake depending on how much the speed difference is. If the car is below the advised speed it should accelerate.

We should also have a fall-back in case the car gets stuck somewhere. Therefore if the car has not passed the next way point within 2 or 3 seconds we assume something is wrong and we reset the car back on track. Of course this shouldn't happen too often (if it does then the car steering should be adjusted).

-- Stijn

maandag 14 mei 2012

Lightmaps - Part 2

A light setup can make or brake a game environment. When done right a mediocre modeled environment can look great, but when done bad a great modeled environment can look ugly as hell. A real-time light setup can be very processor heavy which is something we don't want for our games. That's why we use a technique which pre-bakes the scenes lighting. This technique is called lightmapping. A while back I've already written a post about this, but there are a few more things I like to share with you.

In short a lightmap is a separate image which contains the shadow information of a 3D scene. In-game this image is multiplied on top of the environment's diffuse material (texture) to "simulate" the shadows. Here at Xform we create lightmaps by rendering two different light setups which are combined in Photoshop. After placing all our lights in 3D Studio max we first render the scene's "hard" shadows to an image using Ray-Tracing. As you can see in the image below the shadows are hard and the scene has a "clean" look.


We want to add some extra shadows to get rid of this clean look. We can do this by rendering the scene with a "skylight". A skylight simulates scattered atmosphere light. I won't go into detail about this, but the result can be seen below.


The shadows in this render are much softer, the inner corners are darker because the light can't completely reach them. To see the end result we combine the images into Photoshop.
When you look at this combined image you should notice the outside of the hangar looks good, but the inside is much too dark. This is the result of the skylight we've used.
 

The main drawback of a skylight is that the light can't reach the inside areas of a scene. Therefore these areas will be rendered completely black. This is something we don't want for our scene so instead of the skylight we'll render the scene with an Ambient Occlusion material, which only renders "shadows" in the scene's inner corners. It's actually faking the skylight.
 

Combining this texture with the ray-traced texture gives a much better result. Here both inside and outside of the hangar are looking good.


Now the scenes lightmap has been rendered and combined in Photoshop and it only needs to be color corrected to fit the final in-game scene. Here we've given the texture an orange tint which results in orange shadows in the final scene.
 

To finish this story check out the image below for the final result:


Cheers,
Matt

woensdag 9 mei 2012

A hell called Flash

Hello all!

Wednesday, blog day for me! And another day in Flash... Last couple of weeks I have been working on the Menu and Interface for our soccer game. For me this was something new. Never opened the program before. So with some aid of Mike and Matt, I got to learn some basic flash and got started.

But before opening Flash, I made some mock-up screens in Photoshop. To determine the style, where the buttons need to be placed, what the overall look will be, etc. We do this for every screen in the menu and interface: main menu, help, pause, results screen, etc.

Mockup screen in Photoshop


When all the screens are done we are going to implement them in Flash. After some trial and error I got the menu and interface up and running! For now I’m going to skip all the weirdness I encountered in Flash. (I think the title of my Blog says enough, hehehe...) I’m glad I learned some Flash and while getting more into it, it gets more fun!

Implemented mockup screen in Flash

After implementing the mock-up screens into Flash I started finalizing the menu screens by replacing the mock-up graphics with some nice stuff and better backgrounds!

Here's one of the menu's backgrounds:

Menu background


That’s all for now!

Hails, Eugène

woensdag 2 mei 2012

Metro construction

Hello everyone!

First of all we're proud to present you our brand new game 'Katie Commando'. I'm happy that the game is online for you guys to play, it has been a tough ride getting the game done. There are always some small things that could have been better. But hey, in the end it became a nice fast little game :)!

Today I want to show you guys some of the recent work I did for our new racing game project. After I finished my work for Katie Commando I started modeling several new assets to be used in a new race track. Mainly 'Metro' assets. And eh no, we aren't going to create the new 'Metro Simulator 2012', but we do want to give one track some train-ish / metro-ish kind of setting.



I started by making a straight piece of metro tunnel. I also UV-mapped it directly on the 2nd UV channel for lightmap baking. This came in very handy when making the corner pieces. I made the corners from the same straight metro tunnel by bending them using the 'Bend' modifier. Because I already UV mapped these pieces on the 2nd channel I will get nice and good lightmaps because of the straight UV's. It also saves a lot of texture space keeping things straight.



Uber super secret sneak preview:



That's all folks! Until next time!
-Joep