Jump to content

HDT Physics Extension Modding


Monsto Brukes

Recommended Posts

The only issue I have that causes ctds is when an actor is using armor with rigid bodies and it is disabled through the console. Normally you can spawn an npc or whatever for testing purposes do equipitem ######## to see if it shows up and whatnot. When you want to get rid of the actor without killing/sending it somewhere else you can use disable to remove the instance that you get when you call for an actor with a player.placeatme, but in the case that I've had with males(using a modded version of favoredsouls nude male) it ctds. I think SKSE could probably be used to fix the problem; the actor is given custom bones somewhere else in memory(not allocated by skyrim), when you remove the actor with disable I don't think it frees/releases the memory in use by the plugin causing it to ctd.

 

I'll post the files here so you can see for yourself what they do; yeah the penis does flop around and is pulled down by gravity. The other thread (http://www.loverslab.com/topic/19451-hdt-support-unofficial-v7-27-no-longer-works-for-existing-bodies-anyone-understand-chinese/) has the plugins 7-22 and 7-27 plugins both work for this. I think the difference between 27 and 22 is that havok is simulated for 27 only if the nif loaded has an HDT Havok Path set in the ninode. Some of them have breasts/butt disabled because I think HDT wanted the modder to specify only the resources they needed. The thing basically lets you add as many bones/rigid bodies as you want, but if you add too many it does cause the game to lag. I used the erect version (http://skyrim.nexusmods.com/mods/2488/?) and added bones/rigid bodies/ragdoll constraints. These overwrite the malebody_0 and malebody_1 in character assets. There is another file I put in data\meshes\clothes\penchain\ which has the havok stuff for the game. I haven't tested it too much so there could be more or less crashes than what I've had.

 

I was able to rig a hair mesh with three chains of rigid bodies. It looks pretty nice, but for some reason when the game loads up or loads when you change cells the rigid bodies show up outside the cell and get flung back to the character; I think it may be something I did wrong and not the game, so I'll put that up when I figure out what's causing that to happen. The good thing is that at least with the hair I get no ctds.

 

It would probably make more sense to make this (malebody) clothes/armor that the player/actors can wear. That way anyone can equip it and remove it before using disable or anything else that may cause it to ctd. I think I rigged these pretty well, but I never looked to much at the _0 body/0 weight so it could look funny. I'm still not completely sure how/if mass effects the rigid body, so things might move in slow motion, but other than that I think its fine.

 

2013_08_17.jpg
 

hdtnudemale.zip

Link to comment
I was able to rig a hair mesh with three chains of rigid bodies. It looks pretty nice, but for some reason when the game loads up or loads when you change cells the rigid bodies show up outside the cell and get flung back to the characer; I think it may be something I did wrong and not the game, so I'll put that up when I figure out what's causing that to happen. The good thing is that at least with the hair I get no ctds.

 

This happens because of the refresh rate, I think. I notice the same thing with breasts and butt on the HDT v22 .dll--basically, when you go from one cell to another in that area, you are just teleporting between coordinates, so the joints affected by the dynamic systems need to recalculate your character's position and refresh where they are reletive to the character (NPCs included). Sometimes this is noticeable, sometimes not--usually it is during lag points, where a lot of stuff of a particular cell is loading. The best way to avoid seeing infinity-stretching geometry is to quickly tap 'Tab' after entering the new cell to show your compass menu and everything should snap back accordingly and you can 'Tab' back to the game. This is because the dynamic system still calculates even on pause menus (I think)--either way, that was the quick fix for me (breaks immersion slightly, but it works, nonetheless).

 

Link to comment
  • 2 weeks later...

I've kept doing more trials and it seems like I've hit a bone/rigid body limit for hair. The most I can add to one hair rig is 3 sets of 2 bones. I rigged longer hair with 7 sets of 2 bones, but it seems like I am only able to load the hair through the race menu, get it to play and then exit the game. When I try to resume a save with that same hair all I get is a ctd. I am going to move over to maya now and see if I still have this problem. I've also been able to create some simple scripts for automating some of the repetitive work, like renaming things, creating secondary sets of bones and re sizing rigid bodies. I'll put up one of the stable hair meshes soon.

Link to comment

One of these has an XML so you need to have the 22 or 27 plugin installed otherwise it will ctd. Let me know if there are any weird issues. I'm still trying to see if I can get the hair to load without having the constraints start outside of the map.

 

