740 likes | 869 Views
Sega 500. How to get stuff into UT2003. Jeff “Ezeikeil” Giles jgiles@artschool.com http://gamestudies.cdis.org/~jgiles. To date. We’ve covered lots of building functionality for UT, even imported some items.
E N D
Sega 500 How to get stuff into UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com http://gamestudies.cdis.org/~jgiles
To date • We’ve covered lots of building functionality for UT, even imported some items. • However, we’ve not covered how to export objects from a modeling environment and then import them. We’ve only look at them in the expected format.
And so… • Today we are going to be playing around in 3DS max and create some simple static meshes and import those, along with appropriate karma collision volumes.
Plus… • We are also going to create a simple character model and import that along with some basic animations. • Now keep in mind, I’m a programmer Jim, not a 3D modeler.
Step one • We’re going to jump into 3DS Max and create one of the staples objects in 3D games… • The simple crate.
But first… • A simple modeling tip for UT. • Your average player character stands about 90 UU’s tall. Knowing this, if we set the units in 3ds max to generic, we can export at a one-to-one scale.
A Modeling tip for UT • E.g., if we want the crates to be about 2/3’s the height of the pawn, we build them in Max at about 60 generic units. • Thus when imported into UT, the will be 60 UU’s high…exactly 2/3’s the pawns height.
A Modeling tip for UT • You’ll find this setting under the Customize roll down under units setup. Set to generic units
Now like I said… • This class is more about scripting and mod authoring as opposed to modeling, so I’m not really going to talk about the modeling process in any detail. • However, we will go through the process here in class as there are some interesting things we really should be aware of.
This being the case… • Lets start the process. • Here’s the basic shape we are after. • This is made up from actually “2” objects
The reason being… • Is that UT actually supports multi skinned objects. • If you take look at the pawns defaults in the editor you can see that this is the case.
Multi skins • One for the body, and one for the head. • Now, I’m not sure how many each model is allowed, but I’m thinking several.
Multi skins • This being said, I’ve created my crate out of 2 objects so that it’s really easy to set up the Multi skins. • Now there are several ways to do this via the editor, this is just one possible method.
Multi skins • In effect, each skin will have it’s own set of UV’s and then I did a boolean operation on them (union) to form a single object. • Once textured and the UV’s properly set up, we are ready to export from the modeling package.
Which leads me to why… • I chose to demonstrate this in 3DS Max for a couple ofreasons. • First off, I’m far more comfortable with it than Maya…but this is a personal preference. • Second, UEd has tools build in which allow for direct import from 3DS Max, making the process super straight forward.
Exporting from Max • From the file roll down, pick export or export selected. • The for the file format, we want ASE.
Exporting from Max • Which will present use with this popup: • I’ve found using the default settings to work just fine.
Importing into UT • To get this static mesh into UT is just about as easy as the export. • From the static mesh browser, under file, select import. Then the file you just exported from UT.
Importing into UT • Next is the naming for the imported object. • Done in exactly the same manner as textures…
Importing into UT • And Bob should be your uncle. • Complete with the rotten cottage cheese texture.
Importing into UT • But check this out: • If you roll out the materials section, we have 2 materials which can now be applied to this object.
Importing into UT • Now just import the textures into UT as well. • Be sure to save both the utx and usx packages.
Importing into UT • Assign the new textures to the desired materials for the static mesh and save out. • Now, be for warned, the image will not refresh until the package is saved!
Crates into the game • Once this is all done, we can simply start placing crates into the level.
However… • There are a few things to point out. • To begin with, these particular crates are way too heave on the poly count…400 of them. • I put zero effort into optimising this as that a topic best left for a modeling class.
However… • And, yeah, they ARE static meshes which means we get all sorts of performance increases like a small memory foot print. • But UT still has to render allthese poly’s. So we really should be concerned with optimising where we can. • With a little effort, I’m sure we could cut this number in half and have it still look just as good.
And… • There’s a small problem. • They have no collision parameters…
Adding simple collision • Is actually quite easy. • Since this is a simple shape (a box) we can do this right inside UEd. • Now there are a couple of was to do this, and you can find about about all of them here: http://udn.epicgames.com/pub/Content/CollisionTutorial/
Collision for our crate • Default properties of how the collision model is used:
Collision for our crate • If you look at the top of the static mesh browser, there a tab for collision tools. • if you pull it down you see a bunch of references to K-Dop.
About K-Dop • Best suited for simple collision models, you can use this fitting tool. • K-DOP stands 'K discrete oriented polytope‘. • Basically it takes 'k' axis-aligned planes and pushes them as close to the mesh as it can. The resulting shape is used as a collision model.
In other words • We can use it to build simple collision models for your static meshes.
In this case • K-Dop 6 will work just fine for us. • Doing so will build a very simple collision cube right around our crate. • You can view this volume by selecting show collision under the view tab. • Oh…be sure to save…
And that should do ya Yup! Seems to work!
Now what fun are crates… • If you can’t smash them to find stuff inside.
More collision • I’m showing you this part because sometimes the K-Dop collision, as good as it is just simply will not do. • If I were to use it here, I would end up with an invisible plane which I would collide with across the top of the smashed crate.
Fancy collision • I wouldn’t get something like this:
In effect, • We model separate collision parameters for our smashed crate. • Now we can’t just copy the object and use that as collision, once it gets over a certain size, it stops working. • You ideally want to keep the poly count below 10, certainly under 100 for karma collision.
Mine crates collision • Weighs in at a heavy 28 poly’s…but it works fine. • Once again, I spent no time on optimising this.
So how did I… • Get these collision parameters from Max into UT? • Well, the boys at Epic actually build a parsing mechanism which looks for objects with a specific prefix in their name.
Here… • All I had to do was model a lower poly version of the smashed crate which approximated the dimensions of the original. • Placed it at exactly the same location and lined them up as close as possible.
Then… • I renamed named the model which was to be the karma object to MCDCX_Box.(case sensitive ) And then exported it just like I did before into an ASE file. • When you import the .ASE into UnrealEd it should find the collision mesh, remove it from the graphic, and turn it into the collision model.
And scripting this up • Is nothing more than if the crate takes damage, swap the meshes and spawn the pickup…real easy stuff. • And since the code aspect is so easy, I’ll leave it for you to figure out.
But we’re not done yet! • We’re going to wrap up the rest of the class by looking at what it takes to import character models, complete with animations, into UT. • Starting with:
Pacman Like I said, I’m no artist ;-)
Keep in mind… • I’m not going to go into detail on how to animate this guy. Just how to get it into UT along with a basic walk, run…and with any luck (time permitting) an idle.
On a side note… • If your interested in using or looking at how epic set up their models, you can get the make files from my P drive or download them from fileplanet: http://www.fileplanet.com/dl.aspx?/planetquake/polycount/ Tools/ut2k3/ut2k3_characters.zip
Getting started… • Well, we really only need three things to get Pacman into UT. • A model • A texture • One bone (minimum for the weapon. However we can also include the one for te derez effect too.)
Once you’ve got your model • We need to put a bone in it so the UT knows where to attach the weapon to the character. • This bone also denotes the weapons orientation.
Adding the weapon bone • Place the bone anywhere you want in the model, keeping in mind that the fat end of the bone is the “Business” end.