Collision issues for arch-form object.

Started by theprotestingmoose, June 05, 2014, 10:48:00 AM

Previous topic - Next topic

theprotestingmoose

Hello. I'm trying to export some objects with an arch shape. For example:


I've followed yjr 101 collision video and I think I've managed to understand most of it. But I can't get this right.
I think the problem stems from the arch not being concave? Whatever I seem to do I got a collision which covers the "hole" in the arch so there is no depth.

I thought I could just take the arch, make it a more simple optimized mesh, use process CM,  assign it as a collision object and it should work. Newp. 

So what I've tried is to divide up all the pieces that the arch consists of into elements with the hull helper and it creates a more complex arch then the autogenerated. But the geometry is messy and it still doesn't have depth ingame. And furthermore, in the video you use "create hulls from selection" and you get a single mesh with multiple elements. I get multiple meshes instead and no elements. And I don't think I can assign all the meshes to the arch?

Sorry for the messy description.

In short: What is the best way to go about this?

Joris Ceoen

hello, Shawn is currently unavailable (gone for a few days) so I'm going to try to fix this with you.

So the problem is that when you export the model, the collision is like one big block? There are a few reasons why this would happen:


  • In the Wall Worm Model Helper options on export you didn't select the $concave option. Make sure it is selected otherwise it'll export as one big block. I assume you already did this so it may be any of the next ones.
  • Somewhere in your object (if it is composed of multiple elements) you have an element that has 2 vertices not welded together. Sometimes with complex geometry you can oversee unwelded vertices depending on how you worked with the object. Make sure all vertices are welded so that there are absolutely no gaps or anything.
  • You have an unsmoothed face. Make sure to select all objects/elements, apply a smooth modifier to it, select group 1 (so ALL faces are having the same smoothing group) and collapse it and then export. Having ANY unsmoothed face will give you a convex object.
  • If there are more than 40 elements in an object or more than 40 seperate objects (or any possible combination between those) it will generate a limit error and make it convex. To fix this you can add $maxconvexpieces X (where X is any number, most likely above 40 if you have more than this limit but you could insert any number actually, also below 40 to put a limit yourself)

However judging from the video, the entire thing is a model right? (So also the wall above it and the door-like texture part). If so, when using the autogenerate option it may create some or even many incorrect brushes or objects out of size etc... It really depends on how the model is made. It has been improved heavily, but it's still not perfect and most likely never will be. It can't give the best in each and every situation.

If you only need to make a collision on the arch itself, I suggest making one manually which can be quickly done. You could simplify the collision by having 2 collisionblocks at the left and the right that extend from the ground to where the arch begins, then make one block per 3 segments or something instead of carefully following each and every movement of the arch. This will create a 'complex' collision for almost no visible result.

If you can't figure it out, you can always send the file to me so I can make you an example collision.

theprotestingmoose

#2
Thanks for the reply.
I actually had a few unmerged vertices. I merged them but I'm doing something else wrong here.

From what you write it sounds like I should be able to make my own collision mesh, not only have an autogenerated one.
I tried it here:

Concave checked and all in one smoothing group. I export it without the offset ofc. So I make the mesh and then I select my main arch in worm tools and use pick hull on my custom mesh. I can toggle its visibility with hide CM/show CM so it seems like it's assigned. But then again, it exports like a solid mesh without the arch.

Here's the max file if it helps: LINK REMOVED

Thanks.




Joris Ceoen

#3
I checked your max file and found the problem. There are a few things to remember when dealing with collision models in Source and WWMT:


  • First and foremost: ALL of your objects/elements need to be convex. What this means is that you should define a collision with at least a block of 1 inch big. Essentially it means that flat faces are not recognized by the compiler at all, which means that you'll have an errornous collisionmodel. For instance, a cube is convex as it is a object/form/mesh, whereas a flat plane is just a plane that cannot give any sense of direction as of how to be blocked or how to stand on the object. So remember, all of your elements need to be convex.
  • And, when you're having multiple of such elements/objects you need to select the $concave option as here concave means that your collisionmodel consists of at least 2 objects or more.
I will create the collision model myself and send it to you so you'll understand immediatly what I mean :)

EDIT: link is here: LINK REMOVED