The one containing the .xml attachement, the "christie" hair, doesn't seem to work for me. I am testing it using the 07-22 plugin. I tried retyping in the file path in the .nif file different ways, but no luck so far. One or more of the joints connected to the back of the hair seem to be located somewhere on the map way far from my character, so the influenced part of the hair stretches outside the cell my character is in and doesn't seem to snap back like the breasts and butt normally do. I may test this with the 07-27 later, but I've been having bad luck trying to get that working properly for me.

 

Is there a particular skeleton I should be testing with? I don't get CTD's, so I assume I'm not having incompatible skeleton issues.

 

 

Edit:

I can confirm it works well for 07-27, but I did have to wait a while for the hair to pop back in place. 07-22 still doesn't work though, unfortunately--the bones are there, but they are in a far away place and the physics do not play.

 

 

Hope this helps!

Link to comment

Apparently I changed something in the XML so it has trouble working with 7-22 now. I had been using 7-22 since I started messing with this, but I did find that 7-27 reduces the amount of time needed for bones to be placed back near the character correctly. I think I have a guess as to what might fix it; the dress has a common point where all the rigid bodies are joined to, so the parent rigid body, if the hierarchy is arranged like a spider, should be at the center of the head or overlapping the vanilla head bone. The hair I used for christie does not have a common/central rigid body. There are 3 sets of bones, with the highest bone being fixed. I did fix the top 3 bones because I didn't want every part of the hair moving, AND I wanted to be able to align the constraints correctly. I guess what I could of done is created a central bone, added constraints to the top 3 already in the file with very limited movement, but left the rest as they were before. I have begun recording some videos, but the havok piece requires that you jump all over to get things to work. I'll write up something later today and post it here. I also noticed that basic hinges do not cause things to start off far way, but only allow a bone to rotate on a single axis instead of swinging around in a cone area.

Link to comment

Apparently I changed something in the XML so it has trouble working with 7-22 now. I had been using 7-22 since I started messing with this, but I did find that 7-27 reduces the amount of time needed for bones to be placed back near the character correctly. I think I have a guess as to what might fix it; the dress has a common point where all the rigid bodies are joined to, so the parent rigid body, if the hierarchy is arranged like a spider, should be at the center of the head or overlapping the vanilla head bone. The hair I used for christie does not have a common/central rigid body. There are 3 sets of bones, with the highest bone being fixed. I did fix the top 3 bones because I didn't want every part of the hair moving, AND I wanted to be able to align the constraints correctly. I guess what I could of done is created a central bone, added constraints to the top 3 already in the file with very limited movement, but left the rest as they were before. I have begun recording some videos, but the havok piece requires that you jump all over to get things to work. I'll write up something later today and post it here. I also noticed that basic hinges do not cause things to start off far way, but only allow a bone to rotate on a single axis instead of swinging around in a cone area.

 

I haven't looked but I'm sure there's been a steady flow of updates to the mod that haven't been posted here. Most people (myself included) pretty much stopped caring when basic mesh support was dropped.

 

I am however watching your progress and am still willing to help with docs (or anything really). 

Link to comment

Ok here is a general run down of what I do when I rig and setup a skeleton. There's too much video involved in explaining this 3+ hours, so I'll give a short summary.

 

1. You must import a skeleton that has tbbp compatability. I made the mistake of using the vanilla one for another hair I made, so I said whatever I'm not using breast bones or anything, that was a huge mistake; it always ctd'd. You must use a tbbp skeleton even if you don't plan on using breast/butt bones for what you are working on, that includes hair.

 

 

summary1.jpg

 

 

2. If you have generic units setup in 3ds max create your bones with a 1 height x 1 width scale. It doesn't matter if you do 1x1, or 2.5 x 2.5, 3 x 3 as long as it is n height x n width.

 

 

summary2.jpg

 

3. If your mesh is premade it is easier to rig when you have quads. You can rig traingle meshes with grow/shrink select and deselect (using ctrl or shift), but if you have many poles in the mesh be prepared to animate your bones and rig vertex by vertex to prevent odd pinching or stretching.

 

 

summary3.jpg

 

 

