Jump to content

Customize: .xml parameters and editing


Recommended Posts

This tutorial contains info on some of the parameters used in customizing HDT physics. With the Just For Fun program, it is no longer necessary to edit the .xml by hand. However the information here is valid and will help customization. By Monsto
 
What is this?
This tutorial attempts to document the hdtPhysicsExtensionsDefaultBBP.xml file that accompanies the HDT Body Physics hdtPhysicsExtensions.dll SKSE plugin. It is by no means a complete document, and needs many eyes and brains on it to keep it accurate.
Please post in the main forum if you have information that could be added to this documentation.
 
Important Note: After you make a change to the xml file, to see the changes you only have to change or reload cells in the game. Whatever cell you're in, you only have to coc to that cell again. Currently, this will reload the xml file. If it does not, then you would need to go to a completely different cell to defeat caching. coc whiterundrunkenhuntsman and then coc back to where you were would do it.
 
Testing Environment
Manipulating the file and testing the changes is time consuming. The parameters are not available to the console. If you are going to work on your own parameters, it would be best to streamline your game load as much as possible.

Editor
You can use any text editor to edit the xml file: Notepad, Notepad++, UltraEdit, etc. However, I would recommend an editor specifically built for xml editing as it will have conveniences that a straight text editor would not. I used XML Notepad 2007.
 
Testing

  • Remove all mods.
  • Add Race Menu OR Enhanced Character Edit OR both.
  • Add your body mesh of choice.
  • Add your animation set of choice.
  • Add your skeleton of choice.
  • Start the game.
  • From the main menu do not load a game.
  • console: coc WhiterunDrunkenHuntsman (see below)
  • console: showracemenu > modify the character
  • console: save hdttest

Loading a small, simple cell will dramatically reduce load time. The Drunken Huntsman is a cell that is well lit, small, has very little clutter and very few AI. Bannered Mare has a bunch of clutter, more AI and is no better lit. Dragonsreach is large with a ton of clutter and a ton more AI but has better lighting.
 
Recommendations
I recommend the following tools

  • Review Studio 
    . . . is a mod that adds 8 cg-studio-like rooms in white, blue, green and black. I use coc studio4 for a well lit seemingly infinite black space.
  • Mod Organizer 
    . . . is a mod manager than makes simple the process of different game configurations. This testing scenario the kind of situation that it was designed for. It would allow you to keep your primary Skyrim setup while having a streamlined setup only for testing your xml. With my setup, I am able to load the game, press enter twice (to load the only save game in that profile) and start the game in a black room facing the character.
  • PS Universal PC NPC Body Changer 
    . . . is a mod that takes the most well known body replacers and the most popular texture sets and allows you to change between them pretty much on the fly. You can see how your .xml will affect different bodies.

For general setup, I recommend windowed mode with a Borderless Window mod. There's a billion of them out there, and ENB even has a parameter for it. At this point all you have to do is alt-tab between Skyrim and your editing tool.
 
XML File layout 
XML files are typically read all at once into an array and then the array is queried for the information that is needed. What this means for us is that you can change the length of the file without breaking the game or the plugin.
In other words, as of v9-28, you can add to the file as needed as long as it doesn't conflict with existing data. (You could probably remove data as well but I didn't test it. There's no real reason to do so.) This means that, if you are making extensive changes to the file, you could add fields describing your changes. An additional “description” field at the top and/or near where changes are made could provide information to other users or provide you bookmarks for easy searching.
The file itself is broken down into primary hkobject sections. Each has a name field with a 4 digit number for data. The numbers range from #0056 - #0088 and are not sequential in the file. Each hkobject contains hkparams sections whose data configures aspects of a bone or a weighted section of the mesh. In a few cases, the hkparams contain secondary hkobjects.

The Meat & Potatoes of the doc: Mod the jiggle
The following information is based solely upon my own observations. Additional observation will be added as I receive it. Please post your observations!
When you make a change to the xml, you do not have to exit and restart the game. Any change of game cells will reload the xml from file. If you are using 'studio4' from above, all you have to do to see your changes is to go to the console and re-enter coc studio4 again.
To mod the bounce parameters

  • Search for the word breast or the word butt. This will return 4 different results per body part (8 total). The results are actually the name of the bone in the skeleton.
  • Each of the parameters in the section below will appear in each body part.
  • There are a ton more parameters, but these are the only ones that I have found to have a visible effect on bounce.

