collapse

* Notice

Important notice (31 July): We have recently recovered from a nearly two day downtime due to an attack. No data was lost or stolen but the server has been reinstalled as a precaution. Please let us know if you encounter any issues. We apologise for the unacceptable inconvenience. Please read here for more information.

Author [EN] [PL] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] Topic: Working with or repairing VPhysics collision models.  (Read 480 times)

Offline Norrwin

  • Neonate
  • **
  • Posts: 89
  • Reputation: +1/-0
Working with or repairing VPhysics collision models.
« on: April 14, 2020, 01:12:22 pm »

I ran into a situation where the VPhysics collision model/mesh was messed up (image attached) and I didn't find any posts here about working with these models. It turned out to be a bit of a chore to fix (for me) so I thought I would share what I found.


Decompiled the model and then tried to recompile it using Crowbar to see what happened. The result is shown in the attached image and the Crowbar output was:


      SMD-MODEL: standard_sewer_divider_physics.smd
      Unknown command $maxconvexpieces in collision series
      Unknown command 18 in collision series
      WARNING: Bad collision model, check your smoothing groups!!!
      * Truncating model!!!!
      standard_sewer_divider_physics.smd has bad smoothing groups
      Model has 1 convex sub-parts
      Collision model completed.
      ---------------------
     
So I opened kHED and imported the standard_sewer_divider_physics.smd and start messing with trying to "fix" the model but no matter what I tried I always ended up with the "check your smoothing groups!!!" message. So I started over and just made two simple rectangles to cover each side but the compiler always joined them with the same warning message about smoothing groups.


The trick was to select each rectangle one at a time in kHED then use "Edit/Create Convex Hull" on them. The explanation and instructions for other modelling programs can be found here.  Basically need to create as many convex elements as needed to cover your visible model, in my case two. So I commented out the "$maxconvexpieces 18" line in the SMD file and got this result:


      SMD-MODEL: standard_sewer_divider_physics.smd
      Model has 2 convex sub-parts
      Collision model completed.
      ---------------------
     
Finally success, so I copied the new Standard_Sewer_Divider.phy file into my VTMB file structure (and ignored the rest). The result is also in the attached image. The only other thing I can think of is that if your collision model will have more than one convex element it is vital to have the $concave line in the $CollisionModel of the QC file. The page about the $CollisionModel is here.




Offline Wesp5

  • Administratrix
  • Antediluvian
  • *****
  • Posts: 6699
  • Reputation: +887/-28
  • Unofficial Patcher
Re: Working with or repairing VPhysics collision models.
« Reply #1 on: April 14, 2020, 05:00:03 pm »
Does this mean you created a sewer detail model under which you can walk but that still has the small pillars at the side solid? I would really like to have that for the Unofficial Patch...
« Last Edit: April 14, 2020, 06:01:33 pm by Wesp5 »

Offline Norrwin

  • Neonate
  • **
  • Posts: 89
  • Reputation: +1/-0
Re: Working with or repairing VPhysics collision models.
« Reply #2 on: April 14, 2020, 05:38:57 pm »
Yes that is exactly what it means, as long as the model flag in the BSP is set to use VPhysics.

Offline Wesp5

  • Administratrix
  • Antediluvian
  • *****
  • Posts: 6699
  • Reputation: +887/-28
  • Unofficial Patcher
Re: Working with or repairing VPhysics collision models.
« Reply #3 on: April 14, 2020, 06:00:32 pm »
Yes that is exactly what it means, as long as the model flag in the BSP is set to use VPhysics.
I just noticed that this is not the critical model in the sewers. So can you do the same with Standard_Sewer_Arch.mdl?

Offline Norrwin

  • Neonate
  • **
  • Posts: 89
  • Reputation: +1/-0
Re: Working with or repairing VPhysics collision models.
« Reply #4 on: April 14, 2020, 10:04:53 pm »
Yes it is possible, the real difficulty is knowing what you are wanting. I made a collision model but in my mind there are lots of issues with the implementation and decisions about compromises that need to be made so I can't do that part.


The issues for me are 1. If the model covers most of the pillars in a simple way then it sticks out (as the pillars would) and is just something to get stuck on fighting Warrens monsters. 2. Even with it in this position it is still possible to noclip your head into it in places - if you try hard enough. 3. If the model is extended enough to cover the entire pillar it REALLY sticks out. 4. Creating a more complex model might not be such a good idea where there are so many of them. 5. There are more than just this model, there is SewerArchStandard.mdl as well and I know not how many more, and these two are different. 6. Every model that currently has no physics would need to be set on every map, I don't know if there is an easy way to do that or not.


Regardless I choose what I felt was the best compromise and here is the model and source for Standard_Sewer_Arch.mdl and what it looks like ingame.



Offline Wesp5

  • Administratrix
  • Antediluvian
  • *****
  • Posts: 6699
  • Reputation: +887/-28
  • Unofficial Patcher
Re: Working with or repairing VPhysics collision models.
« Reply #5 on: April 14, 2020, 11:21:31 pm »
Thanks, a lot! It's good enough for me and much better than the original. SewerArchStandard.mdl is already a solid version. Now I only need to set the solidity for all those models...
« Last Edit: April 14, 2020, 11:37:38 pm by Wesp5 »

Offline Norrwin

  • Neonate
  • **
  • Posts: 89
  • Reputation: +1/-0
Re: Working with or repairing VPhysics collision models.
« Reply #6 on: May 12, 2020, 11:22:26 pm »
Another one, the entrance beams to the temple in Chinatown.



Offline Wesp5

  • Administratrix
  • Antediluvian
  • *****
  • Posts: 6699
  • Reputation: +887/-28
  • Unofficial Patcher
Re: Working with or repairing VPhysics collision models.
« Reply #7 on: May 13, 2020, 09:59:08 am »
Another one, the entrance beams to the temple in Chinatown.
Thanks for the fix, but I corrected those beams myself long ago by placing fenceposts inside ;)!

Offline Norrwin

  • Neonate
  • **
  • Posts: 89
  • Reputation: +1/-0
Re: Working with or repairing VPhysics collision models.
« Reply #8 on: May 14, 2020, 01:54:14 am »

I knew you must have done something but didn't know what exactly.


My intent for starting the thread was to help people who may want or need to work with these meshes. Having more working examples to take apart and look at is always better for me so I thought it might be for others as well.


In this case adding a mesh where none originally existed, and also a bit more complex than the others.


I guess with that I should add that I let Crowbar add the $CollisionModel to the QC but replaced the SMD with the one I make in kHED. Getting the rotation correct was a bit of experimentation. I think saying no to Crowbar fixing rotations and just doing it in kHED instead was the best choice in the end, YMMV.

Offline Wesp5

  • Administratrix
  • Antediluvian
  • *****
  • Posts: 6699
  • Reputation: +887/-28
  • Unofficial Patcher
Re: Working with or repairing VPhysics collision models.
« Reply #9 on: May 14, 2020, 08:21:57 am »
My intent for starting the thread was to help people who may want or need to work with these meshes. Having more working examples to take apart and look at is always better for me so I thought it might be for others as well.
Which is great! Also I added your fix into the next UP anyway, so others using the model elsewhere don't have to fix it manually.

 

SimplePortal 2.3.7 © 2008-2020, SimplePortal