Silgrad Tower from the Ashes

Full Version: Multiple collision materials
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hi,

During my time on the NPCs With Jobs team, I built several models, but never created the collision for them. recently I picked up my old work with the aim of releasing it as a modders resources, since NWJ is dead nowadays.

Since I use 3dsmax 8 to construct my models, I found Razorwing's tutorials of good use and they have helped me a lot to learn the first collision making. However, there's one thing I could not find out so far.

When creating buildings, there are of course stone parts, wooden parts, windows, metal parts, sometimes, perhaps even dirt on the ground. To make them sound realistic in the game, they would all require different collision meshes, one for each material that is used. In a tutorial here http://www.youtube.com/watch?v=KPdwGgkxfFs Razorwing showed how to create multiple collision. Still, I am hesistant, since any building or other model I have checked (default Bethesda buildings and custom-made ones), have only one collision branch in Nifscope.

Therefore my question: is it possible to have multiple collision meshes for a model, which are recognised in game and produce different sounds and all when something hits them or something?

I've searched in several places and went through several tutorials, but I couldn't find the answer, so that's why I came to the place of the master himself so that maybe he or maybe one of his fellow Silgrad modders would have an answer. Smile
Me and Razorwing discussed this before, via PM, and I told him of a technique I remembered reading about in one of the threads at NIftools forum. So he tried it out and it worked, so he wrote up this tutorial:

Tutorial - How to get multiple MOPP shapes

Koniption
Thanks for the help. As a newbie to collision I decided not to try MOPP, but stick to the easy box and strips collision (which worked great in game on my testing model), so I didn't look there. I see that I should better have looked further.

I don't understand MOPP very well and right now my aim is mostly to get it working.
Quote:Originally posted by Phaerus
Thanks for the help. As a newbie to collision I decided not to try MOPP, but stick to the easy box and strips collision (which worked great in game on my testing model), so I didn't look there. I see that I should better have looked further.

I don't understand MOPP very well and right now my aim is mostly to get it working.

The un-Mopp'ed bhkPackedNiTriStrips collision type is BAD, BAD, BAD for ingame performance. You might not notice the difference ingame with a single model that uses it, nor if you have a super duper PC, but other people will eventually feel the effects.

So MOPP collision is definitely recommended to use in place of bhkPackedNiTriStrips: 1) it allows the collision to hug the mesh all over in any specific shape you need it to be just like bhkPackedNiTriStrips, and 2) it allows much better performance in the game.

So if you can, try to learn to do it eventually. Because if you don't, and you make substantial amounts of meshes for a mod project, you might end up unintentionally hurting the project you work for.


what you can do, is make your differnet collision meshes for the different parts of your model that are different materials (wood, metal, organic, etc). Keep those collision meshes separate from each other - don't collapse nor connect them. Export each collision separately from your modeling program.

Then just combine them together in Nifskope where your mesh is in this tree hierarchy order: a single bhkCollisionObject comes first, single bhkRigidBody next, a bhkListShape after that (attached to the bhkrigidbody), add the number of slots to the bhkListShape to be the # of different collision meshes you have and then expand the green arrow underneath that field, add some bhkTransformShapes to fill in each of those fields that appeared next to the green arrow on ListShape, then directly connect your bhkMoppBvTreeShapes (and everything below it in each collision you exported) to a bhkTransformShape - one bhkMoppBvTreeShape to one bhkTransformShape.

The bhkTransformShape allows you to move the collision attached to it, if you need to tweak where it sits on the mesh. It has Translation, Rotation, and Scale fields you can alter.

It involves knowledge of NIfskope, but this is another way to set up multiple material Mopp collision, if you don't have the means to try to export it this way directly from your modeling application.

If you need further help, PM me, and I can send you a sample nif of the multiple Mopp setup, or answer other questions.

Koniption
I'm rather late to thank you for your help, sorry for that, I never saw your last post. It's been very helpful.

However, today I ran into some more trouble. Last december I succesfully created MOPP collision for a little village church, but I never finished its interior or any of the other meshes I wanted to add collision to when other duties required my limited time. A week ago I got a request from the leader of a project run from this website (Deeza) for several of my models, most of which are still without collision. This eventually got me started adding the missing collision to allow him using the models. The first of the models I decided to add collision to is a portable candle, since it is rather simple. It is a default candle fitted on top of a newly made pewter candle holder.