Physics Parameters
Data is shown as: least effect ~ most effect [default value].
The effect range (least to most) is what i saw to be practical. You can exceed this range, but expect weirdness.

  • timefactor = bounce speed
    .01 ~ 1.8 [1.0]
    this seems to be a vertical (linear) speed only. Movement is different than maxVelocity below.
  • linearDamping = factor to affect vertical speed (bounce speed).
    1 ~ -10 [0]
  • angularDamping = factor to affect horizontal amount (sway amount).
    0 ~ -500 [0]
  • maxAngularVelocity, maxLinearVelocity
    This seems different timefactor.
  • I haven't found a horizontal (angular) speed parameter. This may use pendulum math and thus cannot be changed.

Range Parameters
hkpGenericConstraintData appears for each butt and breast bone and contains the following block of data. There is other data that should not be disturbed.

 

    <hkobject>
      <!-- info SERIALIZE_IGNORED -->
      <hkparam name="data" numelements="23">
        (0.000000 0.000000 0.000000 0.000000) <!-- 1 Pivot A -->
        (0.000000 0.000000 2.000000 0.000000) <!-- 2 Pivot B -->
        (1.000000 0.000000 0.000000 0.000000) <!-- 8 Matrix3x3 angular basis A -->
        (0.000000 1.000000 0.000000 0.000000)
        (0.000000 0.000000 1.000000 0.000000)
        (1.000000 0.000000 0.000000 0.000000) <!-- 9 Matrix3x3 angular basis B -->
        (0.000000 1.000000 0.000000 0.000000)
        (0.000000 0.000000 1.000000 0.000000)
        (-0.200000 0.200000 0.000000 0.000000) <!-- 17 0 Angular limit at axis 1 in radius -->
        (-0.100000 0.100000 0.000000 0.000000) <!-- 17 1 Angular limit at axis 2 in radius -->
        (-0.500000 0.500000 0.000000 0.000000) <!-- 17 2 Angular limit at axis 3 in radius -->
        (0.000000 0.000000 0.000000 0.000000) <!-- 14 0 Angular motor index at axis 1 -->
        (1.000000 0.000000 0.000000 0.000000) <!-- 14 1 Angular motor index at axis 2 -->
        (2.000000 0.000000 0.000000 0.000000) <!-- 14 2 Angular motor index at axis 3 -->
        (1.000000 0.000000 0.000000 0.000000) <!-- 4 0 Linear dof 1 relate to B -->
        (0.000000 1.000000 0.000000 0.000000) <!-- 4 1 Linear dof 2 relate to B -->
        (0.000000 0.000000 1.000000 0.000000) <!-- 4 2 Linear dof 3 relate to B -->
        (-1.000000 1.000000 0.000000 0.000000) <!-- 16 0 Linear limit at dof 1 -->
        (-2.000000 2.000000 0.000000 0.000000) <!-- 16 1 Linear limit at dof 2 -->
        (-6.000000 6.000000 0.000000 0.000000) <!-- 16 2 Linear limit at dof 3 -->
        (3.000000 0.000000 0.000000 0.000000) <!-- 15 0 Linear motor index at axis 1 -->
        (4.000000 0.000000 0.000000 0.000000) <!-- 15 1 Linear motor index at axis 2 -->
        (5.000000 0.000000 0.000000 0.000000) <!-- 15 2 Linear motor index at axis 3 -->
      </hkparam>
      <hkparam name="commands" numelements="35">
        1 2 8 9 17 0 17 1 17 2 14 0 14 1 14 2
        4 0 4 1 4 2 16 0 16 1 16 2 15 0 15 1
        15 2 0
      </hkparam>

 

 

 

Range Parameters Block Data
About the block hkparam name="data" and the block hkparam name="commands":

  • hkparam name="data": In the comments at the end of the line, the first 2 numbers are an identifier. The last line for example (first 2 numbers = 15 2) appears in the hkparam name="commands" block as 3rd-to-last and 2nd-to-last numbers. I assume that the last number (zero) means "end of data".
  • hkparam name="commands": This list is a direct reference to the items listed in the data block.
    Order requirements are unknown. Other than numelements="35" equaling the number of items in the list, the length requiremens of the list is unknown.
  • You could probably get away with copying the list in the data block directly into your .xml (for reference; to get the comments).

