Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

Multiple havok materials, single object


TheMagician
 Share

Recommended Posts

I asked this in the other forum (you know, Bethsoft's  aa_tongue.gif ), but since I got so many offers of help from all of the fine people here (and a very warm and welcoming bunch, indeed!) I thought I'd pester you as well.

I am trying to make a tileset and some architectural meshes in Blender that require multiple textures and materials and I can't seem to get Oblivion to recognize the different havok materials in-game. They show up in NifSkope fine, but the only havok material the game seems to recognize is the one that I select on the export screen. If I set that to stone or dirt or wood or whatever, that's what I get, even though each separate object has it's own havok material applied in Blender.

Also, my arrows are flying right through the walls, even though they react normally when I hit them with my fists or melee weapons and I can walk around in them just fine. I also noticed that items (like weapons) that I place on the floor of the tiles in the CS react strangely in-game. They fall through the floor when I touch them and then reappear where I originally placed them.

I also have a question about the physics properties of weapons: when I drop them in-game, they bounce like crazy, shooting up into the air about 200 feet or so. Just thought I'd tack on that question since I was on a roll.

How's that for questions?

Link to comment
Share on other sites

Whew lets see.

The material setting you set in the bhkRigidBody(T) overides any setting on the lower blocks. To get multiple Havok Materials with a single NIF, you have to nest multiple NiNodes and create a new bhkColisionBlock for each material you use.

Not sure about the arrows and walls.

I've seen the falling reapearing caused by conflict in the Havok Material settings. Check to make sure that the Layer and Layer Copy entries in your bhkRigidBody(T) and the Layer setting inside Data Layers in your bhkNiTriStripShape all match.

Hmm obviously your physics setting are a little bjorked. The MAX exporter doesn't support those setting so I always copy them from a bethsoft NIF that's close to my sword. The Blender exporter does support them though so I'd try playing around with the settings, failing that just copy them from a similar Bethsoft NIF.

If you wan't post a NIF you're having problems with and I'll see if I can find the trouble and give you more specific instructions.

Good Luck.

WT

Link to comment
Share on other sites

WindmillTilter's suggestions would be a good place to start.  Relative to the arrows and walls, is the collision for the walls created from bhkConvexVerticesShapes?  bhkConvexVerticesShape blocks do not catch arrows.  Also, what is the flag setting in your BSXFlags block?  It should be 2 for static objects such as walls.

Also, do you need each object to have the correct havok material so it will produce the correct sound when hit or walked on?  If not, why is the havok material important?  The best solution may depend on what you are trying to accomplish.  Good luck.

Link to comment
Share on other sites

Quote

The material setting you set in the bhkRigidBody(T) overides any setting on the lower blocks. To get multiple Havok Materials with a single NIF, you have to nest multiple NiNodes and create a new bhkColisionBlock for each material you use.

I thought that might be happening. I'm not very good at using NifSkope yet, so I'm not sure how I would go about 'nesting' NiNodes and creating bhkCollisionBlocks for them.

Quote

I've seen the falling reapearing caused by conflict in the Havok Material settings. Check to make sure that the Layer and Layer Copy entries in your bhkRigidBody(T) and the Layer setting inside Data Layers in your bhkNiTriStripShape all match.

The Layer, Layer Copy and the Layers inside the Sub Shapes are all OL_STATIC, but I don't have a bhkNiTriStripShape, I have a bhkPackedNiTriStripShapes inside a bhkMoppBvTreeShape. Don't know if that makes a difference.

Quote

Hmm obviously your physics setting are a little bjorked. The MAX exporter doesn't support those setting so I always copy them from a bethsoft NIF that's close to my sword. The Blender exporter does support them though so I'd try playing around with the settings, failing that just copy them from a similar Bethsoft NIF.

I haven't played around with the physics settings at all, yet...I've been too busy trying to get my creatures to work. I want to create custom physics instead of copying and pasting anything, if I can help it, though I'll do so for the short term if I have to. I guess I'll just have to come back to this later and fool around with the settings when I have more time.

Quote

If you wan't post a NIF you're having problems with and I'll see if I can find the trouble and give you more specific instructions.

A generous offer. For now, here's a screenshot of my nif with the Sub Shapes expanded. As you can see, pretty basic, but I'm just trying to figure out how all of this works.

Quote

Relative to the arrows and walls, is the collision for the walls created from bhkConvexVerticesShapes?  bhkConvexVerticesShape blocks do not catch arrows.

No, they're Static TriangleMeshes. I think they need to be for Mopp shapes. They're basically copies of the visible meshes. Would there be any issue arising from the proximity of the visible meshes to the collision meshes? Do they have to be any particular distance apart? I don't see why they would need to be (other than from a realism perspective) but other modelers always make them a little apart. I always assumed that that was just to make them easy to select in the editor.

Quote

Also, what is the flag setting in your BSXFlags block? It should be 2 for static objects such as walls.

It's set at 2. I just noticed that the tooltip for BSXFlags shows: Bit 0 Enable Animation, Bit 1 Enable Collision, Bit 2 Is Skeleton nif?, etc. Does that mean that if the integer value is 1 the nif can animate, but has no collision, value 2 collision with no animation, value 3 animation and collision, value 4 skeleton without animation or collision, value 5 skeleton with animation and no collision and value 6 skeleton with animation and collision? I'm totally guessing here and have probably made a completely silly (and entertaining) extrapolation since I've never paid any attention to this value before, but it's a bit field, right, so it should work something like that.

Quote

Also, do you need each object to have the correct havok material so it will produce the correct sound when hit or walked on?  If not, why is the havok material important?  The best solution may depend on what you are trying to accomplish.  

Yes, I'm creating a tileset, so the materials have to be correct when struck with weapons. Also: I just want to know. And knowing is half the battle. Thanks, G. I. Joe!  aa_biggrin.gif

Thanks to both for your help and words of encouragement!
Link to comment
Share on other sites

Magician, first yes bit 1 of the BSX Flags enables collision.  So 2 is the value you need for your static collision.  

I understand that your aim now is more toward understanding and building for the future, rather that completing a specific mod right now.  With that in mind, I would suggest that you start with a much simpler collision.  Collision can be tricky and you are starting out with about as difficult a problem as their can be (mutliple collision materials with generalized triangular collision with MOPPS).  Using a car racing analogy, it's like you are starting out with a McLaren F1 car, where maybe a dirt stocker or a formula ford might be a better place to start.  Although the decision is clearly up to you, I think you will most likely advance farther sooner by starting simple and buildiung complexity as you successfully complete each step.

Without seeing the .nif file directly, I can not know all the possible problems.  However, it does appear that your collision order is wrong.  Collision sequences are one of the few places in a .nif file where the exact order is essential.  I explain the correct order for most collision sequences in Session 2 of my Wings3D for Oblivion tutorial (see: Wings3D4Oblivion).  However, you can just as easily examine a similar sequence from a vanilla Oblivion .nif file.  I'm at work right now, but if memory serves, for your case the order should be (first to last): hkPackedNiTriStripsData, bhkPackedTriStripsShape, bhkMoppBvTreeShape, bhkRigidBody, bhkCollisionObject.  I don't know of any case where the bhkCollisionObject block isn't last.  Depending on the version of NifScope you are using, check Spells to see if there is one for reordering collision blocks.

In any case, good luck.

Link to comment
Share on other sites

As Vince said it's really hard to troubleshoot without access to the NIF. If you post one of you'r problem meshes we can have a look and probably tell you what the problem is.

For Nesting NiNodes. R-Click in the Block List and go to Block>Insert. From the menu that pops up got to NiN>NiNode. Click on you're base NiNode (Block 0) find NumChildren in the Block Details and raise the number by one. R-Click on Children go to Array>Update. Then expand Children and in the new blank entry type the number of the new NiNode you just created.

For creating the collision group you'll probably have to export each Havok Material group seperately from blender in to temp files. Just open the temp file and copy the entire havok block, then past it into you're new NiNode. You can move the piece of geometric mesh to the new NiNode by adding it to the Children array of you're new NiNode and removing from Children in the Base NiNode.

@Vince: Do you mean the block order in the screenshot he posted. Unless I'm missing something it looks good to me?

WT

Link to comment
Share on other sites

@WT, my bad. I always use "Show Blocks in List".  I didn't realize that if one uses "Show Blocks in Tree", the displayed collision order (top to bottom) is exactly the reverse!  'Just wonderful. :blush:

@Magician, since you are used to using NifScope in the Show Blocks in Tree format, I think you would be best off examining collision sequences in vanilla Oblivion objects to see the correct order, rather than my tutorial (which is all in Show Blocks in List format).  WindmillTilter is correct, the issue with your collision for the case in the screen shot is not the order of the blocks; that's fine.

Link to comment
Share on other sites

Ok. I'm not making any progress with this. I think I need to spend some more time with NifSkope before I really get the hang of all of this copying and pasting of branches. As far as I can tell, my nif is identical in structure to the vanilla nifs with the exception of the NiStringExtraData (which I copied from a fort ruin nif). Of course, I haven't checked every single variable, but all the obvious ones (to me) have been verified.

If someone wants to take a stab at this, I've uploaded the nif here -> testWallTile2.nif

If you can get this to work with proper arrow catching and havok materials I'll give you a prize. Please feel free to make a public example of me by pointing out the obvious flaws in my noob attempt at a tile. (But ignore the textures, it's just a test piece.) The havok materials have been set to crazy things like steel and glass just to make the difference obvious in-game.

