vrijdag 4 februari 2011

Shoot the crate

Dear readers,

Let's talk about something different than the platform game I'm working on. Last week one of our interns had a problem with the physics engine. The scenario was as follows: We're playing a character in first person style and we're holding a gun. We can walk around in the world and there are some non-static crates: if you bump into these they will move. This is all handled by the physics engine itself, there is no effort required by us to set forces or anything. Nice. But now we want that when we aim our gun at the crate and shoot, that the crate receives an impact and moves and spins realistically.

One solution here is to actually create a bullet and make it follow the path along our crosshair. As to whether this is a good solution I'm not too sure: bullets have to travel at high velocities which is something that could 'bug' the physics engine and unrealistic events might occur. I'm not sure this would occur as we haven't tried this solution. Additionally you'll need to create and delete the bullet (on impact) as well as keeping track of it: what happens when we fire the bullet into the sky (i.e. there is no impact, the bullet flies)? The bullet wouldn't get removed. Although you'd probably have to shoot a lot of bullets into the air before you'll notice a performance drop, it's sloppy. So you'd either have to give each bullet a lifetime as well and update it and remove it when its lifetime runs out or seal the world so bullets will always impact. This could all be done, but it's a bit of a hassle and as I said you might get unexpected results. Let's explore another solution.

Solution two is to immediately apply an impulse ourselves. So we cast a ray along our crosshair and get the first intersection. If this intersection is with a crate then we'll apply a force on it. But to apply a force on the crate the physics engine requires us to give a point on the crate and an impulse. Our impulse is whatever we like: for a small caliber gun we could give small impulse and the crate will move just a little. The problem here is that the physics engine requires us to give a point on the crate in it's local coordinates, whereas our intersection point is a point of world coordinates (see image below).

Here W is the center of world (0,0,0), while C is the center of crate (0,0,0) in its local coordinates. Ray r is the ray along our crosshair and I is the point of intersection.

As said, intersection I is returned to us in world coordinates, while we need it in the crate's local coordinates. You might think "Ok, so just take I and substract C (in world coordinates) from it", but this is only correct when the crate isn't rotated. Rotation needs to be taken into account as well because if we take the same crate and rotate it 90 degrees, you'll still have the same intersection point, but a different local coordinate. To get the correct local coordinate of the intersection we need to look at the transform of the crate. The transform is a matrix M which determines the model's position, rotation and scale with respect to its parent (in this case the world). When the model is drawn to the screen all of its vertices are multiplied by the matrix M to get to the world position. So what we need is the opposite: the inverse of matrix M. The inverse of matrix M is a matrix M' that satisfies: M * M' = ID where ID is the identity matrix (that matrix with 0's everywhere except on its diagonal it has 1's). Multiplying the identity matrix by a vector will result in the same vector: there's no change. Multiplying the inverse matrix M' of the crate by C (in world coordinates) will give us the local coordinates of the crate. Hence if we multiply the inverse matrix M' by the intersection I given to us in world coordinates we obtain the intersection in the crate's local coordinates, which is exactly what we want. We pass it to the physics engine and it works perfectly :)


Multiplying M by the Ilocal position brings us to the Iworld position. Multiplying M' by the Iworld position brings us back to the Ilocal position.

-- Stijn

maandag 31 januari 2011

Level Design Pitfalls!



Hi all!

As you might know, we're in the middle of designing levels for our 2D/3D platformer. Here's my top 5 of biggest frustrations when playing through some of the levels that may require some more work:

5. Are we there yet?
If I stop to get a cup of coffee before I reach the end, your level is too long! Watch other people play your level and keep track of how long they take to finish. It's easier to add a piece of level than to remove if it's too boring!

4. I'm lost!
Some levels have areas that are so generic that the player loses any sense of orientation. A good remedy for this is to avoid scattering enemies, obstacles or background elements too much across your level.
It's best to create groups of particular elements in one particular corner so that player will remember and recognize it. Also avoid multiple paths that lead to the same place if you find your test players going the wrong way. If you have to resort to the use of big flashing pink arrows or minimaps to point players in the right direction, you're in trouble.

3. Dead end? WTF?
Have you ever walked through a level and suddenly reached an unexpected dead end? You probably took a wrong turn somewhere without even knowing it. A player should be able to guess that a path is a sidetrack and that it will hopefully lead him to some extra goodies. Important is that the goodies are there of course. Not a ...

2. Surprise death. Again!
If I jump of a ledge because there's nowhere obvious to go next, I don't expect to land in some sort of death trap. In fact, make sure I always know and see where to go next!

