NifSkope and Bounding Boxes

Post » Fri May 27, 2011 12:24 pm

I've been trying to add collision to a mesh I'm working with (where the context of "working with" is NifSkope hacking and slashing, since I'm no modeler), but can't seem to get it to work in-game.


In NifSkope, I've selected the node I'm interested in, right clicked and selected Flags, and set it's collision type to "Bounding Box" (which is good enough for the object in question). Then, in the node properties, I've changed Bounding Box to "Yes" and entered the proper dimensions. I can see the red bounding box and it looks like I've gotten it exactly where I want it.


In game, when I create a reference from that mesh, I can't find any evidence of a bounding box being present. I've noticed before that sometimes having the mesh rotate for a frame, move, or disable/enable a few times tends to get collision updating when it (for whatever reason) initially doesn't, but none of that seems to help here. Are there any suggestions that the NifSkope wizards out there might have for me? Any tricks that I should know, or different procedure that I should follow?


Thanks :)
User avatar
Alister Scott
 
Posts: 3441
Joined: Sun Jul 29, 2007 2:56 am

Post » Fri May 27, 2011 5:32 am

What model you are working on? Static, activator or creature?

"Bounding Box" in MW is not identical to "typical" collision structure (RootCollisionNode). It possess some features of collision but plays also a role of so to say "pivot reference" for animations (without "Bounding Box" animations are corrupted).
"Bounding Box" (node name) is only present in MW in PC/NPC animation files and in creature nifs.
MW statics and activators do not have "Bounding Boxes": their collision structures are stored in RootCollisionNode branches.

Find a close original prototype nif for you model, study it in NifScope, and try to recreate it's node structure in your nif.

There is an "expensive" way to create RootCollisionNode branches for some static models in NifScope.
"Bounding Boxes" for PC/NPC animations is not necessary to create: you can copy/pastes them from original files.
Creating clever "Bounding Boxes" for complex creatures could be a challenge and requires work in 3D application.

:)
User avatar
Rozlyn Robinson
 
Posts: 3528
Joined: Wed Jun 21, 2006 1:25 am

Post » Fri May 27, 2011 12:18 pm

The model that I'm working with is for an activator, it is a skewed variant of the NEDE lightning mesh.

Thanks for the advice -- I'll see if I can replicate the node structure from another NIF.
User avatar
Joie Perez
 
Posts: 3410
Joined: Fri Sep 15, 2006 3:25 pm

Post » Fri May 27, 2011 9:17 am

I have no idea what NEDE lightning is, but you can try to use NiTriShape nodes (geometry) from it for creating RootCollisionNode branch: create RootCollisionNode node (e.g. copy/paste from a working nif, delete old NiTriShape nodes and copy paste NiTriShape nodes from your mesh, delete materials (NiMaterialProperty), NiTexturingProperty, etc and set flags to 2). This works if you need exactly to fill entire mesh volume with collision structure. This is the "expensive" approach I have mentioned (usually collision structures are very simple meshes).

:)
User avatar
Amber Hubbard
 
Posts: 3537
Joined: Tue Dec 05, 2006 6:59 pm

Post » Thu May 26, 2011 9:33 pm

Seemed to work well enough, since I can finally collide with the mesh now... yay =)


Thanks for all the help, much appreciated! http://www.youtube.com/watch?v=fawvv8eoHfs the mesh in action now.
User avatar
jesse villaneda
 
Posts: 3359
Joined: Wed Aug 08, 2007 1:37 pm

Post » Fri May 27, 2011 2:22 am

MW statics and activators do not have "Bounding Boxes": their collision structures are stored in RootCollisionNode branches.


It's strange, you're perfectly right, and yet the activator tutorial made by TumbleDumpling suggests them. :huh:
I'm not sure why myself though if normal collision works with animation and everything.

It says it's something to do with the root bone (which Morrowind looks to as the center of the mesh) only being recogniseable with the bounding box surrounding the mesh. :shrug:
I suppose this information must be wrong, perhaps we should make some new tutorials.

