donderdag 17 november 2011

Character animation



Dear readers,

This week I've been working on character animations for our top secret SSX-with-cars project.

Character animations in 3D are most of the time done by using a relatively simple skeleton, matching the general shape of the character's mesh. These skeletons include all of the important joints that are needed to create the required deformations. The mesh of the character itself is linked to such skeleton. When a bone moves, the related vertices of the mesh move with it. The proces of linking the vertices of a mesh to such a skeleton and the creation of a skeleton itself is called  'rigging'. After the character model is rigged properly, we can animate it.



The animations are created by making keyframes of the skeleton, not the mesh. A keyframe in 3D is basically a pose of the skeleton at a specific time. I always start by creating the most extreme poses of the animation. For example, I was working on an animation where two characters were highfive-ing:

Click to see animated GIF

I created the starting pose and the pose where the two hit eachother with their hands. These two keyframes are seperated by empty frames. The computer calculates the motion between these poses/keyframes. At this point we only have the motion and timing of the animations but it is far from finished. The motions of a bone from one keyframe to another can be displayed by showing its trajectory. These are pretty much straight, from one point in 3D to another. But when having the highfive animation, I want the arms to swing. Therefor I have to adjust the trajectory. This can be done by adding extra keyframes in between. This adjusts the curve of the motion. Most of the time I use only one extra frame, because adding too much frames can cause jittering and unsmooth motion.

- Joep

vrijdag 11 november 2011

Faking car physics



Dear readers,

Today I'm going to write about faking car physics, in particular adding a sense of weight to the car. What I mean by this is as follows: when you see a car breaking you'll notice how the car tilts forward as the center of mass moves forward. In the same way when a car accelerates you'll see how it tilts backwards. Likewise when a car turns left, it banks rights and vice versa. See these images:
Car tilting forward
Car tilting sideways

To fake this effect I'm applying two extra forces on the car: one force that lifts the car and one force that pushes the car down. The trick is to find the proper points.
See the following image:
Applying a lifting force (arrow up) and pushing force (arrow down).
Here we have a lifting and pushing force that are moved along the red circle. The lifting force is always directly on the opposite side of the pushing force on the circle. In this particular situation we are pushing the nose down and lifting the back which corresponds to a car that is decelerating. Other situations can be done in the same manner.

So now, given the car speed in global coordinates, how do we find where we position the lifting (and pushing force)? First we store the difference in speed between the last frame and the current frame: this is our deceleration/acceleration vector and determines where we are going to apply our force. This vector should be in car space (not global space) and determines where we apply the lifting force. The larger the length of the deceleration/acceleration vector the stronger the lifting force. At exactly the other side (simply multiply the position of the lifting force by -1) we apply pushing force with the same strength.

This should already work nicely, but a problem with the circle is that the car is longer than it is wide, as a result if we apply the same forces the car will bank too much and even flip the car. So we have to correct for this by either changing the forces when they're applied near the side of the car or change the circle to an ellipsoid. Either should work fine.

-- Stijn

vrijdag 4 november 2011

The things that you (need to) do

Today I want to tell you something about task management. Maybe it's not the most exciting subject, but it's something (game) projects simply can't do without.
And in the end... you're glad you're using it!

But first I like to start with an update about the good stuff of the Xform life this week:
- Watching Gremlins during our lunch breaks.
- Eating some very delicious cake.
- Our intern Sander passed his drivers test.
- We found a dead rat in our office.
- We're working on 6 new awesome browsergames!

And with this last point we're back on topic: task management. Because Xform is a small company, most of the time the people here are working on more than one game project.
When working on a project, for you it can be quit simple to remember what you have to do and in what order. But when you're part of a team not only your tasks that need to be done. Everyone has his own list of activities. This means you'll need someone that can keep the overview. And for our game projects it's my job to do that. Sounds easy. It's not. 'Cause when there's too much to do (and believe me, there always is) it can get quite a mess.
For example: at this moment we're working on one of our new car games. Although there are just a few days before we reach the Beta milestone, there are still 36 tasks to do. Try to memorize 36 things that need to be done, in the right order. You simply can't. That's why we use Intervals, project management software that helps me to control all tasks and milestones.


To manage tasks you need to know exactly:
1. What needs to be done.
2. Who has to do it.
3. When it must be completed.
 