4. In this case say I have some hair setup in my viewport. I made/retopologized the hair to have flat polygon strips. What I did to create the first bone chain was use the snap tool and snapped to vertices on these planes. To keep things simple I recommend creating a chain with only two bones the first time. The top bone will have a rigid body tacked on to it with no movement, that is to say it will be static (keyframed quality) and not twist or translate. Think of this as a pin. The second bone will have another rigid body with an included constraint; this bone/rigid body attachment will do all of the movement in the game and can be previewed in HCT. The last bone, usually added as an end automatically will just mark the end of the bone chain.

 

 

summary4.jpg

 

5. Use the ragdoll tool box under the havok menu to create the rigid bodies on these first chains. We use these first chains to align our rigid bodies and later to align constraints. Select all your bones and change the color for them so you can select them easier later.

 

 

summary5.jpg



6. Use maxscript to reduce the size of the rigid bodies by atleast half. You can use f11 to open the maxscript listener. In the top window (pink area)  type this:

$.height=$.height/2 

 

 

summary6.jpg

 

 

After you have that select each rigid body one by one, place your cursor at the end of the listener command from above and press enter. This will shrink the rigid body to half the size. The rigid bodies must not have intersecting ends or they will jitter and get stuck. I'm almost 100% sure that this is what is causing all the weird shaking issues like on: http://www.youtube.com/watch?v=9zFyGOkT0Ck

 

7. Use the snap tool with grid snap only and create bones in the viewport. You need the bone end only, so delete the rest of the chain. These ends must be aligned to the bones you added earlier and have a name hierarchy setup (suggestion) as follows:

 

xxxKeyframe

xxxDebris

xxxEnd

 

 

summary7.jpg

 

 

Where xxx is the name of this chain. Keyframe will denote that the rigid body tacked on will have a Keyframe quality, Debris for simulated and moving rigid bodies, and End just as a marker for exporting. The end can be ignore, but it is useful to have when you view using the h button and to be sure that there aren't anymore debris bodies attached.

 

Use pivot under the snap tool to align bone nubs to the bones you made earlier. Don't use the align tool; the pivot for the original bone and the nubs must overlap or it will be impossible to align your constraints later.

 

Use the link tool to parent xxxEnd to xxxDebris and again to link xxxDebris to xxxKeyframe. xxxKeyframe will be parented to whatever bone you think is appropriate. Say I created a ponytail, I would probably link xxxKeyframe to the bone named NPC head (or whatever it actually is).

8. Using the ragdoll toolbox again click on the rigid bodies you created earlier and press the x near the top to remove its connection (not link) from the bone it is aligned to. Click your new bone (the ones we created from just the bone nubs) corresponding to that rigid body and select custom on the ragdoll toolbox. Select the rigid body you just unassociated/disconnected(?) and this will attach the rigid body to the new bone segment.

 

 

summary8.jpg

 

 

The new bones MUST be used for this. Skyrim does not bones with scale correctly, so the nubs (remember n height x n width?) have to be used otherwise it will switch axis (y <-> z) and everything will be rotated 90 degrees to the left in the case that you are looking at your character from the default behind view.

9. Add the constraints you think must be used for a particular joint. Ragdoll constraints give you a cone of movement, and hinges give you movement on only one axis. I don't recommend using ball and socket yet because it will rotate and twist in every direction, even inward; this is what causes the breasts to sink back in the chest like in the video listed on step 6.

 

I will have to include a short explanation on constraints in another post.

 

10. Set the quality type for each rigid body in its modifier. The top rigid body acting as an anchor only should be set to Keyframe, the next one down should have debris indicating that it will have movement allowed. Pretty much every other setting in the modifier can be ignored. If you want to change the restitution to make the bodies stop faster then you can go to 0.9 or 0.95, otherwise leave it alone. Setting it to 1 will cause to stay in place, so avoid that.

 

11. Skin your mesh to the set of bones made out of nubs. If you are having weird problems turn off bone scale influence in the skin modifier. This is pretty simple if you have a plane type element (quad strip of polygons). Set the entire strip to have .5/.5 influence on the keyframe and debris bones. From the midpoint where the joint is use grow twice, set the strength for the selected bone to .1, then shrink and .25, shrink again and do .5, increasing the weight using the weight tool until you get to an influence of 1.

For a single joint you should notice a color pattern like this:

 

 

summary11.jpg

 

 

gray, blue, green, yellow, orange, red

 

(no influence/gr=0, bl=.1, gr = .25, yl = .5, orn = .75, red = 1)

 