The data blocks affect specific areas of the mesh.

  • #0063 = Right Butt
  • #0075 = Left Butt
  • #0087 = Right Breast
  • #0099 = Left Breast

Um ok great... what does all that mean?!
I had to give you the basic information. You could still fuck up your config, but at least this way you have an idea what's going on. Either way, the standard "don't blame me, it's your computer" disclaimer applies here.
So here's where we roll it all together.
 
Change Range Parameters
1 Pivot A and 2 Pivot B change initial placement. They have different sensitivity and different motion.

  • 1st number changes left-right
  • 2nd number changes in-out
  • 3rd number changes up-down

17 0 Angular (and 17 1 & 17 2) change the extents of the left-right physics movement.
16 0 Linear (and 16 1 & 16 2) change the extents of the up down movement.
There's plenty of other things going on in that section. Experiment!
 
Change Physics Parameters
Use the Physics Parameters (section above) to tweak the physics movement.
 
Instant Success!
Or if you don't have instant success, post in the Customization forum for helpsies.
Please let me know if I've missed something.

Link to comment

I tried changing timefactor/linearDamping/angularDamping on the butt and that didn't do anything. Maybe you could make some gifs showing effects of different values?

 

 

At one point in the article you say you have to restart the game for changes to kick in and in the other you say you just need to reload the map, so what is it?

Link to comment

If you really like the lighting of a certain cell, you can always just select your character in the console and type: setnpcweight (number).

 

You keep the perfect lighting and the cell doesn't have to reload.  This works while editing hdtPhysicsExtensionsDefaultBBP.xml.

 

It's been working for me at least.  

 

Also, the physics parameters are a difficult for me to understand and I need more clarity.  

 

  • angularDamping = factor to affect horizontal amount (sway amount).
    0 ~ -500 [0]

What does that mean?  The values of 0 through -500 effect sway or 0 - 500 effect sway?  I'm not entirely sure and don't want to ruin something by editing it wrongly.

 

 

Link to comment

If you really like the lighting of a certain cell, you can always just select your character in the console and type: setnpcweight (number).

 

You keep the perfect lighting and the cell doesn't have to reload.  This works while editing hdtPhysicsExtensionsDefaultBBP.xml.

 

It's been working for me at least.  

 

Also, the physics parameters are a difficult for me to understand and I need more clarity.  

 

  • angularDamping = factor to affect horizontal amount (sway amount).

    0 ~ -500 [0]

What does that mean?  The values of 0 through -500 effect sway or 0 - 500 effect sway?  I'm not entirely sure and don't want to ruin something by editing it wrongly.

 

You won't ruin anything.

 

The worst that's happened to me while fuxoring with it is I set something too far out of expected range and the ensuing load caused CTD. 

 

"Ok. . .  that's bad." > change it back > restart the game > "note to self"

 

Zero to negative 500

Link to comment

I'm trying to break down the parameters logically and it seems to me (judging by the parameter names) that:

 - LinearDamping would be from-to movement in respect to skeleton bone location (along the axis)

- AngularDamping would be an angular movement left-right and top-bottom (at an angle to the axis)

- TimeFactor would be the time it takes for the bounce to complete

The mentioned axis would be limited by 2 points: the skeleton bone and a point on the surface of the object.

 

This would still relate to pendulum math nevertheless :)

Is that correct Monsto?

Link to comment

So I've done some testing in-game and that's what I noticed:
1. At timefactor=1 for all and any butt bone I see severe twitching of both butt halves upon touch, which becomes more frequent and even glitches at timefactor=1.8, but ceases at timefactor=0.8.

2. Reducing timefactor to 0 causes dragging of a bone and its weight section for the duration of an animation (complete jump, run until stop).

3. Reducing MaxAngularVelocity and MaxLinearVelocity causes dragging of a specific bone, until the bone stops complete at maxvelocity=0. This persists even if the animation is finished!

4. LinearDamping and AngularDamping are most likely responsible respectively for the linear and angular displacement of the weights section of the model from the bone. Interestingly, LinearDamping = 0 for butt and breast bones, while AngularDamping = 0.05049 (or something close to that) for both as well.