Tasks always take time. Even the small ones. And it's those little activities that are easy to forget. When you start with task management it feels weird to schedule tasks that only take less than half an hour. But they're part of the project, so they need to be managed as well.
That's why we at Xform don't only schedule our milestones. We schedule every (!) single, little task. This gives me a complete overview of the entire project and I can easily see what's finished and what still needs to to be done.

In between all the management stuff, I still find some time to create the game trailers.
Here's the one of Area Zero:



Play the game here and have a nice weekend!

- Shirley

maandag 31 oktober 2011

Stunt Double

A few posts back I mentioned we were working on a new game prototype which was basically a downhill ski-game with a special twist. Well the special twist is that in this game you're driving a car downhill while slaloming, grinding and jumping insane ramps!! It's like SSX but with cars! 

The prototype proved to be quite fun to play so we got a go on this project.
There was one problem we've soon noticed while playing the prototype: the car stunts looked a bit boring when the cars only turned, rolled and twisted in the air. It missed that extra wow factor you need in an "extreme sports" game like this. 
Another problem is that cars can't really give the player any feedback when successfully performing a stunt, we could have shown some sparks or particles but that wouldn't look very impressive. 

Then someone here got the ingenious idea to turn the cars into cabriolets and put two characters inside. Now we're not only limited to car stunts but we can also add character stunts and even combine them. This change made the game instantly more fun to play and by adding the characters we can give the player much more feedback by making them wave, cheer and shout. It also adds to the overall arcady feel of the game.

Work in progress image of the two characters inside a dummy car.
One of the drawbacks is that this decision does add to the complexity of the game, beside relatively simple the car animations we also have to animate two separate characters which also have to interact with the car and each other. We do think this extra effort will set this game apart and make it much more attractive and fun to play, I guess we'll know in a few weeks when the game is released.

-Matt


woensdag 26 oktober 2011

Shootin’ Cybertrash!

Hello all!

Let me first introduce myself, my name is Eugène and I now work at Xform for several months as a 2D/3D Artist and it’s a hell of a job! :D

 I’m going to tell you about my first project here. It is an unannounced game, not released yet. I am not sure if I can talk about it or show much of it.
But what I can tell it’s a “Browser Based Side Scrolling Gun and Run Action Shooter” game with 3D graphics! We tried to give you  the feeling that you are playing an old school 2D Shooter game of the Nes/Snes era! So expect a difficult game!

It takes place in a destroyed Earth and you have to make your way through hordes of enemies and tons of explosions with a kick ass character! This game will rock! Ha!

For this project I’ve been working  on the levels, menu’s, modelling and texturing stuff, placing dummies (enemies in game) etc.  In every level you will face enemies, hard jumps, upgrades  and more. Some enemies are placed  in really sneaky places where you don’t expect them!

Here is a sneak peak of one of the levels.


This is a print screen of my viewport in 3DS Max. You can see some dummies which are in the game enemies. The big blue boxes are “camera triggers”.  If u pass these objects (you won’t see them in game so don’t worry)  the camera will zoom towards or away from the player to gain a better view of your surroundings and what lies ahead. The explosive objects.... I think those things don’t need any explanation of what they do!


This game is going to be called “Shootin’Cybertrash”. We will keep you updated about this project. And wish you all good luck in completing this hard game hehe, when it is released of course. J

Well this was a little introduction of myself and the game where I’ve been working on.  Next time I’m going to talk about the project where I’m working on now. 

Greetings, 
Eugène

woensdag 19 oktober 2011

Jumps!

This week I've been working on a 3d mockup environment for a new project. It is going to be a car game. I can't tell you that much about it yet though.
The game does feature big jumps, they are actually a big part of the game. These jumps should be easy, spectacular and inviting for the player to take. The player should be able to just drive on a ramp, perform the jump and land almost perfectly on the other end without much of trouble to continue driving. It was my job to test several jump setups using the mockup to see what kind of distances, heights and speeds we should use. We also wanted the jumps not to be too low in height, it should look spectacular!

The first step I took was to gather information of what we already got. I already had a test version of the game with the main physics up and running, so I could check how the car behaves on the mockup. I knew that our car has a certain speed at the moment of jumping, behaves in a certain way in the air and while landing. I was not able to change the car speeds/handling for this test. I started by just setting up a simple jump over an imaginary river or cliff. I used big numbers to quickly test what works and what doesn't. For example, the first jump I made was planned to be 10 meters in length. This jump felt way to short, I instantly jumped over the landing zone. Therefor I increased the length by, easy numbers, 10 meters. So now I had a jump of 20 meters in length. 


