|
|
|
|
|
Please take note! For mod developers working with Unreal Tournament 2003, this documentation is meant to be a starting point for your own explorations into UT2003, not a definitive guide. There will be differences between the documentation here and the product in your hands, and you may have to figure out quite a bit for yourself. Check out the Unreal Tournament 2003 page in the Unreal Powered area for links to community sites if you're having problems. UDN is a licensee support site, and cannot provide technical support or game-specific assistance to end users.
|
|
|
|
KarmaExample1 |
|
|
|
|
|
Licensees can log in.
Interested in the Unreal engine? Check out the licensing page.
Questions about UDN itself? Contact the UDN Staff.
|
|
|
|
|
|
|
|
|
Last Edited by James Golding. ( james.golding@mathengine.com )
http://www.mathengine.com/" target="_top">http://www.mathengine.com
See also:
KarmaReference
KarmaExample2
WORK IN PROGRESS!!
Note - this tutorial is for an earlier build of the Unreal Engine, NOT for UT2003. I will update the documentation as soon as I get a chance!
- Karma - Example 1
- Overview
- Getting Started
- Creating Graphics With Collision
- Adding To Level
- Setting Parameters
- Playing The Level
- In Closing
This tutorial introduces the basics of adding Actors to a scene driven by Karma physics.
Load UnrealEd, and create a nice simple square room (say 1024x1024x1024) with unlit walls, add a start position, a weapon (sniper rifle works well) and rebuild it. You should get something like:
Now we need to create our object. If our object is going to simulated with Karma, we need to give it a simplified collision geometry as well as the high-poly graphic mesh. For this example, we are making a telephone receiver. So we model it inside MAX as usual, then add two spheres and a box that approximate the shape.
Each collision part's name must start with a keyword to say what type of shape it is. These keywords are:
MCDBX | Box Primitive |
MCDSP | Sphere Primitive |
MCDCY | Cylinder Primitive |
MCDCX | Convex Mesh Primitive |
So in this case, our handle is called MCDBX_Handle and the two ends are called MCDSP_Speaker and MCDSP_Mic. Then we export the whole lot as one .ASE file.
If you want them, the example .MAX and .ASE files are attached at the bottom of this page.
Inside UnrealEd, import the .ASE file in the usual way. After importing the graphics you should see a dialog saying 'Karma Collision Data Found. Do you want to add to StaticMesh?'. Answer YES, and UnrealEd will conver the collision geometry parts to the simple shapes they represent, as well as calculating a default contre-of-mass position and inertia tensor for this static mesh. You should see this message to indicate this:
In the static mesh browser, you should be able to see a asterisk next to the mesh name. This indicates that this static mesh has Karma properties stored with it.
In this case, the material has been set to a nice environment map.
Once you have a static mesh with Karma properties, you can add it to a level in a similar manner to adding a normal static mesh. Make sure the static mesh you want is currently selected, right click on one of the viewports and choose 'Add Karma Actor' from the menu.
You should see our telephone appear. Move it to about the middle of the room.
Note, that if you do this with a static mesh selected with no asterisk (ie. no Karma properties) nothing will happen.
There are several properties that can be set for an Actor using Karma. Bring up the properties for the phone we just added, look under Karma, KParams, then into KarmaParams and you should see something like this:
The default KFriction setting of our phone is 0, which is completely slippery. Change it to 0.2 as in the screenshot above, but we'll leave everything else at its defaults for now. Note that 'KStartEnabled' is set to False (we'll come to that in a sec).
See the KarmaReference document for more information on KarmaParams settings.
Save everything and launch the level. You should see your graphic floating in space. Before going any further, we'll turn on debugging information. Hit 'Esc' to bring up the Debug Menu, then select Karma->Com and Karma->Collision (you can also do this by typing 'kdraw com' and 'kdraw collision' at the console). This will toggle on drawing the Karma collision geometry, and the Actor's centre of mass. You should see something like:
But why is it hanging in the air? Karma automatically disables simulation of Actors when they come to rest. They are enabled again when shot, or hit by another Karma Actor. By default Actors are disabled when the level loads, although you can change this by setting the 'KStartEnabled' parameter we saw earlier to True.
If you shoot the phone it should start simulating, and fall to the ground. Shoot it around a bit.
That's the basics of adding single objects to a scene and using Karma to simulate them. If you experience odd behaviour or crashes, make sure you check the UW.log file to see if there are any helpful warnings. Also, make sure you check the KarmaReference page and the Karma User Guide.
Try also:
- Adding another object at a different scale. Collision geometry, inertia tensor and centre-of-mass position are scaled automatically. See how they behave differently.
- Set friction to zero and see them skate around.
- Add a physics volume, set gravity to (0, 0, 0) and see them float in space.
Attachment: | Action: | Size: | Date: | Who: | Comment: |
telephone_ase.zip | action | 147085 | 04 Jan 2002 - 21:21 | KarmaUnrealIntegrationTeam | Example Telephone .ASE file (zipped) |
telephone.max | action | 188416 | 04 Jan 2002 - 21:22 | KarmaUnrealIntegrationTeam | Example Telephone .MAX file |
|
|