Heh. I'm done.

Link to comment
Share on other sites

Update: I've solved one of the problems -> arrow catching.

Apparently you need to invert the normals for your collision mesh as well as your textured mesh for the game to use the collision properly. It's obvious in hindsight, but for some reason it never occurred to me that I would have to. Just to test it, I created a new tile from scratch and the arrows now bounce off the walls using the default material from the bhkMoppBvTreeShape (which for this tile is HAV_MAT_STONE).

I still haven't learned how to get multiple havok materials working, but I need to spend some more time with NifSkope for that. In theory, if my tiles exactly duplicate vanilla tiles (ie. all of the data is in the right place and the right range) then there shouldn't really be any difference between them, right? In theory, I should be able to open up all of the vanilla files, examine their data, and extrapolate more or less correct data for my own tiles. Or am I wrong on that count?

I have noticed that my tiles are lacking a NiStringExtraData, but simply copying and pasting these from vanilla files didn't seem to make any difference. (Well, not a noticeable one.) Does anyone know anything useful about these values?

Thanks again.

Edit: I found this thread on Bethesda's forum which seems to indicate that I can't actually do what I'm trying to do with Mopp shapes yet. It seems I'm not the only one who has had this problem. Hopefully this will be fixed soon. If anyone knows a way to do it, of course, I'd be happy to hear it.