This was already more like it, but still a bit to short. Most of the time I still landed to far over the landing zone, so the distance wasn't far enough and I increased it by another 10 meters. This did the trick and I was now able to land pretty much perfect in the planned landing zone. However I wasn't pleased by the height of the jump, it wasn't high enough. I started tweaking the ramp, to get more height out of it. First I tried 'straight'  ramps, not curved. This worked fairly well but gave a harsh ' bump' while driving on the ramp when it got steeper. Curved ramps was the solution, and gave the car a smooth ride into the air.

Now the jump was looking good and it felt 'big'. However changing the height of the jump also influences the jump distance. I reduced the jump length by 5 meters, and reduced the angle of the ramp slighty which gave a perfect jump with good height. The hard part is to give the player enough air time to enjoy the view as well as making the jump not to short in length. I hope to be able to tell you more about this game soon, it is going to be a pretty interesting project :)!
 
-Joep


donderdag 13 oktober 2011

Skidmarks!

Hi!

It’s been a long time since I wrote something. Too be honest I didn’t have anything worthwhile to write about as I was hands deep in deploying our new augmented reality kart racer. Play it on www.redbullformulaface.com. It is great fun!

At the moment I have a bit more time to look into other things. A couple of years ago we did a small kart game (http://www.shockwave3d.com/gamepage.cfm?id=794) which was extremely fun to work on.

The last few years we occasionally put some time into expanding it, so we have quite some stuff lying around to make a ‘new’ game. Well, we’re not actually remaking it… it is not really a sequel… it is more a ‘rebuild’ with additional stuff. Nevertheless, it was time to finally upgrade and implement skidmarks!


I’ve been tackling skidmarks for quite a while now. I found it to be harder than I would like. Not really the technique behind it, but more in an Adobe Director kinda way. There were three options I looked into.

1.       Create small transparent planes at the bottom of each wheel. Place them each frame or after a certain threshold distance compared to its last stored position.
2.       Draw into a texture. Have an additional texture layer and paint in it where the wheels are. If you have a lightmap texture you could also draw into that one, I think.
3.       Build a mesh trail.

Honestly I didn’t do any real stress testing on the first two as I already knew they weren’t really viable. Although I’d really like solution 2. In the end there shouldn’t be any performance issues on how many skidmarks you have and above all they will be displayed indefinitely! Solution 1 and 3 need to be ‘tempered’ so performance won’t drop too much.  Unfortunately, I still think it might be too slow to do any additional raycasting and lookups to know where you should draw into the texture. Furthermore, you can’t directly draw to any texture in the VRAM in Director, so when updating skidmarks you constantly have to send the texture to the VRAM as well. You’d also want a decent texture resolution or else your skidmarks would look like huge blobs. All in all this will cost too much CPU power and performance will drop. A cool solution, but currently not feasible. I went with the 3rd option.

A couple of our games feature rockets. The rockets leave a trail behind when fired. I used this as a base to create a skidmark feature. The very first version of this effect would rebuild an entire mesh each frame (or each update). Meaning the mesh could become very large, complex and time consuming to update. I rebuild this effect with two optimizations.

1.       The mesh uses a maximum amount of vertices and faces. It is created as a long segmented plane. I build this mesh beforehand (or sometimes I store more of them to be used and reused) so we can avoid any performance drop when creating a skidmark. The downside is that the mesh and detail is limited. So a trail or skidmark cannot be very long. The mesh will also get 2 sets of texturecoordinates (and a new shader). The first layer is a tileable texture. The second one a transparent texture (a gradient), so we can fade the trail at the end.
2.       All vertices are initially placed at the location where they should spawn. Each frame (or update) all 2 vertices (of each segment) will get the position of the 2 vertices (previous segment)  before them in their vertex list. So i.e. vertex 5 and 6 will get position 3 and 4. The only exceptions are vertex 1 and 2. This will be set to the source of the trail/skidmark. So each update we 'move' the mesh 'along' the previously stored positions.




These updates made it much faster. So ‘fast’ that at my current work machine I can have multiple sets of skidmarks for 8 cars at the same time. Not sure if this will make it into the final game, but it is worth testing J

-Pieter