I've done everything exactly as Razorwing described. The default skinny candle 01 was edited in 3dsmax to fit the candle holder. After having created the normal meshes, I created the collision meshes. One collision mesh with material metal for the candle holder and one new collision mesh wood for the candle (wood is also the material of the original collision mesh). The default collision was lost in the process of importing the candle into 3dsmax and I did not succeed to add the original collision iin Nifscope after exporting the new meshes. Each collision mesh got its bhk helper. One pair of helper and collision mesh (wood) was grouped, the other was left as it is, just like Razorwing advises. Then in Nifscope I followed the tutorial exactly except that I used only 2 sub shapes instead of 4, since I used only 2 collision materials instead of the 4 Razorwing uses.

Then I saved and added the mesh to the CS, first as a static object for testing purposes. Most of the time that goes well, but when I want to place it in an interior the CS crashes.

I've done some testing to find out the problem. When I use the finished version I just described , the CS crashes. It does so too when I use a mesh with multiple MOPP collision but still with the NiNode that contains the 'grouped collision' (wood in my case), aka without deleting that NiNode (final step of the tutorial). However, when I use single MOPP collision by deleting the NiNode with the second collision mesh from the exported nif file and skipping the process of turning on multiple collision as described in the process and add that to the CS, it does not crash.

So it seems that the CS does not like the multiple MOPP collision, however, I didn't have that problem before when I was dong the same with many more materials back in December. So I'm wondering what's wrong. I'm using CS version 1.2.404.

Is there any way you or anyone else can help me?
Hi Phaerus,

I will need to look at your static candle nif that crashes the CS. If you can send me a download linky to the file(s) via PM or here, that'd be great.

You said the candle was "portable"..does this mean it is supposed to be havoked and grabbable with grab key? If so, you don't want to use MOPP collision on it at all, nor the un-Mopp'ed bhkPackedNiTriStrips collision type.

You only want to use simple shapes and convex collision type. Simple shapes are the bhkSphereShape, bhkCapsuleShape, bhkBoxShape, in Nifskope.

Here is a tutorial on Oblivion collision and when to use certain types of collision:

http://sites.google.com/site/saidenstorm...siontutori

Also, here is a related posted reply I made to another person, that has some more info in it:

I like my clutter middle-class
Hi Koniption,

Ideally, I want to create a candle with which the player can walk around. I created a lit and an unlit version, so far only with candle type skinny 01, the tallest available. The idea is that these portable candles on a pewter candle holder can be placed around in interiors by modders (possibly instead of some candles placed on tables etc.). A player can grab the portable candle and like a torch equip it in the inventory. Candles that were unlit when they were grabbed shouldl be lit automatically when they are equipped after they are stored in the inventory. Both in the state in which a burning portable candle is standing in its place in an interior and when the player has grabbed and equipped it, it is supposed to cast light on the surrounding environment.

In short, it will be rather similar to a torch.

So far I haven't experimented with this portable nature that the candle is eventually supposed to get. So far I've only used the model of the unlit candle in a pewter holder as a static object.

I just did a final test. Yesterday I altered the normal solid mesh of the pewter candle holder. In the CS I saw that the visibility of some parts did not justify the relatively high poly counts of those parts and I replaced them by lower-poly parts. I exported this model to Nifscope, removed the collision and replaced it with the multiple MOPP collision I had created for my previous model. This time the CS did not crash, although I'm left wondering what could have been wrong.

Anyway, I uploaded the latest (succesful, *1hNb.nif) file and the problematic files. the difference between the latter two is that one (*1fNaa.nif) still contains the ninode that is no longer of any use and the other (*1fNab.nif) has it removed, just like I described in my previous post.

http://www.tesnexus.com/downloads/file.php?id=34126
Hello Phaerus,

I've downloaded the candle files. Will look at them in CS and such when I have more time.

Koniption
Thank you. I'll just continue completing architecture, which might be easier.

The tutorial by Saiden Storm was really useful. I didn't know each kind of object required its own collision type, but that is clear now. What I didn't get is that importance of centering. So far I have just followed up Razorwing's recommendations of putting the bhk helpers at 0,0,0, but that seems different from what Saiden Storm advises. His advice is to change the pivot point of the object to the center of the normal mesh and the collision mesh and then to align the bhk helper to the center of the collision mesh.
Same problem now with the new multiple mopp collision for the village church.

I created new collision meshes for it, to drastically reduce the number of polygons, which was way too high, but it seems the new collision contains the same bug that's also causing problems with the candle holder.
Pages: 1 2