Unreal PSK Vehicles for TrueSpace

26-June-2004

updated 21-August-2004

25-August second vehicle attempt not as smooth as first, need to rewrite these notes
2-October-2004  alternate way add vehicle to level







The unreal vehicle needs to be built with the front in the positive world X direction. The joints for the wheels, the struts, the turret in back and the 2 miniguns in front all connect to the root joint. After the joints are all put into position they need to be rotated to the proper orientation. The minigun and turret joints need to have their X axis pointed in the direction of the guns barrel and with the Z axis upward. The wheel joints need to have the Y axis pointed towards the rear of the vehicle and the Z axis upward. The root bone is handled by right clicking the PSKexport icon to switch to 'vehicle mode', this makes the plugin ignore the root joint orientation and treat it as if it had zero rotations. The mesh is attached after all the joint locations and orientations are set.

The mesh and the skeleton need to be built with both their axes at (0,0,0). Once the mesh is in the proper position and orientation(forward X) then build the skeleton. Next normalize the skeletons location so that the axis of the root joint is in the same location as the mesh's axis. Finally readjust the other joint locations so they are back in their proper positions. The skeleton joints should be built with Yaw, Roll and Pitch enabled and with a range of motion of about +180 max and –180 min for each of them.

Recommend Auto Save not be selected

This message box is incorrect and should indicate that the front of the vehicle be in the positive X direction.


If you get the Y direction message above download the updated PSKexport.tsx



This skeleton has no gun attachments and consists of the root joint in the center, the 4 strut joints toward the top and the 4 wheel joints. The PSKexport plugin ignores the leaf bones so an extra joint has been added to each wheel. This way the wheel can be skinned to a bone instead of the joint and the motion can be tested for proper rotation and vertex assignment.

My mistake, the plugin does not ignore the leaf bones

do not add extra joint's to the wheels

better to assign vertices to bones than to joints

The joint's positions change when the scene or skeleton is saved and then reloaded. The joints above should line up perfectly but the save and reload has altered their positions. Not really an issue for charater animation, but this can cause the wheels to wobble when animated in the game.

First move the nail to the other side of the root joint and move the bone so that it points upward. Move the nail back to the original bone and pull the multibranch bone downward. Now save the scene to “set” the skeleton and reload it back in. If the scene is not saved/loaded at this point the central branch will pop back into it's original position. Now the joint positions can be fine tuned if needed without the joints moving spontaneously. This seems to work but the reason is beyond me.

Final skeleton after “stretch hardening”



The skeleton joints should be built with Yaw, Roll and Pitch enabled with a range of motion of about +180 max and –180 min. This helps the next step go more smoothly.

This is my workflow for aligning the joints for the vehicle.

  1. Select the bone below the joint in the Scene Editor

  2. Click in the scene and up arrow to select the joint

  3. use Edit Joints Directly and set Yaw,Roll and Pitch to zero(also be sure limit range is + – 180 degrees)

  4. set rotations(XYZ) to zero in the Object Properites

  5. rotate the joints in pitch and yaw (any amount) then set rotations to zero again (steps 3 and 4 don't always get all the rotations out)

  6. if joint is for a wheel set Roll to -90 so Y points backward and the X lines up with the wheel axel

If the joint refuses to line up, go on to another joint and return to the trouble joint later and repeat the steps above.

I do it this way so that I can check the joints orientation by using the show axis tool



Front Right Tire Joint (-90 degree Roll)

Axis of Front Right Tire Joint (Z up, Y towards the rear)









The minigun and turret bones are built a little differently.

After the joints are properly aligned the joint translations are used to get them into proper position.

TrueSpace bone structure

Unreal result – note that bones red(X) points forward and blue(Z) is upward



The images below show the sequence for creating the bones for the turret object


First create a normal skeleton




Second zero out the rotations including the root joint


Use the joint's translation in XYZ to move the joints back into position. Start with the joint closest to the root.

In this way the joints will have the proper location and orientation needed by Unreal




Save the scene before exporting to PSK. Triangulate the object just before exporting it. Avoid saving the scene after the export.

Export the guns and turrets using the PSKexport plugin's normal character mode.

It is possible to build a vehicle in this manner without using the vehicle mode export, but the skeleton would be extremely ugly.

After the vehicle is in the unreal level, set the game type to “Onslaught.ONSOnslaughtGame”

You may need to change teams during play to unlock the vehicle.

The minigun works but haven't gotten a working turret yet.



First thing save the level with a name that begines with “ONS-”

then set the gametype as shown and save the level again

Easiest is to load one of the ONS maps that already exists and use it to test the vehicle.  When inside game move away from the player start and press <tab> then type
SUMMON YOURVEHICLEPACKAGE.YOURVEHICLECLASS

The mesh seems to get stuck and wont update manually, delete the u and ucl file and imported textures and imported mesh files(details forthcoming-still in middle of figuring it out)
dont put texture in same package as mesh



An alternate method of adding a vehicle to any map type is to edit the vehicles properties after adding it to the map.



In the Advanced tab of the properties set bGameRelevant and bNoDelete to True
In the Vehicle tab of the properties set the team to 255 so that anyone can get in and drive the vehicle.

For more information check out the Vehicle VTMs available on the Unreal2004 DVD. Below is the only other tutorial for vehicles I could find at this time.

3dbuzz.com has some new video tutorials on different game types including onslaught

http://udn.epicgames.com/Two/SVehicleCreation  is a good  tutorial

http://www.psyonix.com/htmlsite.html