So as you can see, the elements I used in the collision object are all convex. It means that they are defining a certain 'area' or 'space' as of where the collision happens and where it ends. You can't do this with solely flat faces (normally this gives you an error saying something that your collision should at least be 0.500 inches big).

Once your collision is done, open the WWMT model tab, go to Collision Model & Physics -> Pick Hull -> Select your collision object -> select $concave -> Hit the ^ arrow on the Hull Count.
If the hull count updates correctly it means that the collision model is correct and ready to be exported. If it isn't correct it should give you a warning that it won't compile correctly and usually means any of the aforementioned problems.


theprotestingmoose

Your collision worked fine and it also helped me figure out how to create my own.

I really appreciate the help. Thanks a ton.

Joris Ceoen

Quote from: theprotestingmoose on June 07, 2014, 02:48:52 PM
Your collision worked fine and it also helped me figure out how to create my own.

I really appreciate the help. Thanks a ton.
Amazing! I'm glad to have helped. Good luck in future works, and if there is anything else or if new problems pop-up, never hesitate to come to the forums ;)

wallworm

#6
Looks like the site was in good hands during my vacation!

I have a couple tidbits to add:

1) The  hulls are no longer combined into one object with Hull Helper because this is not the best scenario when making animated models. That is why there is now a button labeled Merge Selected Hulls. If you want to have a single object, select the resulting pieces and hit this button. Then hit the Process Selected Hulls (for good measure).

2) In the global WW Settings, there is a section labeled Collision Hull Options. The drop down menu there should be set to Match $maxconvexpieces to Hull Count for newer versions of Source. This will help with models composed of multiple hulls.

3) You can never make a usable hull from a planar object/element. Hulls created from a planar piece of geometry will result in unusable hull pieces. (There is a function in the new Carver tool that will select Planar objects which can help). Hull Helper and Quick Hull do not ever verify that you've eliminated planar parts... they assume you have elements that can produce a hull volume.

4) To understand how the hull helper works, I'd do this: Create a Teapot in the scene. Create a WWMT Helper for it. Choose $staticprop. Then in the Hull rollout, click Quick Hull. Notice how there are 4 hulls. If you export the model, you should see the correct hulls in HLMV. It's as simple as that in most cases. If you then convert the teapot to an editable poly, you can easily see the parts that were made into hull pieces be going to Element sub-object mode and clicking parts.

5) For the arch scenario on this page, you may find that the complexity of the hull above is overkill. Unless there is a really special reason to have such accurate hull, it could be condensed to 3 pieces. Notice the image below:



The reason I'd use something like this is that it is much cheaper and because the players will simply not notice the difference. Because there are no players visible behind the window (in this scenario) there is no problem with them hitting invisible hulls. And it's unlikely they will notice that the hull is not identical to the model unless they are throwing grenades at specific angles and looking for the hull boundary--which doesn't really affect game play as I envision this prop being used. The sides are unnecessary altogether because the model looks like it will fit up against world geometry. And if the back is also butted up against world geometry, then the back hull (lavender block in image) is unnecessary.

Hopefully this helps add some more clarification and help.

kinggambit

Sorry I'm hijacking this thread but I have a similarly "concave" model. I don't mind inaccurate collision hulls for the upper half of the model but anything near the player's height needs to be accurate:


Before I invest a bunch of time into meticulously detaching elements manually, is there perchance an easier method? I was thinking maybe detaching everything (but I'd end up with a lot of planes).

wallworm

Quote from: kinggambit on July 08, 2014, 08:06:05 PM
Sorry I'm hijacking this thread but ...

I don't believe there is a such thing as hijacking a thread when it's on topic! :)

Quote from: kinggambit on July 08, 2014, 08:06:05 PM
Before I invest a bunch of time into meticulously detaching elements manually, is there perchance an easier method? I was thinking maybe detaching everything (but I'd end up with a lot of planes).
If I were approaching this model, I'd expect it to be a little bit of tedious detaching. Don't detach ALL faces, but select groups of faces that should be contained in a single hull and detach them. But do it using the Hull Helper rollout in WW.

See this video starting at 7:15 :

http://youtu.be/yJFGdehrUgE?t=7m15s

The UI has changed a little since making the video, and the video was a little slow... but it will generally show you the kinds of steps you can take to make hulls more quickly.

SMF spam blocked by CleanTalk