GTA4: Scene assembly

GTA San Andreas and GTA Vice City discussion.

Moderators: Oleg, _RicH_

GTA4: Scene assembly

Postby Oleg » Tue May 01, 2012 1:28 am

GTA4 vehicle scene assembly.

GTA4 Collision model
GTA4 Materials and textures
GTA4 Lights

Vehicle model should be laid in proper scene assembly. The root node should be, preferable, a dummy node named exactly as the file you will be exporting to (e.g. "pcj600.wft" if you will export to pcj600.wft file). This dummy will contain whole scene that should be exported. Thus, for example, if you have some temporary objects or parts that you don't want to be exported, they should not be in a branch of this dummy - lay them nearby, above for example.

Then a dummy "chassis" follows. This will be a root of entire model when exporting - there should be no other objects under "file_to_export.wft" root dummy, even thought it's possible to export almost any scene layout.
gta4vehiclescene01.gif (7.68 KiB) Viewed 4983 times

Geometry object names should exactly match the name of parent dummy and optionally can have level of detail indicator on a tail: _L0 for highest detail, _L1 for low-detail and _L2 for the lowest detail. Filter will assemble entire model from high-detail parts (all *_L0 parts), low-detail model from all *_L1 parts and lowest-detail model from all *_L2 parts. If at least one part for certain lod is available, this lod is used ingame and will appear on predefined ranges. Note, you can't create low-detail meshes for just few parts, you need to create meshes for all parts, otherwise model will be incomplete.
If all parts/panels for low-detail lod are missing, game will use high-detail model on close and far distances, thus, it's allowed to have only high-detailed mesh.

Why low-detail model is important?

Low-detail models are drawn on medium and far distances and do not cause performance penalty. But the most important thing is a visual deformation of high-detailed model. When you scratch or damage the car, shot it or hit pedestrian, the game will draw scraches, blood and bulletshells using low-detail model. Literally, if high-detailed model is cube and low-detail model is sphere, bulletshells on cube will appear on "spherical surface" and will fly around a cube.
If your model does not show bulletshells when shot, it's probably because of absence of low-detail model.

Parts on rotational joints

Vehicle model can have several parts on rotational joints (doors, bonnet, boot etc.). It is important to set shape of associated dummy to sphere and not use sphere dummies for the rest of objects in scene. You can change shape of dummy node in it's properties (right-click, properties...).
Parts on rotational joints can have rotational limits. You can specify them in dummy "user defined options" (right-click, properties...). Rotation limits values names are RotX, RotY and RotZ, while their values should be specified as a range: low..high (angles in degrees). For example, right-side doors should have user-defined value like this: RotY 0..70, while left-side doors should have RotY -70..0.

Collision elements should be attached under associated parent dummy node. Refer GTA4 Collision model thread for details.

Separated objects
Beside a statement that filter will assemble single model out of a LOD parts (it will weld all L0 parts into single "high-detailed mesh" and all L1 parts into "low-detailed mesh"), there are a so-called separated objects. These objects are usually don't need to be welded to the rest of the mesh for some reason. For example, wheel model should be separated from the rest, since GTA will create a copies of these meshes for other wheels. Thus, you create an object of the weel, attach it under the front-left wheel dummy and the same wheel appears on the rest of wheel dummies ingame.
Separated objects are indicated in ZModeler in square brackets. Thus, object [wheelmesh_lf] is a separated model of front-left wheel. The object [wheelmesh_lr_l1] is a low-detail version of rear-left wheel. Note, if you don't place a wheel mesh model on the right side of your car, a left-side copy will be placed there; if you don't place rear-wheel version of meshes, a front-wheel will be used for the rear wheels too.
User avatar
Site Admin
Posts: 8275
Joined: Fri Feb 06, 2004 3:54 am

Return to Grand Theft Auto

Who is online

Users browsing this forum: No registered users and 2 guests