CellFactor the trailer and comments

betajaen

26-03-2006 14:47:13

http://www.gametrailers.com/gamepage.php?id=2510


Above is a link to a lovely trailer about the game "CellFactor" released for the PC and XBox 360 next year, upon many things it uses the famous physics library we all know and love - PhysX

Kudos to the developers, it looks really nice and I'll probably get it when it comes out, but as a developer or a PhysX developer I wanted comment about it.



I've gone through the trailer a few times now, and I'm pretty certain with enough time and patience it can be replicated using Ogre and NxOgre.

I'll only go through the Physics parts as I'm not qualified or knowledgeable enough to talk about the other bits such as the shader effects.

So here we go, from start to finish:-

Breakable boxes

First few seconds two players fire-fight across bunch of cardboard boxes, the boxes move around and some break apart. It's just a few bodies (say cubeShapes with thin dimensions for each side), and joined together with a breakable hinge joint. There is probably some callbacks in there to monitor the amount of torque and force being applied to those joints if it exceeds some amounts, the joint or the entire box breaks.

Uses: Bodies, cubesShape's, Breakable hinge or fixed joints

Sudden surge of intense gravity in the middle of the scene. Like a lethal Katamari.
This is shown about 10 seconds afterwards, in the distance of the fire fight, about 20-30 cynlinders start to move towards a point above the ground. Then clump together. It's just forces, gravity may be reduced or turned off for them to move better.

A spherical trigger may be used, with encompasses the entire scene, things closer to the centre move quicker where as things far away are ignored.

Uses: Forces, Triggers.

The explosion shortly afterwards
Probably a spherical trigger (probably the same one) which applies forces outwards.

The slow-mo effect is just calling PhysX scene updates less and less.

Uses: Forces, Triggers.

Players jumping

Easy, the character controller, or their own character system. Either with a box or a capsule which is set to stay upright.

Uses: Character controller or a custom body.

Player falls to the ground when dies
Easy, ragdolls. Every physics engine does them now.

Uses: Bodies, Joints or the Ragdoll class.

Bullet traces
Either ray tracing and appling a force to each body it hits, or a short-term fast moving body.

Use: Raytracing or Bodies.

Players hand moving things like a gravity gun or causing him to jump
Just forces again, player jumping with the hand is just a super jump.

Uses: Character Controller and Forces.

Flying vehicles in the scene
Just a collection of bodies that ignore gravity. Forces are used to move it.

Uses: Bodies or the upcoming levitator prefab class.

Grenades the a missile explosion
Probably short term triggers to cause the explosions. The grenade is just another body.

Uses: Bodies or the upcoming exploder prefab class

Buggy with gun
Just a vehicle, probably uses the NxWheelShape or if the wheels can break off; motor joints and spheres/cylinders.

Uses: Vehicle Prefab or motor joints and spheres.

The rest is just eye candy and more related to Ogre which I can't comment on to well, but I'm pretty sure Ogre can do that with a little help from shaders.

Anyway, after seeing that demo I'm looking forward to this game and hopefully it should bring some more interest to Aegia and the PhysX PPU card.

Wretched_Wyx

28-03-2006 18:34:12

Nice... Good breakdown. Yet more motivation that will leave me without much needed sleep :P

betajaen

29-03-2006 09:04:21

Nice... Good breakdown. Yet more motivation that will leave me without much needed sleep :P

Let's see you create a CellFactor clone with Ogre, it's all there! However your brain may hate you at the end with the lack of sleep you didn't give it.

Wretched_Wyx

29-03-2006 13:15:40

Hehe, I may just do that. It would be a good learning project, thats for sure. And I think the hardest part of the project would be making some good content, ie rigged character models and animations to be specific. I stink at that stuff. Like a week old dead skunk in the laundry basket from Leather Face's basement from Texas Chainsaw Massacre.