Hopefully you have a quad mesh for this, if you don't I suggest removing edges on the model to make quad topology. It takes time and is a pain in the ass, but it will make skinning the model much easier.

 

I'll add the HCT part in the next post.

Link to comment

question about language of the post:

 

point #8 after the spoiler you have:

 

The new bones MUST be used for this. Skyrim does not bones with scale correctly, so the nubs

 

 

in the bold section, it seems like there's a word missing? 

 

excellent document.

Link to comment

Skyrim does not support bone scale with the current exporters, so n x n height, width must be used, pretty much leaving you to use the bone ends as dummies. I am writing another script right now to automate some of this. The only thing it should really require you to do is orient the constraints yourself, skin your mesh and setup havok.

 

I'll put up a video explaining constraints only. The rest is pretty easy and I got the new scripts to work; it cut out hours of work out and is easier than when I was doing it by hand renaming everything.

Link to comment

Ok here are the maxscripts I used:

BoneToNub makes a duplicate bone chain out of bone ends; you need to have your bone creation set to 2.5 (on the create panel) for this to work.

HCTPrevCap is used to rename capsules and assign them to the bone nubs; use the old bone chain you create to make the capsules first, then run this script to switch them to use the bone nubs created by BoneToNub.

HCT ExprCap renames your selected capsules to the same name as the nub they are tacked to. If you are going to export havok XML the names for the rigid bodies must be the same as the bone nubs.

I have a reference video here that shows you how to setup constraints and two bone chains, so this assumes you already know how to make or use models/rigging/creation kit.

 

http://youtu.be/0upL7wDuBDI

 

After some more experimentation I've found that the priority under armoraddons must be 0 if you are going to use an armor with rigid bodies. I was testing another version of the males I posted before, the original being flaccid and another set of models for erections; if the priority is above 0 on my second armor then it won't scale properly with the weight slider and will create gaps between the neck, ankles and hands, so its safe to keep it set to 0 if you are going to create an armoraddon that only takes up the body slot.

hdtmaxscripts.zip

Link to comment
  • 2 weeks later...

I tested and got spring constraints to work correctly. They are definitely good for breast animation, but the downside is that they only jiggle when the character crouches/stands, stops running/moving. It looks spot on like what dragonfly had for tbbp, but it doesn't work too well in the middle of idles. I'm going to go back and test with the ball socket to see if I can get better results. There is an issue though with mirroring bones/ik which causes the capsules you add to all have the same pivot, so the pivot and matrix for the capsule is oriented in the same direction even if you do mirror bones. I am using a bone chain in the middle of the chest and the butt to move both breasts/cheeks together. It seems to work pretty well aside from the mid animation issue, but I'm sure I'll figure out why its doing that soon.

Link to comment

I tested and got spring constraints to work correctly. They are definitely good for breast animation, but the downside is that they only jiggle when the character crouches/stands, stops running/moving. It looks spot on like what dragonfly had for tbbp, but it doesn't work too well in the middle of idles. I'm going to go back and test with the ball socket to see if I can get better results. There is an issue though with mirroring bones/ik which causes the capsules you add to all have the same pivot, so the pivot and matrix for the capsule is oriented in the same direction even if you do mirror bones. I am using a bone chain in the middle of the chest and the butt to move both breasts/cheeks together. It seems to work pretty well aside from the mid animation issue, but I'm sure I'll figure out why its doing that soon.

 

Excellent news! need a tester?

Link to comment

I'll put up my test files. This is using UNPB 2-5 nude http://skyrim.nexusmods.com/mods/37900/? I put the XML in the same directory as femalebody_n. I haven't tweaked the butt jiggle much, but I think I'm going to have to skin this thing again to get more movement.

 

haven't looked yet, but I'm assuming that I should. . .

1) have hdt installed and working (does version matter?)

2) put this in as a body replacer mesh

3) the .xml with the textures

Link to comment

I just stick to the 27 version now. I think I know why the springs stop moving in mid animation now though; the xml files hydrogen made were generated using the havok sdk and not in 3ds max, which let her attach motors to constraints, I don't think 3ds max can create usable motors for havok. The cbbe xml that came with the china dress has constraints with motors attached to the breasts and butt using something called hkpgenericconstraint, not something available in hct I think.

Link to comment

Canderes i watched the video you put up yesterday, and thought that i would give it a go.

 

I made a simple mesh, and a simple bone chain "Keyframe, debris, end)