Creating clever "Bounding Boxes" for complex creatures could be a challenge and requires work in 3D application.


Can you explain please? :)
More complex collision for creatures is something I'd be interested in (large climbable creatures anyone? :drool: ), but how would you even go about making it more complex?
Do other collision types or multiple bounding boxes work with creatures then?
User avatar
Aliish Sheldonn
 
Posts: 3487
Joined: Fri Feb 16, 2007 3:19 am

Post » Thu May 26, 2011 10:05 pm

Well, we do not know many things about MW game engine (probably, modified NetImmerse 4.1) and MW nif/kf format (4.0.0.2). Therefore there is a lot of different interpretations and a great mess in terminology (e.g. debates about MW bump maps).
I have presented only my understanding. Who cares about terms when it (e.g. mentioned tutorial) works in the game. But in order to avoid confuses it is better to be consistent and use official terms from MW or NetImmerse.
What is a "Bounding Box" in NifScope I have no idea.

Alternate Bounding Volumes (ABV: sphere, box, capsule, half-sphere), collision propagation structures, are nicely described in available MaxImmerse doc (NetImmerse 3ds Max3-4(5) exporter help files for NetImmerse 4.1; check them).

However, I think that in MW these structures are reduced to a simple one box (in PC/NPC animations and creatures). How exactly they are processed by MW game engine is still a mystery. I have played a lot only with NPC animation "Bounding Boxes" and RootCollisionNode branches for statics/activators using NifScope.

Under "complex" I wanted to say that this structure should cover the desired volume of a particular model; to create such a "precise" geometry from the scratch might be not so easy just using NifScope. It can be a simple box. I was not talking about ABVs.

:)
User avatar
Catherine N
 
Posts: 3407
Joined: Sat Jan 27, 2007 9:58 pm

Post » Thu May 26, 2011 10:43 pm

I've only ever seen a "Bounding Box" compound in creatures; the main uses seemed to be for TESCS placement and as the origin of spellcasting projectiles. Usually they exist on a separate NiNode to the rest of the creature; "bounding box" collision detection I had assumed was determined at run-time by taking the extreme vertices of the mesh and generating a box from those. Generating a low-poly RootCollisionNode is probably the "best" way of adding collision if you think triangle collision detection will be too expensive. :shrug:
User avatar
Andres Lechuga
 
Posts: 3406
Joined: Sun Aug 12, 2007 8:47 pm

Post » Fri May 27, 2011 12:34 am

Usually they exist on a separate NiNode to the rest of the creature; "bounding box" collision detection I had assumed was determined at run-time by taking the extreme vertices of the mesh and generating a box from those.

Bounding box is traditionally created in 3dsmax by making a box object, naming it "Bounding Box", linked to the root bone, and hidden. Then Tesixporter does all the nif magic.

In nifskope it will appear as a node "bounding box" with detail setting 'Has Bounding Box' set to yes, with 'bounding box sub-settings' Translation, Rotation(usually 0,0,0), and radius settings for x,y,z. Setting Nifskope to view Havok will render bounding box.
User avatar
Solina971
 
Posts: 3421
Joined: Thu Mar 29, 2007 6:40 am

Post » Fri May 27, 2011 5:28 am

"Bounding Box" node is present in all PC/NPC MW animations files as a NiNode with checked "Bounding Box" option in Block Details and specified Radius (?!): X=16; Y=16: Z=66.5 for PCs and X=29.28; Y=28.48; Z=66.5 for NPCs. In NifScope it ("Bounding Box") looks like a 8-vertex box mesh.
In the TESCS we can also see green-blue-red boxes in the render window (nothing in preview window) around NPCs and creatures.
In the game it is possible to see after ToggleCollisionBoxes (TCB) console command execution 8 or 12 vertex green boxex (along with other collision structures in gray) linked to NPCs and creatures BUT not to the third person PC.