Link to comment

LinearDamping and AngularDamping (∈[0,1]) means how many part of velocity will be lost after 1 second.

For example, if v=1 and LinearDamping = 0.3, then 1 second later, v' = (1-0.3)v = 0.7v(assume it isn't effect by any forces).

 

Ah ok thank you, I was wondering about this.

 

What exactly does the "center of mass" and "restitution" settings do in rigidbody?

Link to comment

Object #0063 (R Butt), angularDamping set to -200 or timefactor set to 0.25, CTD on tab back in. Looks like the acceptable values are different depending on the object?

 

Hydrogen's explanation of dampening makes sense, considering putting the values to -100 made a perpetual effect.

Link to comment

 

What's the difference between R Butt and R Prebutt?

I'm guessing that those are just two different bones for the right side of your character's butt :).

 

 

My butt cheek only has one bone  :s

 

There is no Pre anything node in my femalebody_1.nif 

Link to comment

 

 

What's the difference between R Butt and R Prebutt?

I'm guessing that those are just two different bones for the right side of your character's butt :).

 

 

My butt cheek only has one bone  :s

 

There is no Pre anything node in my femalebody_1.nif 

 

Well the butt cheeks in my femalebody_0 and femalebody_1 .nifs don't have prebutt bones either. But then again, you have 2 sets of bones per breast and both of them seem to be listed in hdt.xml.

 

To be honest, this config file has a lot black magic to me :D.

Link to comment

I've been working on editing my own .xml to get the setting how I want it for my particular body.

 

Justforfun makes it super easy. However, there are so many parameters, and the parameters are not intuitive at all (you have to test them in-game to really get an idea of what the effects are). It is taking me far longer then I had originally hoped to get it done.

Link to comment

the pre butt bones will not show up on your mesh because they are not actively animated, the purpose of the pre butt bones are to act as 'anchors' for the inertia instantiated objects, in this case the butt bones. if you want a more noticeable butt bounce increase the linear constraints for the y or z position.

Link to comment

what _I_ want is a reliable speed adjustment. boing boing like a spring travelling 3 feet, is one thing

 

but a quick short tremble like thumping a waterballoon . . . that's really what I'm after. that would require really fast movement (like .1 sec oscillation to the extents), really fast damping (.5 sec or less) and really short extents ( < 2 units).

 

what we have here is a tool that can defy science... where an object with a certain mass performing a pendulum action can be made to move at an arbitrary speed.

Link to comment

It also depends on the body.

For me, it is ass-bounce almost not to notice with UNPB / Sevenbase.

Only when you climb stairs, etc.

With CBBE, ADEC, MANG and especially CHSBHC this looks completely different.

The effect is significantly stronger and the effect also holds a bit longer.

 

You just have to copy the data of the Body of NifSkope for breast, butt, etc. in the XML (Just For Fun).

Almost all the data are in - found in NifSkope "View> Inspect".

The original hdt.xml and default.xml are made ​​for a specific body.

That does not fit for everyone.

Link to comment

It also depends on the body.

For me, it is ass-bounce almost not to notice with UNPB / Sevenbase.

Only when you climb stairs, etc.

With CBBE, ADEC, MANG and especially CHSBHC this looks completely different.

The effect is significantly stronger and the effect also holds a bit longer.

 

You just have to copy the data of the Body of NifSkope for breast, butt, etc. in the XML (Just For Fun).

Almost all the data are in - found in NifSkope "View> Inspect".

The original hdt.xml and default.xml are made ​​for a specific body.

That does not fit for everyone.

 

Therefore, I'm a bit worried that hdt might at some point become another bodyslide-like addition to Skyrim, just in respect to breast & butt bounciness :(.

 

Fortunately, there's so much more that can be done with havok like capes, skirts, hairs, etc. :)

 

All of those will probably require customizing though xD.

Link to comment

Does it matter what body are you using? I use ADM (huge ass and thighs, normal breats) and I can't see any difference in motion no matter what I change.

You sure your hdt setup is working? Do you see collision when your character's hands touch the breasts or ass? :)

Link to comment

My observations for a breast hkpGenericConstraintData

 