I also don't understand "rays" for bullets and stuff. Not too hard I know, just not that much experience. I need to do some simple demo where you shoot a small cube at what your pointing at to learn it. Then figure out how to generate a decal where it hits. I know there are tutorials/snippets for these things, but everything is so spread out, takes alot of trial and error to get things working half-way correct. I'm like a nerd being thrown in the middle of a colloseum with an endless amount of fighters and tigers coming at me. I don't know how to fight, but I sure will learn if I want to make it through the day :P.

betajaen

29-03-2006 14:11:13

You wouldn't shoot out a cube; too slow and too inaccurate. You'd use a Ray which is best to think like a laser beam attached to a camera flash.

Take a picture, laser points where you are looking at it then returns the body hit, how far away it is and other things.

The Decal then can be worked out if the shape is the same as the Ogre mesh (or almost) using the new decal code that is floating around the forums and wiki.

Easy as pie!

Wretched_Wyx

29-03-2006 14:46:06

Lol, I should have been a little more specific with what I meant (though you're still right) about shooting out the cube- Just to simulate a bullet. But I guess real object bullets would slow things down, so simulated raytraced bullets are the way to go. Thing is, I've always dreamed of being able to actually have bullets flying through the air, so when you paused or slo-mo'd you could see them flying through the air. Like in Max Payne 2. So is ray casting the same as running a raytrace? Or do the two work together? Like the raycast is actually shooting it out, and the raytrace is returning what it hits (and doing something if its told to)?

lem_muppet

25-04-2006 07:52:27

Thats a very impressive video, at first glance its just an insane amount of rigid body pyhsics, but watching it again, i see they are using the fluid dynamics for blood, and cloth simulation as well.
I dont know about the fluid for blood tho, looks a tad too blobby for my tastes hehe cool none the less. I really liked the ship flying thru the big cloth banner near the beginning

SealedSun

29-05-2006 18:27:08

CellFactor is a techdemo for three products: the PhysX PPU, Kynapse AI and
Artificial Studio's Reality Engine which uses C# as its scripting language. The demo comes with the complete source for the game module (not the engine). Unfortunately mostly uncommented.

But I found out that:
  1. Breakable Boxes spawn new pieces when you do enough "damage" to them. That's also the point where the engine decides whether the crate contains an ammo pack or not. if (MHelpers.random.Next(10) < 4)
    {
    PickupAmmoEx AmmoPack = new PickupAmmoEx(MyWorld);
    Location.Copy(AmmoPack.Location);
    Rotation.Copy(AmmoPack.Rotation);
    }
    [/*:m]
  2. The Plutonium Containers (the glowing things that fly around and attract everything before exploding) loop over every actor in a 21 units sphere around them and apply a force on each physics object. Like the crates, they spawn debris upon exploding.[/*:m][/list:u]
    The player and vehicle related stuff is a bit more complicated to understand but I think it has been done using forces like you already mentioned.

    From my point of view, CellFactor: Combat Training is a next-next-generation game. I can barely run it on lowest details in 800x600 on my Intel Pentium 4 3GiHz, 1024GiB RAM and nVidia GeForce 6800GT with about 15-20 fps. Explosions reduce the framerate even further.

    And the Readme.txt says: Recommended (Run "CellFactor Low Graphics"):
    2 ghz Pentium 4
    1024 mb system RAM
    256 MB GeForce 6800 or Radeon X800 (game will scale down the Texture Size to 50%)
    AGEIA PhysX Hardware with 2.4.9 driver installed
    The demo is no longer playable when I enable bots (5-10 fps)...

    The fact that CellFactor does not run without the PhysX PPU is a bit strange since it is the only game that uses Physics hardware acceleration of "Game Physics". (Ghost Recon lets PhysX only handle debris but not grenades and cars) At this moment there is no way to show the performance gained by installing a PhysX card.

betajaen

29-05-2006 19:29:52

Intresting, thanks for that. I assume your in the know how or have played with CellFactor quite a bit.

And I agree with your signature there, PhysX is pretty damn good :D