How all these box structures are interrelated and what is their exact function is not clear.

I have changed X and Y values (change of Z cases game CTD) for a "Bounding Box" in a custom animation attached to an NPC. Changing these values in the main animation nif causes nothing, but in the x.nif (skeleton structure) results in something interesting: 1. green-blue-red boxes in the TESCS remain unchanged; 2. In the game (TCB) the green 12 vertex box was reshaped according to my NifScope changes, and it was possible to come closer to that NPC.
Conclusion: "Bounding Box" stored in x.nif is used by the game and has some collision functions. It's shape is presented as an 8 or 12 vertex green box after TCB command. It is, probably, not directly related to green-blue-red boxes in the TESCS.

Please confirm that in your tests. My results could be installation (game version) dependent.

:)
User avatar
ShOrty
 
Posts: 3392
Joined: Sun Jul 02, 2006 8:15 pm

Post » Fri May 27, 2011 6:06 am

From what I've seen the bounding box is directly related to the gree-blue-red box around creatures and NPCs (probably) in the TESCS.
If no bounding box is present the CS generates a box around the object, otherwise the bounding box is used for it.
Moving the bounding box moves the box in the CS (using this on a custom-made creature here).

I've only really messed around with creature bounding boxes myself, but I can confirm most of what you've said. :)
User avatar
TIhIsmc L Griot
 
Posts: 3405
Joined: Fri Aug 03, 2007 6:59 pm

Post » Fri May 27, 2011 6:14 am

"In the game it is possible to see after ToggleCollisionBoxes (TCB) console command execution 8 or 12 vertex green boxex (along with other collision structures in gray) linked to NPCs and creatures BUT not to the third person PC."

Sorry, ladies and gentlemen: that was wrong - I am able to see green collision boxed for my test-PC today.

I have never tested creatures, I was "working" only with PC/NPCs.

:)
User avatar
Christie Mitchell
 
Posts: 3389
Joined: Mon Nov 27, 2006 10:44 pm

Post » Fri May 27, 2011 6:56 am

Well, they act pretty much the same, except that bounding boxes on creatures have less limitations from the sounds of it (z axis has no problems).
I missed what you said about the NPC bounding box not affecting the box in the CS. You are most likely right, like I said, i've only messed with creatures bounding boxes myself.

In creatures they are directly related, but NPCs not I suppose.
User avatar
Nichola Haynes
 
Posts: 3457
Joined: Tue Aug 01, 2006 4:54 pm

Post » Thu May 26, 2011 10:45 pm

I missed what you said about the NPC bounding box not affecting the box in the CS.


I was wrong. I have performed more tests: "Bounding Box" for NPCs in the attached x.nif file indeed is represented as a red-green-blue box in the TESCS (I have unclear display problems of these structures in the game and in the TESCS ? sometimes it shows one thing, next time another).

CTD with the change of Z Radius values is pretty reproducible.

Setting X, Y Radius values below 1.0 as well as "No" for "Has Bounding Box" results in a generation in the game of a "new" "Bounding Box" that is a bit bigger that original one in the x.nif file.

Setting of "Bounding Box" Z Translation above the surface (e.g. 266.5) or below (e.g. ?266.5) results in an absolutely "transparent" NPC (for PC and other NPCs). Interestingly, this NPC correctly recognizes terrain collision structures. But when the "Bounding Box" is set with negative Z translations this NPC often looks up and other NPCs and PC looks down when this NPC is near them. When "Bounding Box" is set significantly above ? he looks down and others up. It seems that "Bounding Box" is a sort of a representation of a character in the game world for other NPC (not for terrain, buildings, etc.).

In this "series of experiments" I was not able to reproduce my previous observation that inactivation of "Bounding Boxs" causes animation corruption. That's odd! :blink:

:)
User avatar
Steve Bates
 
Posts: 3447
Joined: Sun Aug 26, 2007 2:51 pm


Return to III - Morrowind