Sega 500 How to get stuff into UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com jgiles

Preview:

Citation preview

Sega 500

How to get stuff

into UT2003

Jeff “Ezeikeil” Gilesjgiles@artschool.comhttp://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 all these 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.

Now before we animate

We need to group the bone with pacman so that UT knows they are the same object.

Just hit the group roll down and click “group”.

Now we can animate away

For the walk, we’re just going to do a simple bouncing up and down motion.

To get started, hit the autokey button to go to animation mode. When selected, it should turn red.

Now move Pacman around

With each move folowed by the release of the left mouse, Max will drop a keyframe onto the timeline, indicating Pacman’s position in that frame.

To stop animating…just click auto key again.

Now your timeline

Should look some thing like:

And if you’ve done it right, as you move the time bar, Pacman sould bounce up and down.

StartTop of bounce

Back at start pose

Time bar

Which means…

We are now ready to export Pacman and his walk animation.

To do se, we need to use actor X which should be included in Max already.

Click on the tab with the hammer on it...then the more button.

Then

Pick ActorX out of the list.

With this tool we will export both the mesh file (.psk) and the animation file (.psa).

ActorX

The actorX menu is really broken into two areas of functionality to reflect this.

The top half is for the mesh,

and the lower, Animations.

ActorX

The Mesh exporter is pretty self explanatory

However you will have to go into the setup tab and make sure “all textured Geometry” is ticked for it to work.

When your ready, save the mesh.

ActorX

Now, when we start talking about exporting the animations, things can be a bit confusing the first time through.

In essence, we need a file name (no surprise there), the name of the sequence and what key frames is happens over.

ActorX

Here’s how we set up our walk animation for export.

The name should correspond to an existing animation name in UT. Ideally, you’d want to follow this naming convention.

ActorX

If you don’t, when you use the default controllers, your mesh will spit out accessed none errors for all the animations it can’t find.

Trust me…it’s a lot.

ActorX

An now we need to tell it what frames correspond to this animation…

This will be in exact correlation to the time bar.

walkF

ActorX

Once we’ve figured that out, we need to digest the animation.

Essentially ready it for export.

Then hit the Animation manager.

Digested Anims

Available anims Being exported

Digested Anims

Just move the animations you want to export over to the right hand side and hit save when your ready.

Note: On my home machine I had problems exporting more that 2 at a time. Anim’s after the 2nd would cause the mesh to rotate for some strange reason.

Now with PSA and PSK in hand...

We jump on over into UEd to import the them.

Stating with the mesh… Pull up the animations browser an hit

“mesh import”.

And you should see

Pacman

Don’t forget your textures ;-)

But no Ani’s

Yet…We need to import those as well. From the file roll down, “animation import“.

This should cause the Sequences list on the left hand side to populate.

But they still don’t play…

Don’t worry the animations are in…but they need to be linked to the model.

Just hit this button then save.

And now Pacman…

Should animate in the view window no problem.

For addition animations to add to the model, just use “animation append” under the file tab.

Getting Pacman into UT

The cool part is that we don’t need to code anything to get UT to use the new player model.

Just create a new upl file and set the mesh.

My upl file

And this should be all you need:[Public]Player=(DefaultName="MR. Pac", Mesh=Pcman.PC,

species=xGame.SPECIES_Merc,BodySkin=pcSkins.Skin,FaceSkin=pcSkins.Skin,Portrait=pcSkins.Skin,Text=XPlayers.MercFemaleAA,Sex=Female,Menu="SP",FavoriteWeapon=xWeapons.LinkGun,Accuracy=-0.1,Tactics=+0.5)

An now in UT

We should be able to select Mr. Pac from the players list…and in game have

Et Voila!

All the basics you’ll need to know about importing models, collision and character models into UT.

Recommended