Link to comment
Share on other sites

OK finally spent some time digging into this. I couldn't find anything wrong in you're havok setting that would explain the drop through issue. I did notice however that the NIF you posted was from before you fixed the normals, it only caught arrows from the back. For lack of anything else to try I exported a new collision mesh and pasted it inside the BhkRigidBody in your NIF. Worked fine, caught arrows and stuff no longer fell through the floor.

So either having the normals inverted affects clutter as well as arrows (If that's true it's news to me), or there was something else different about my export that I'm missing. Can you check if clutter still drops through the tiles you've fixed arrow catching on.

And BTW thanks for bringing this up, I had given up on ever seeing a new MAX exporter and never even knew it was out. YAY this could be awesome. (Not a slam on the superbly excellent people on the NifTools team, I just thought they weren't developing in that direction any more)

WT

Link to comment
Share on other sites

@WT, I'm glad you had a chance to help.  I've been over my head modeling vines (I hate vines now).  I too was glad to see the new NifTools MAX exporter.  The gmax version works fine too, including collision.  BTW, I would have never thought one could actually edit the name of a .nif file block to change its nature.  I tried it (bhkRigidBody > bhkRigidBodyT) and it works just like you said.  That will come in very handy.

Link to comment
Share on other sites

Quote

So either having the normals inverted affects clutter as well as arrows (If that's true it's news to me), or there was something else different about my export that I'm missing. Can you check if clutter still drops through the tiles you've fixed arrow catching on.

Yes, the clutter falling through floor issue was resolved when I inverted my normals. Everything seems to work fine (famous last words) except the MOPP multiple havok materials, which is a known issue, apparently.

Thanks for taking a look at the file. It's nice to know that I'm doing things right!  aa_biggrin.gif
Link to comment
Share on other sites

Quote

BTW, I would have never thought one could actually edit the name of a .nif file block to change its nature.  I tried it (bhkRigidBody > bhkRigidBodyT) and it works just like you said.  That will come in very handy.
Yeah that can be a lifesaver. Can't take credit for the discovery, someone on the Bethsoft forums mentioned it can't remember who.

Quote

Everything seems to work fine (famous last words) except the MOPP multiple havok materials, which is a known issue, apparently.


I want to play around with that for my own use if I ever make the time. If I stumble across a workaround (listshape or whatever) I'll post it here.

WT
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...