1. Unfair punishing of mistakes.
If I don't make a jump because of bad timing and need to make some jumps to retry, that's okay. When I need to redo the entire level, I will get annoyed very very fast. Come to think of it, being able to skip to the end of the level by falling down a platform is a bit of a problem as well.

To wrap it up:
For some classic examples of bad level design (and some good laughs), try to make your may through some review videos of the Angry Video Game Nerd on http://www.cinemassacre.com/category/avgn/

For even more hilarious fun look at some videos of a game called 'I Wanne Be The Guy'. A legendary game that has multiple very surprizing deathtraps in each level.

-- Diederik

maandag 24 januari 2011

Nothing to tell you...

Hi all,

It has been almost two months since my last post… Oops :S Normally I switch posts with Diederik each week, but somehow this got mixed up. The holidays and some of my days off didn’t help either. Nevertheless, I am back with another post and nothing to tell you…

At the moment we have 4 projects in development. 2 of them are TOP-Secret. The other 2 are already regularly mentioned on this blog; Panic at the Zoo and our 3d-platform game (title will be revealed soon).

I am working on one of the TOP-Secret projects. It seems like I am always working on these as others can always mention or show something. They only thing I can tell you it is going to be awesome,.. once again… and that is related to racing and cars,… once again. This project shouldn’t take too long anymore as I am already on it for the last few weeks so hopefully some cool detailed screenshots in the next month or so.

For now I leave you with the most awesome water racing game on the web,.. with explosions!



- Pieter

vrijdag 21 januari 2011

Xform Interns

Xform isn't a huge EA like game company, instead it's a company made out of a handful of dedicated people who enjoy to play and create games. Because we're such a small team we always have a bunch of lucky interns who assist us in creating the necessary game art. Right from the start of their internship they're involved in creating game assets and that doesn't mean they only have to model crates and oil drums. We usually give them a task they can sink their teeth into like modelling, unwrapping and texturing a car or a character. They have to create it from start to finish, in the process we guide them and give our uncensored comments on their work (which means we stand behind them and shout "UGLY"). In some cases they have to start over, but always with a better end result in mind. For the interns it's always satisfying to see the art they've made in the actual finished game.

Right now we're working on a platform game and one of our interns; the bearded Remco, was responsible for modelling, texturing, rigging and animating a baboon enemy. He did struggle at some points, but instead of taking the work out of his hands we let him work on it until we we're happy with the result. Finally yours truly made some minor adjustments and corrections. You can see the end result in the image below.


Matt

woensdag 19 januari 2011

Almost time to panic!

As you might have noticed we've announced the time management game! Panic At The Zoo is pretty much done. I still have some minor tweaks, balancing and bugs left to do before it can be released.

We are probably going to launch the game (few weeks after the first release) in different languages too. This will be a last though job to complete. All of the text displayed in the game is dynamic. They are actually textures created through our 'Text Texture' generator made by Pieter. The system needs several variables before it is able to create a 'TextTexture'. For example, a font, text style, text size and of course the text characters themselves are needed. This texture is then drawn using a mesh which defines the text field. The system also supports automatic text wrapping, resizing and some other tricks to make the text fit inside such text fields. Which comes in very handy when dealing with texts in different languages. Something can be short in english.. but may be very long in another language, which causes trouble.

Before I get on with the localisation system, I'm going to create the final build of the english version of Panic At The Zoo.. Fingers crossed :)!

- Joep

Panic at the Zoo trailer!

Here it is, the Panic at the Zoo trailer!


Keep an eye out for the free Panic at the Zoo game, when it releases next week on all major portals worldwide!

-- Erik

dinsdag 18 januari 2011

Panic at the Zoo trailer and GDC 2011

This week I’m working on the trailer for our upcoming time-management game: Panic at the Zoo. I’ll make sure to do a dedicated post here once it’s actually finished, with a link to the youtube video on the Xform channel. The video is turning out very much like the game; hectic, but a lot of fun. As Xform is a company dominated by male employees, I’m very curious what the ladies think of this time management game (known as a genre dominated by female players) and the trailer I’ve made. Xforms’ strength lies predominantly in the production of arcade type genres, but definitely shouldn’t be limited to only these racing and shooting games. The true test will be when the game hits the portals next week and everyone will get a chance to play the game.


I’m also working on a Xform show reel for the upcoming Game Developer Conference 2011. This will highlight some of last year’s best Xform releases in a very short trailer. If you’re planning to attend the GDC, please visit the Holland Pavilion for a glimpse of Xforms’ latest work or if you have any business you would like to discuss, contact us at directly info@xform.nl

Stay tuned for the Panic at the Zoo trailer!

-- Erik