[SOLVED]Having some issues in creating a concave collision mesh

Started by Primarina, February 12, 2016, 06:52:58 PM

Previous topic - Next topic

Primarina

I have been trying to look for tutorials about this subject, but I can't seem find a good tutorial on this topic. I have asked Facepunch about this topic, but they didn't really help me that much. So I have tried to using wallworm model tools to make a collision mesh, but all it was to pretty much clump the collision mesh and I am confused on what to do next.


CarbonCopyCat

http://dev.wallworm.com/document/69/collision_hulls_in_3ds_max_for_source.html pretty much covers all you need to know for collision hulls and such.

However, it seems like your collision mesh is concave enough as it is, and the hulls are just clumped together. Try a Reset XForm modifier (Utilities (hammer icon) -> Reset XForm) on your model and then try generating a hull again; it should work fine after that. Make sure $concave is checked though.

Also, you have somewhere around 20 collision hulls for your model, which is ridiculously excessive. Since WWMT generates a hull per element, I'd see if the model had any un-welded verts, or if that's not the problem, just create a collision mesh manually (could be easily done with a tapered cylinder and a simple editable poly).

Primarina

#2
Quote from: CarbonCopyCat on February 12, 2016, 07:16:28 PM
http://dev.wallworm.com/document/69/collision_hulls_in_3ds_max_for_source.html pretty much covers all you need to know for collision hulls and such.

However, it seems like your collision mesh is concave enough as it is, and the hulls are just clumped together. Try a Reset XForm modifier (Utilities (hammer icon) -> Reset XForm) on your model and then try generating a hull again; it should work fine after that. Make sure $concave is checked though.

Also, you have somewhere around 20 collision hulls for your model, which is ridiculously excessive. Since WWMT generates a hull per element, I'd see if the model had any un-welded verts, or if that's not the problem, just create a collision mesh manually (could be easily done with a tapered cylinder and a simple editable poly).

I tried to use the Reset XForm modifer, it didn't work at all.

The problem is that I don't how to weld verts together and this might be have been unwelded.



Also, another thing to note is that detaching the parts of the model doesn't seem to work properly.

CarbonCopyCat



Basically, to weld vertices, select the vertices you want to weld (in your case it's all of them, so ctrl+a and select all of them), click the icon next to the Weld button to access the weld settings, and then set the threshold to something low (0.01 because it's the lowest; 0 doesn't weld anything) to make sure you don't accidentally weld together any details. (If the vertex count doesn't decrease, by the way, that means the vertices are already welded.) Doing so will mess up your Smoothing Groups though, so I'd recommend duplicating the model (right-click the model -> clone), welding it, creating a collision hull from that model, and then using "Pick Collision Model" in WWMT to add the hull to your original model.

Quote from: Lopunny on February 12, 2016, 08:20:15 PM


Also, another thing to note is that detaching the parts of the model doesn't seem to work properly.

It's hard to tell what the problem is just by the image. Are you meaning that element selection doesn't select the parts of the model you want (which is an issue with unwelded vertices), because I haven't seen a time where breaking elements into multiple pieces doesn't work.

wallworm

Thanks for jumping in and helping Shane. It's greatly appreciated.

Ironically, I thought that WW had made the collision hull process super trivial. Looks like I need to document more. I'll try to make it clearer if possible.

Joris Ceoen

Quote from: Lopunny on February 12, 2016, 06:52:58 PM
I have been trying to look for tutorials about this subject, but I can't seem find a good tutorial on this topic. I have asked Facepunch about this topic, but they didn't really help me that much. So I have tried to using wallworm model tools to make a collision mesh, but all it was to pretty much clump the collision mesh and I am confused on what to do next.
For a model this tiny, it is unnecessary to have such a complex collision mesh. Just one cylindrical stick would be enough, resulting in only one geometry for the collision and allowing the game to have much less overhead on calculating the impacts on the collision. From the image it looks like you have tons of little chunks that are completely irrelevant to the overall shape of you staff.

wallworm

Here are a couple more tips for you:

In Source, each hull element must be skinned to one and only one bone; also each bone can only have on convex hull. That may or may not affect this model directly, but it's important information.

WW will export a unique bone for each hull node (not element, node/object). Often if all the hull elements look correct but are all in one location, it can mean that you need to link the hulls to either individual bones in a hierarchy. If you don't have enough bones in the main hierarchy to link to, link all the hulls to each other and then link the root hull to the appropriate bone.

I cannot tell from the image whether any of this relates to your current problem, but understanding this will help you as you move along.

Primarina

Sorry for the late reply.

But I want to say, thanks for the help, guys.

I managed to get the collision mesh working now.


Joris Ceoen


SMF spam blocked by CleanTalk