<hkparam name="data" numelements="20"> <!-- R Breast -->
(0.000000 0.000000 0.000000 0.000000)  <!-- 1 -->
(0.000000 0.000000 2.000000 0.000000)  <!-- 2 -->
(1.000000 0.000000 0.000000 0.000000)  <!-- 4 0 X -->
(0.000000 1.000000 0.000000 0.000000)  <!-- 4 1 Y -->
(0.000000 0.000000 1.000000 0.000000)  <!-- 4 2 Z -->
(1.000000 0.000000 0.000000 0.000000)  <!-- 8 ? -->
(0.000000 1.000000 0.000000 0.000000)  <!-- 8 ? -->
(0.000000 0.000000 1.000000 0.000000)  <!-- 8 ? -->
(1.000000 0.000000 0.000000 0.000000)  <!-- 9 ? -->
(0.000000 1.000000 0.000000 0.000000)  <!-- 9 ? -->
(0.000000 0.000000 1.000000 0.000000)  <!--  6 0 X N,N,0,0 Crushed Breast-->
(-0.500000 0.500000 0.000000 0.000000) <!-- 16 1 Y Up-Down N,N,0,0 IN-OUT -->
(-0.500000 0.500000 0.000000 0.000000) <!-- 16 2 Z Up-Down N,N,0,0 UP-DOWN -->
(0.000000 0.000000 0.000000 0.000000)  <!-- 15 1 Y -->
(1.000000 0.000000 0.000000 0.000000)  <!-- 15 2 Z -->
(-0.500000 0.500000 0.000000 0.000000) <!-- 17 0 X Angular/Horiz. Amount N,N,0,0 UP-DOWN IN-OUT-->
(-0.000000 0.000000 0.000000 0.000000) <!-- 17 1 Y Angular/Horiz. Amount N,N,0,0 NOTHING ?-->
(-0.300000 0.300000 0.000000 0.000000) <!-- 17 2 Z Angular/Horiz. Amount N,N,0,0 SIDEWAYS-->
(2.000000 0.000000 0.000000 0.000000)  <!-- 14 0 X -->
(3.000000 0.000000 0.000000 0.000000)  <!-- 14 2 Z-->
</hkparam>

 

linearDamping and angularDamping for both butt and breast seem to be related to the mass of the object, valid values would be from 0 to any positive number.

Link to comment

Does it matter what body are you using? I use ADM (huge ass and thighs, normal breats) and I can't see any difference in motion no matter what I change.

 

YES! the strength/cleanliness of weight paints is MONUMENTALLY important, as it tells HDT which parts of the body should be jigglified by how much.

As well as the seeded animation give strengths to pull physics data from.

 

Examples: ColdSteel's BBW body uses this to his benefit by ampligying the butt paint to go around the belly as well, so in effect creating the belly jiggle when used with HDT.

 

                 The downside? his body will not be easily future expandable in case modders decide to add more weight paints to the body, as well as unable to be used in pregnancy mods as his mesh has no Belly weights.

 

Another example: Vioxsis developed EXTREMELY clean TBBP weights and merged them with the PSB Belly weight, (now referenced as TPSB weights)

 

The result with HDT can be seen HERE (click spoiler for gif), although further refinement is needed on my own part of the HDT values, you can see that I can replicate ColdSteels belly jiggle WHILE retaining Pregnancy support as well as full TBBP support and let's not forget to mention the weights are extremely clean and can be expanded upon when modders come up with new weight paints and animations for different parts of the body.

 

So my suggestion, if you want less of a hassle go with cleaned body weighting for HDT testing as it is less likely to cause crashes as well as offer better support for future weights.

Link to comment
  • 3 months later...

I'm experimenting around a little but some of the things you mentioned in your post seem to be only changeable in the xml and not by JFF.

 

So my question is: How can I reduce the amount of how much the breasts move (not how fast) I'm using small breasts and they are moving too far downwards. They get stretched, Even if my girl is just walking, her breasts go down way too far and it looks like they were made of much chewing gum. 

 

How can I reduce the distance the breasts travel down?

 

I hope you understand my imperfect english.

 

 

EDIT: Alright... Reducing the weight of the breasts already helped much. But they still get too flat when my girl starts running. I've seen there are some limit values. But when I edited them, the breasts of her started to live. (they started to look to theleft and right! O.o)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 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