i did all the things required (at least i believe i have) all up to the point were you preview it in havok,

the bounding capsules move the way i intended but the mesh is static.

 

I have checked the weights/re-weighted it a few times, and started from scratch twice and the same thing happens each time.

I'm not sure where i went wrong.

 

http://www.mediafire.com/download/2zxf08vnar6o018/test2011.max

I use 2012 but saved it for 2011.

 

My Havok Content Tools version is 2013-1-0_20130717_64Bit_PcXs  

Link to comment

I did the setup but had no movement when squatting or jumping. Does it require femalebody_n? 

 

Even so, I can't be sure that I had dependencies installed right . . . The installer is 100 stories of 110 percent 10-speed terror. Just too many options.

 

Would you mind zipping up and attaching your UNPB dir? 

Link to comment

Canderes i watched the video you put up yesterday, and thought that i would give it a go.

 

I made a simple mesh, and a simple bone chain "Keyframe, debris, end)

i did all the things required (at least i believe i have) all up to the point were you preview it in havok,

the bounding capsules move the way i intended but the mesh is static.

 

I have checked the weights/re-weighted it a few times, and started from scratch twice and the same thing happens each time.

I'm not sure where i went wrong.

 

http://www.mediafire.com/download/2zxf08vnar6o018/test2011.max

I use 2012 but saved it for 2011.

 

My Havok Content Tools version is 2013-1-0_20130717_64Bit_PcXs  

The scarf is skinned to another mesh FemaleHead instead of the NPC Head [Head] bone. 

 

monsto I just put the files in as a body replacer in Data\meshes\actors\character\character assets\. Even if you don't have the textures it should work. I have those xp32 skeletons in Data\meshes\actors\character\character assets female\. I am using skse plugin hdtPhysicsExtensions 7-27.7z.

Link to comment

I have an alternate version of the males I uploaded before; making the penis longer made it easier to rig and actually helped with self collisions/intersecting with other objects. The regular body is a replacer with bones for flaccid, and then there's an item called lubricant you can get in the console for the erect version both based on post #26.

 

flaccidvserect.jpg

malealternate.zip

Link to comment

I have an alternate version of the males I uploaded before; making the penis longer made it easier to rig and actually helped with self collisions/intersecting with other objects. The regular body is a replacer with bones for flaccid, and then there's an item called lubricant you can get in the console for the erect version both based on post #26.

 

flaccidvserect.jpg

 

sidetrack: what the hell is that horrifying vertical cock-shadow in the middle of that picture. I can't tell what it's supposed to be and it's creepy scary. makes my teeth itch.

Link to comment

I got it working here's my thoughts.

 

I originally tried to install UNPB and then overwrite with your files. The way I got it working was just left my main body mod in place, then replace the meshes with these, then put the unp textures in place. Since I had no intention of playing, this worked fine.

 

I then put the xml file in the same dir as the meshes. it would not work placing the xml with the textures. If it works while in the dir with the meshes, I'd say to just leave it at that for simplicity sake.

 

I made a video to show the anomalies. please read before watching.

 

0s -- normal idle from 'female animation pack'. the breasts are pulsing but not in sync with the main anim. It's not the anim that i use, it has no breathing addon.

22s + -- I changed cells, as you can see in the console, to the exact same cell I was in. The results were . . . comical.

40s + -- you can see the edges of weight painting. falloff?

 

It's been a while, but I know there's 2 breast bones... the first, i think called breast01, created by cherry in cherry's skeleton for the original bp, the 2nd one, I think it's called breast_02, created by dragonfly in tbbp.

 

What I see is movement by only breast_02. I don't see any movement by breast01. Weight painting for breast_02 is only on the upper breast with a bit of extension down the front. weight painting for breast01 is more "whole boob". 

 

breast_02 bone is also a lot more sensitive. If you look at the straght tbbp anim, breast_02 moves to about 2-3x the extents of breast01. I don't know jack about what you're doing, but that sensetivity may account for the crazy wobble after the cell change.

Link to comment

Its almost like the breast_02 bone has no damping to restrict the amount of bounce..

 

Another experiment is to try entering a cell where the infinite breasts occur then exit and re enter..

 

Im no wiz but i think it could be the fact that the cell loads first then the physics.. which could cause

the weird visual.

Link to comment

Archived

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

  • Recently Browsing   0 members

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use