Cinematic Physics In 3DS Max Part 1

Tutorial collection, comprehensive listings on main site.

Cinematic Physics In 3DS Max Part 1

Postby Tutorial on Sun May 24, 2009 8:38 am

category
Modelling

description
Realistic Valve-like cinematic physics

keywords
physics, cinematic, realistic.


What are Cinematic Physics?
Cinematic physics is a concept valve put into use in The Orange Box. By fragmenting an object, then using a force to push those fragments away, then baking that into a model, you can achieve what looks to be realtime destruction that's easy on the system and looks totally epic!

Sounds fun, what do I need for this?
• 3ds Max (Any newer version will work, i'm using 9, which is the lowest supported.)
• RayFire (Get a free almost fully functional trial at http://www.mirvadim.com
• VTF Importer and SMD Exporter.
• 10-20 minutes of your time

Okay, let's get started.

First of all, install Rayfire and open up 3ds. Go to the top right and change "Standard Primitives" to "RayFire Tool". Then click the "RayFire" button. A button called "Open RayFire tool floater" will appear. Click it. The RayFire tool will open.

Image

Minimize the tool. To start, we need an object to explode. You could import a model from HL2 or TF2 and explode it, but for this tutorial, we'll make our own stuff. Go back to the top right and change back to "Standard Primitives" Create a box 256 wide by 256 long, and make it 4 units thick. You can do this from the "Keyboard Entry" tab. If you have a texture, apply it now. You should have something like the object below:

Image

Now, reopen your RayFire tool. Click the simulation button, make sure your new block is selected, and click "Add" under "Impact Objects". Impact objects are objects that get fragmented and exploded.

Image

Minimize the RayFire popup. Now, create a GeoSphere (Still under "Standard Primitives") however big you want your explosion to be. This will be your bomb. In my case, i want it right under the platform.

Image

Open back up the tool. Go to the RayXplosion button. This is where the magic happens. Scroll down in the list until you see Reactor Explosion and "Bombs". Make sure your GeoSphere is selected and click "Add" to add your sphere to the list of bombs. You can have more than one bomb, but for something like a TF2 Payload explosion or anything else, one should be okay.

Image

Scroll back up to the top of the list. You'll see "Fragmentation options". This is how your slab/object breaks.

Fragmentation type - This is how the object breaks. You can have uniform - all pieces are the same. Irregular - some big pieces and small pieces. Or, Relative to Bomb/Impact - pieces fragment more where the bomb is. We'll use that. Other options are more advanced.

Iterations: X/X - First number is how many pieces you want the thing broken into. This isn't exact, usually it's a little more than what you put in. Mind that you must stay under 127 fragments as this is source's limit. But you can break it up into chunks of models like valve does and have an unlimited number, but that's a little complicated. Let's stick to 40. Second number is how random the fragments are. Let's keep that at 5. That's all you need to set here.

Now click "Fragment impact objects". This will break up your object. Usually you can't notice the fractures in the game unless you look really really hard.

Image

Now, scroll back down again to "Bombs". This is where you can mess around with the settings for your bomb. The two things you want to mess with are "Time Range" and "Explosion strength". The demo has a 100 frame limit, i think. You could leave explosion strength at default for this tutorial, but with bigger objects you need a little more force. Big numbers are not needed, the citadel only takes a bomb of 50 to forcibly explode. 15 will be good for the slab.

Image

Now go click the "Physics" button. Here you can mess with material types, etc. Go down to "Unyielding objects". These are objects that the debris from the fragmented object will collide with. You could import a section of your map where the exploded object is and use this to collide with the debris, but i'm not going to go into detail with that (In short, export your map in Hammer as a dxf, import in 3ds using "Layers, Blocks as node hierarchy", and make this your impact objects.). We'll just make blocks as the ground around the slab.

Image

Now, select these blocks and anything else you don't want to move during the explosion (Even pieces of the fragmented slab if you want to) and click "Add" under unyielding objects.

Image

Good, nearly done. Go back to the RayXplosion tab, scroll down to bombs, and click "Explode impact objects". It will warn you there's no going back. Click OK. Yay, big boom! It'll warn you about interpenetrating stuff, don't worry about this, you can click OK.

If all is well, you should have something like this:
Image

Now, delete everything you used for colliding with the debris, like your map you imported or whatever, and also your geosphere. You should be left with just the debris and the little blue marker it created. You're done! Move the animation timeline at the bottom back to 0.

Now, go to File > Export. Export as SMD (If you don't have SMD import/export i suggest you go get them at http://www.wunderboy.org/) First export as a reference (We'll call that "slab_ref.smd"), then export as a Sequence SMD from frames 9-100 (Or replace 100 with however many frames you set the animation to be). We'll call this "boom.smd"

The exporter seems to bone every piece for you. If you get an error about too many bones, you need to break your model into chunks.

Viola. Here's my qc file for the model:
Code: Select all
$cd "C:\slab"
$modelname "PhysXDemolition\slab.mdl"
$model "Body" "slab_ref.smd"
$cdmaterials "models\props_physxdem\"

$sequence idle "slab_ref" loop fps 30.00
$sequence boom "boom" fps 30.00


- Jimmy422
- Don't send PM's to this user -
Tutorial
Not A Real User
 
Joined: Sun Mar 06, 2005 11:00 pm

Re: Cinematic Physics In 3DS Max Part 1

Postby vcool on Sun May 24, 2009 9:10 am

Hehe, nice Jimmy. I was thinking of writing a tutorial about RayFire as well.

Nice work.
Image

Neighborhood Forum Elitist
User avatar
vcool
Veteran
Veteran
 
Joined: Fri Jun 23, 2006 1:03 am
Location: USSR

Re: Cinematic Physics In 3DS Max Part 1

Postby Jimmy422 on Sun May 24, 2009 9:02 pm

-reserved for possible other stuff-

Also thanks vcool.
Image
User avatar
Jimmy422
Regular
Regular
 
Joined: Sat Sep 15, 2007 2:59 pm

Re: Cinematic Physics In 3DS Max Part 1

Postby TicTac on Mon May 25, 2009 2:25 pm

Thanks so much, jimmy! I didn't know you could use Reactor's 'bomb' on anything but particles, and RayFire looks like another winner, too!
Bookmarked,
-Tic
Competent Level Designer, 3D Artist.
I don't really look like my avatar
User avatar
TicTac
Veteran
Veteran
 
Joined: Sat Aug 02, 2008 1:30 am
Location: Philadelphia

Re: Cinematic Physics In 3DS Max Part 1

Postby stoopdapoop on Mon May 25, 2009 3:32 pm

very nice tutorial, looks like it'd save alot of time compared to manually breaking up a model.

But about the 127, fragments, maybe you could include a way export the model in chunks so that you can have more than 127 parts for more complex simulations.
I'm Brown
Image
User avatar
stoopdapoop
Veteran
Veteran
 
Joined: Sun Aug 21, 2005 2:14 am
Location: Ann Arbor, MI

Re: Cinematic Physics In 3DS Max Part 1

Postby TicTac on Mon May 25, 2009 4:08 pm

It's really self-explanatory, imo. Just take 'chunks' of your model, select them, and then move each 'chunk' to it's own .max file, then export them as individual models with the same anims (I think...;))
Competent Level Designer, 3D Artist.
I don't really look like my avatar
User avatar
TicTac
Veteran
Veteran
 
Joined: Sat Aug 02, 2008 1:30 am
Location: Philadelphia

Re: Cinematic Physics In 3DS Max Part 1

Postby vcool on Mon May 25, 2009 5:04 pm

Or select all that are more than 127, delete, export, Undo, invert selection, delete, export.
Image

Neighborhood Forum Elitist
User avatar
vcool
Veteran
Veteran
 
Joined: Fri Jun 23, 2006 1:03 am
Location: USSR

Re: Cinematic Physics In 3DS Max Part 1

Postby ghost12332 on Mon May 25, 2009 5:45 pm

Oh my god. This is so awesome!
Ryder: i see ghost as a evil scientest who wants to kill everyone for the good of humanity
User avatar
ghost12332
Senior Member
Senior Member
 
Joined: Sun Jul 15, 2007 11:25 pm
Location: Guitar Center

Re: Cinematic Physics In 3DS Max Part 1

Postby Jimmy422 on Sun May 31, 2009 6:53 am

Made a quick youtube video today showing it off with glass
Image
User avatar
Jimmy422
Regular
Regular
 
Joined: Sat Sep 15, 2007 2:59 pm

Re: Cinematic Physics In 3DS Max Part 1

Postby CorporalAris on Sun May 31, 2009 7:11 am

That is sweet!
Image
User avatar
CorporalAris
Been Here A While
Been Here A While
 
Joined: Tue Apr 22, 2008 10:10 pm

Re: Cinematic Physics In 3DS Max Part 1

Postby thebeanie on Sun May 31, 2009 9:16 am

Ah, this is great. I need to go and torren^H^H^H^H^H^Hbuy 3Ds Max and Rayfire right this very minute!
User avatar
thebeanie
Been Here A While
Been Here A While
 
Joined: Thu Feb 07, 2008 11:48 am

Re: Cinematic Physics In 3DS Max Part 1

Postby FlynT on Thu Jun 04, 2009 2:43 pm

How great you are! I recently switched to 3DS for my Modeling Stuff and now you you kick this great Tutorial straight into my Face. Really Jimmy you are my Hero of the Week, tones of thanks for it, can't wait for the second part.
Image
*Ahhrr, my Nipples they Hurt, they Hurt when i twist them*
User avatar
FlynT
Been Here A While
Been Here A While
 
Joined: Sun Jun 15, 2008 2:59 am
Location: Germany

Re: Cinematic Physics In 3DS Max Part 1

Postby - Livewire - on Tue Jun 16, 2009 10:52 pm

Anyone have a solution for RayFire's frame limit? All my animations seem to cut off at around 70 frames. :(

Which is literally nothing, most of the debris hasnt even made it to the floor by then, let alone stop moving...
User avatar
- Livewire -
Been Here A While
Been Here A While
 
Joined: Sat Aug 16, 2008 9:20 pm
Location: Wales, UK.

Re: Cinematic Physics In 3DS Max Part 1

Postby vcool on Tue Jun 16, 2009 11:15 pm

Eh? That's strange.

I'll check it out now.

In Physics tab, set your time range. Go over the top to be sure, because you can always delete the still frames you don't need.

Now open up the animation settings in Max, and put the same number in end of range.
Image

Neighborhood Forum Elitist
User avatar
vcool
Veteran
Veteran
 
Joined: Fri Jun 23, 2006 1:03 am
Location: USSR

Re: Cinematic Physics In 3DS Max Part 1

Postby - Livewire - on Wed Jun 17, 2009 5:06 pm

My time range goes no higher than 150, I'm new to max so I'm not sure where the animation settings are...

Nevermind! SOLVED!

And it looks awesome, thanks for the tutorial! And thanks Vcool for the help.
User avatar
- Livewire -
Been Here A While
Been Here A While
 
Joined: Sat Aug 16, 2008 9:20 pm
Location: Wales, UK.
Next

Return to Tutorials

Who is online

Users browsing this forum: No registered users