If you want to wander around the original Vice city (the appearance is almost unchanged) and go through the original missions (the script is adjusted only in the most painful places), but at the same time get around a number of bugs, uglinesses, restrictions, expanding the already large field of freedom of Tommy Vercetti, welcome to our new lab!

Report RSS Creation of collision mesh from object's model (DFF)

This article describes our method of creation of collision meshes from models (DFF). It might be a weird solution. But it 100% works.

Posted by on

If you have ever played GTA Vice City, you should know that some collisions on the map are incorrect. A collision mesh is an invisible copy of original model used to determine object's behavior when a player and/or other objects interact with it (touch it, step on it, shoot it, etc.). It can be simpler than the model, because mesh should only repeat the shape of the object. But sometimes simplification goes too far.

Perhaps it is not so important to do something about it. But in some cases it looks awful. Following picture shows inaccessible doors in a building near the North mall point.

Inaccessible doors


How to fix it? You can create or edit collision mesh manually. But there is another way. Collision can be extracted directly from the model (DFF file) of the object. Here's how you can quickly create a mesh with maximum precision.


Disclaimer

We're sure that there are simpler ways to do this. But this one allows you to:

  • Set surface materials for the new mesh (and sounds of touch);
  • Make a mesh as close as possible to the original model;
  • Learn something about the most useful modding tools for GTA Vice City (if you haven't before).

Also we know about ability of "Collision file editor" to extract collisions from DFF files. BUT. This tool can only extract attached collision. But it cannot make collision from model's vertexes (what we offer to do):

Unability of CollEditor to extract COL from DFF



What will we need?

You will need following tools (in order of use):

All these links are actual at September 9, 2021.


Algorithm

1.1. Launch "Moo mapper". Select GTA Vice City with these settings:

Moo mapper launch


1.2. In the list of placement files (IPL) check the map part that needed object refers to (it is nbeach.ipl in our case):

Moo mapper - map selection


1.3. Use the mouse to find needed object on the map. Select it by left double-click. Application will show three axes in the center of it and the settings window:

Moo mapper - object selection


1.4. Remember the model's name (it is nbdecoshop02 in our case) and the map part (nbeach). Close "Moo mapper".

2.1. Open file "models\gta3.img" using "IMGTool". Find DFF file with needed model's name (nbdecoshop02.dff) and COL file with map part's name (nbeach.col):

IMGTool


2.2. Right-click on each of them and extract them into one folder. Close "IMGTool".

Next three lines not needed since "MakeCST" tool's version 1.4. But it supports not all versions of DFF. So tool can still be used to convert Qhull OFF object to CST script according to following algorithm.

3.1. Launch 3D object converter. Open extracted DFF file:

3.2. Save loaded model as "Qhull OFF (*.txt)". This operation will create TXT file with the name of needed model.

3.3. Close converter. Remember that this tool supports batch conversion that can be used for set of models.

4.1. Open extracted COL file using collision editor. Find model's name:

ColEditor - old mesh


4.2. Export (by right-click) existing collision script (CST file) and remove it from model's list of COL file.

4.3. Rename exported CST file to BAK file.

5.1. Run “Vice city toolset”. Select model conversion mode, specify saved DFF file as an input file. This operation will create CST file. If you have Qhull OFF TXT file, specify it as an input.

5.2. Add (using F9 key) new CST file to collision editor:

ColEditor - new mesh


5.3. Right-click on the model’s name in the list and select menu “Target version → Col I”. Close collision editor, save COL file.

6*. If you want to make your collision mesh more correct, reopen COL file, find new model and set correct materials for surfaces like windows or doors:

ColEditor - fixed mesh


7.1. Open "models\gta3.img", find old COL file. Delete it by right-click. Add (menu "Commands → Add") edited COL file.

7.2. Rebuild the archive (menu "Commands → Rebuild archive"). Close "IMGTool".


Well done! Now you have correct collision mesh for needed model!

Accessible doors


Post comment Comments
Guest
Guest - - 691,615 comments

Can't really get past the command prompt stuff. I never use that, like ever I don't quite understand it. Why can't there be a program you put the dff file in, and press make col file and it makes a col file then you get to choose how complex or simplified it is then save it.

Reply Good karma Bad karma0 votes
RD_AAOW_FDL Author
RD_AAOW_FDL - - 287 comments

Hi!

Because these options require too much time to be properly implemented, tested and released. We just haven't enough hands to do this. Also this functionality isn't popular enough to be done so fast

Reply Good karma+1 vote
jquaidark
jquaidark - - 201 comments

I'm sorry but I can't get the program to convert my dff file.
Only a command line comes out that says: this version is unsupported or file is empty.

Reply Good karma Bad karma+1 vote
RD_AAOW_FDL Author
RD_AAOW_FDL - - 287 comments

Hi!

Sorry for the late answer. Unfortunately, ModDB doesn't indicate new comments under articles and files. So, it is too easy to miss them.

About the problem: some DFF (like cars) have more difficult structure than regular buildings. We haven't realized how to parse them yet. But, if it is still actual, please, let us know. We'll try to fix this

Reply Good karma+1 vote
Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: