GTA4: Collision

GTA San Andreas and GTA Vice City discussion.

Moderator: Oleg

User avatar
Oleg
Site Admin
Posts: 14022
Joined: Fri Feb 06, 2004 3:54 am
Contact:

GTA4: Collision

Post by Oleg »

GTA 4 collision model guide thread

Collision in GTA is stored in WFT files and spread all round the hierarchy. Collision elements are attached under associtated parent dummy nodes and have a[COL] tail in object name. The leading part must match parent dummy name. Thus, for example, door_dside_f[COL] (ollision element for driver-side front door) must be a child of door_dside_f dummy node. An error message will be prompted on export if names mismatch occures.

You can place several collision elements under associated dummy node, but it's a quite rare case in GTA.

Collision volume is made of solid mesh geometry. It's vertices should be united (do no use duplicate vertices), normals should be calculated and the rest is non-significant. No UV mapping or material assignment required.

You can specify type of each polygon in collision volume. Type is specified in polygon's properites in External State\ID field. This is optional, since filter can assign default collision polygon types on export. The following values are known yet:
2 - shot-through polygon
79 - metal panel, bulletshells appear when shot
80 - plastic panel, bulletshells appear when shot
135..138 - glass with different durability. 135, 136 will be smashed with a single shot; 137 is mostly used for rear windscreen - it can show cracks when shot but takes just few bullet shots before smashed completely; 138 is for front windscreen - it can handle several shotgun shots before smashing.

There are other values of game reaction, I haven't tested much.

You can use dummy primitives: box and sphere for collision volumes, but ingame solid meshes are mostly used.

Wheels collision should be made of cylinder dummy. Refer example pack for details.

Local axes of collision volume (except dummy primitives and wheels) is used for "center of mass" when associated part is detached from mesh. Unfortunally, it doesn't seem to affect behaviour of attached part ingame - thus, bonnet, boot and doors might behave a bit strange when door/boot/bonnet gets opened ingame.

Properites\User Defined on each collision element can include value MASS that could specify mass in kilos of associated part. Filter will try to compute mass automatically if it's not specified.


You can post your questions or suggestions concerning collision in this thread.