Jump to content

Collisions - help needed


narg_eu

Recommended Posts

I'm trying to create a new "kit" (a room, for example), but there is a problem - can't get a collision mesh to work properly (PC goes through a floor)

I were using a tutorial from niftools page + gMax 1.2 + niftools 3.1.2

 

P.S. Sorry for my bad English :)

Link to comment
Share on other sites

collision is done using polygonal meshes with 'bhkRigidBody' modifiers put on them in your 3d program. When you apply those modifiers you can pick what kind of collision it is. Static objects and weapons have a different kind of collision, usually they use a simple Convex shape, additionally the bhkRigidBody modifier should be set to 'convex' to achieve this.

 

When you are in Niftools importing your stuff overtop of a premade NIF, just copy and paste-over the block at the end of the Collision branch... i think called bhkRigidBodyConvexShape or something like that

Link to comment
Share on other sites

btw for characters there is a different setup for collision, ill be discovering that soon when I get the Spartan armor in game, if i find out before you ill let you know :)

 

I know in some games, they have a duplicate of the player characters mesh, invisible, inside the player character, and the copy is used for collision purposes only.

 

Other games will use a hierarchical tree of collision primitive shapes (cubes/boxes/cylinders) aligned to match the locations and orientations of the Bones in the character rig.

Link to comment
Share on other sites

I have managed to completely figure out collision. In your 3d program you need to apply a bhkRigidbody modifier and set it to a packed strips shape. Once it is exported you will have to add a sub shape. In nifskope go to the collision object and expand it all the way and select the last block and set the subshapes to one and update the array. Copy the num verticies frome the main shape to the subshape, then set it to static and select the material you want. Also you should set the bhkRigidbody properties so they are the same as in an ordinary mesh (max linear velocity, max angular velocity, friction, etc.)

 

I have included a picture to help.

 

P.S. Skree, armor has no collision at all it just takes advantage of the collision on the character. So for armor no collision work is necessary, makes things much simpler.

Link to comment
Share on other sites

...

 

 

Hmm. Nothing of written above helps me :-/ :-(

OK. Let's do it another way. Here is step by step actions, made by me. Where I was wrong?

 

Step 1:

Create a box (Box1), transform it to "editable mesh" and flip normals.

http://img261.imageshack.us/img261/2963/step1abu1.th.jpg

http://img66.imageshack.us/img66/28/step1bga9.th.jpg

http://img340.imageshack.us/img340/4572/step1cty8.th.jpg

 

Step 2:

Create a new object (Box2) as the result of cloning (copy) Box2.

http://img525.imageshack.us/img525/9051/step2px6.th.jpg

 

Step 3:

Create an object bhkRigidBody (Tab "Create -> Helpers -> NifTools -> bhkRigidBody")

http://img210.imageshack.us/img210/3470/step3yv7.th.jpg

 

Step 4:

Apply modifer bhkRigidBodyModifier to the previously cloned object Box2.

Set value "bounding Volume" to packed strips shape

http://img444.imageshack.us/img444/8657/step4dm6.th.jpg

 

Step 5:

Select Object bhkRigidBody and add a collision mesh (Box2)

http://img440.imageshack.us/img440/5499/step5bh2.th.jpg

 

Step 6:

Export scene to nif format:

http://img396.imageshack.us/img396/4008/step6ra7.th.jpg

 

At this point a new "kit" were created by me in GECK.

Ingame collision mesh not working.

 

Step 7:

Create a sub shape in NifScope

http://img214.imageshack.us/img214/3/step9yg0.th.jpg

Ingame collision mesh still not working.

 

So, where is the problem?

Link to comment
Share on other sites

you're having the same problems as me buddy

 

exporting weapon coillision works for me...

 

exporting static / motion system 7 fixed - collision doesnt... even with the tweaks to te .nif file detailed in the tutorial on thenexus and the above one from SpeedyB.

 

 

basically, for us it looks like a case of wait untill the Dev's over at Niftools fix their exporter to actually work with f3

Link to comment
Share on other sites

Ummm if the box represents a block onwhich you will stand, try using Convex shape instead of packed strips shape.

 

Convex shapes naturally work better in most cases when dealing with collision in any game engine in general.

 

 

Try Convex shapes instead of packed strips and see what happens

 

Also know that some game engines do not detect collision surfaces that are very thin, some have a minimum requirement of thickness for those, for example, collision planes may not work, where instead a collision block that extends under the floor may be the only option that works.

 

(thin meshes sometimes dont detect collision due to there being very little depth)

 

I know thats how it works in UT3 anyways, you usually have to make a thicker solid collision block instead of a thin planar surface.

Link to comment
Share on other sites

ive been thru you're tut so many times now it's untrue Jaysus. cant make it work at all for me.

 

SpeedyB64's way seems a little simpler but im wondering if you could step-by-step it please as that screenie doesnt include how to get there, only the finished result, as it stands, that layout doesnt look anything like my current nif structure and its not like i dont know what im doing lol. been modding OB since release so had plenty of experiance with NIFS> this jsut baffles the poo outta me =\

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...