Costly collision model: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
No edit summary
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
A '''costly collision model''' is one with over 20 convex parts. You will receive this error when going over it:
 
 
A '''costly collision model''' is one with over 20 convex parts (40 in {{src13}}). You will receive this error when going over it:


  WARNING: COSTLY COLLISION MODEL!!!! (30 parts - 20 allowed)
  WARNING: COSTLY COLLISION MODEL!!!! (30 parts - 20 allowed)
Line 8: Line 10:
The appearance of "error with convex elements" is itself an error, so ignore it. Your meshes are (probably) fine.
The appearance of "error with convex elements" is itself an error, so ignore it. Your meshes are (probably) fine.


==Solution for ep2==
==Solution for Orange Box ==


Either try to decrease the number of convex meshes, or if you really do need that many of them (usually only excusable on very large models), to use the <code>[[$maxconvexpieces]]</code> command to override the limit to one of your own preference. For instance:
Either try to decrease the number of convex meshes, or if you really do need that many of them (usually only excusable on very large models), to use the <code>[[$maxconvexpieces]]</code> command to override the limit to one of your own preference. For instance:


  $collisionmodel "myfirstmodel-phys.smd" { $concave '''$maxconvexpieces 30''' }
  $collisionmodel "myfirstmodel-phys.smd" { $concave '''$maxconvexpieces 30''' }


==Solution for ep1==
==Solution for Ep1 ==


Episode One engine users must run [[studiomdl]] with the <code>-fullcollide</code> parameter when compiling instead.
Episode One engine users must run [[studiomdl]] with the <code>-fullcollide</code> parameter when compiling instead.


Open a text editor and copy and paste the following code in
Open a text editor and copy and paste the following:
 
:<code><i>@echo on
:cd "%sourcesdk%\bin\ep1\bin\"
:studiomdl.exe -fullcollide %1
:@pause</i></code>
 


Save the text file, for example, as fullcollide.bat (make sure it's really a .bat file and not a .txt file)
@echo on
cd "%sourcesdk%\bin\ep1\bin\"
studiomdl.exe -fullcollide %1
@pause


After that, place fullcollide.bat into the same folder as your .qc file and drag and drop the .qc file onto the batch file, truncating will be disabled now.
Save the text file as a <code>.bat</code> (wrap quote marks around the filename if you are using Notepad to make sure it's not saved as a .txt instead). Then drag and drop your QC files onto the file to use it.


[[Category:Modeling]]
[[Category:Modeling]]
[[Category:Errors]]
[[Category:Errors]]

Latest revision as of 11:35, 3 April 2025


A costly collision model is one with over 20 convex parts (40 in Source 2013). You will receive this error when going over it:

WARNING: COSTLY COLLISION MODEL!!!! (30 parts - 20 allowed)
WARNING: Error with convex elements of myfirstmodel-phys.smd, building single convex!!!!
Model has 31 convex sub-parts
Collision model completed.

The appearance of "error with convex elements" is itself an error, so ignore it. Your meshes are (probably) fine.

Solution for Orange Box

Either try to decrease the number of convex meshes, or if you really do need that many of them (usually only excusable on very large models), to use the $maxconvexpieces command to override the limit to one of your own preference. For instance:

$collisionmodel "myfirstmodel-phys.smd" { $concave $maxconvexpieces 30 }

Solution for Ep1

Episode One engine users must run studiomdl with the -fullcollide parameter when compiling instead.

Open a text editor and copy and paste the following:

@echo on
cd "%sourcesdk%\bin\ep1\bin\"
studiomdl.exe -fullcollide %1
@pause

Save the text file as a .bat (wrap quote marks around the filename if you are using Notepad to make sure it's not saved as a .txt instead). Then drag and drop your QC files onto the file to use it.