Jump to content

Tweaking the HDT-SMP config to properly utilize OpenCL for big gains in performance and accuracy


Recommended Posts

This is my default configs.xml for HDT-SMP SSE 

<?xml version="1.0" encoding="utf-8"?>

<configs>
    <smp>
        <logLevel>3</logLevel>
        <!-- enableNPCFaceParts: enable physics for NPC face parts -->
        <enableNPCFaceParts>true</enableNPCFaceParts>
        <!-- clampRotations: when turning a large angle, clamp rotation speed, so your character rotates slowly instead of instantly -->
        <clampRotations>true</clampRotations>
        <!-- unclampedResets: when unclamped, if you do a large turn (full 180 for example) SMP will attempt to apply physics
                              for that enormous turn. setting this to true will instead trigger a physics reset on the actor
                      if the turn is large enough. you can try setting this false and deciding if you're OK with the 
                      results -->
        <unclampedResets>true</unclampedResets>
        <!-- unclampedResetAngle: angle to reset at. you'll probably want to tweak this until you're happy. -->
        <unclampedResetAngle>130.0</unclampedResetAngle>
    </smp>
    <solver>
        <numIterations>16</numIterations>
        <groupIterations>16</groupIterations>
        <groupEnableMLCP>false</groupEnableMLCP>
        <erp>0.2</erp>
        <min-fps>60</min-fps>
    </solver>
</configs>

It looked nothing like yours, I don't see OpenCL anywhere.

Link to comment
  • 1 month later...

Thanks to this thread, I realized that in building my own DLL from https://github.com/Karonar1/hdtSMP64 (or even just using the pre-compiled dll from the releases) I had neglected to also deploy the default SKSE/Plugins/hdtSkinnedMeshConfigs/configs.xml, which meant I was using the hardcoded defaults in the dll, instead of the defaults in the config file.

 

The hardcoded defaults are:

MaxIterations = 2 (aka groupIterations)
m_numIterations = 10 (from bullet3 b3ContactSolverInfo)
EnableMLCP = true
m_erp = 0.2 (from bullet3 btContactSolverInfo)
m_timeTick = 1 / 60.f

Re-adding the configs.xml and tweaking the values a bit has dramatically improved the stability and accuracy of the physics in my game (compared to the DLL defaults), and seems to have fixed the issues I was having with occasional crash/freeze on game load.

Increasing the ERP and iterations also seems to reduce many obvious errors, like hdt hair clipping through shoulders/breasts, and hands clipping through breasts.

FWIW, I also compiled my own DDL from the latest changes on master that aren't in the release DLL, and that allowed me to enable AVX, which I think has improved performance as well (since my machine supports it).
Link to comment
  • 1 month later...
On 8/31/2021 at 4:18 PM, hornykarl said:

Re-adding the configs.xml and tweaking the values a bit has dramatically improved the stability and accuracy of the physics in my game (compared to the DLL defaults), and seems to have fixed the issues I was having with occasional crash/freeze on game load.

Increasing the ERP and iterations also seems to reduce many obvious errors, like hdt hair clipping through shoulders/breasts, and hands clipping through breasts.

FWIW, I also compiled my own DDL from the latest changes on master that aren't in the release DLL, and that allowed me to enable AVX, which I think has improved performance as well (since my machine supports it).

I often serch google then check your github page, at same time I really hope if you could offer test compile version.. (or if I miss page?)

I already have visual studio. but I actually do not have clear knowledge about compile (only use python or sometimes use batch for blender to compile git)

then test to your custom version,, to compile is not easy for me....  

 

At same time I notice most of CTD when load game, or move cell CTD usually caused  by HDT smp (and maybe some setting file which clothing or hair or creature mod added)  then sometimes, I de-activate HDT , and load game,,, after that usually I can load the data without CTD, (and usually when CTD happend by HDT-smp)

I got nttdl.dll error in net framework log.. (so if I see it in log, I usually think it caused by HDT-smp ) then hope to try setting or other custom branch ...

So you mentioned,, about occasional freeze or ctd on game load, and your version + the setting seems solve your issue,, I hope to test your compile version ^^; 

===
OK I am foolish enough, I do not notice the release tag. (there are compile dll).  I  now download AVX pre release version.. thanks..

btw  if CPU  compatible with AVX,, which version you recommend.?   No avx version only for non AVX support CPU? or if  it may work better than AVX version?

 

https://github.com/Karonar1/hdtSMP64/releases

 

Edited by greenmango12
Link to comment

@greenmango12 It's not my code. I just compiled Karonar1's code for my local machine, because I wanted to see if any of the changes on the master branch would help my problems.

 

The v0.1-alpha build with AVX is from from March 2021.

The v0.2-alpha build without AVX is from May 2021.

 

v0.2 looks like it has a change for vertex and triangle shape calculations, but I can't figure out why or what it does.

And then it also has change to disable AVX (which is usually just a compile option change).

 

So recompiling HEAD of master with AVX on didn't really help. I recommend just using one of the pre-compiled versions, depending on whether you computer supports AVX.

Link to comment
  • 2 months later...
On 4/6/2021 at 12:24 AM, JohnSmith54 said:

For other who will google it.

Bad news for us. Bullet3 runs 100% on CPU.

 

I built Bullet3 myself - all demos don't use GPU (I have AMD with Open Cl support)

 

Also can add some thoughts why HDT SMP physics in Skyrim mods so slow.

- Mods uses per polygon calculations - its insane idea. Game engines use capsules for all collisions and its lightweight and fast.

- Also Bullets3 seems not very targeted to game usage, they developing precision simulation for robots sponsored by Google, GPU support was sponsored by AMD and was stopped in 2015 (6 years ago!)

 

You can compare how fast runs optimized modern PhysX in Unreal Engine vs Bullet3 demos. 

Maybe I'm wrong, but running CPU based physics in 2021 its failed idea, by default.

 

 


CPU is preferred IMO. HDT-SMP is not slow for me at all, and Im still using my old 980ti lol... im not paying the insane prices, but I do have a new AMD CPU & the rest of my system is new.

 

Its recommended to use simplified proxy meshes for SMP, not the visible high poly meshes, also you can do per tri, or per vertex, depending on need.  Skyrim avatars do have capsules and other physics built in, what we're doing with SMP is for realistic collisions & movements far beyond vanilla, and no the game engine & its havok are not up to that task to the degree SMP is able, even if it were, havok has restrictive license, and havok in skyrim is really quite old comparatively.

 

There are many branches of HDT-SMP available, but generally for Skyrim I would recommend Faster HDT-SMP (link below), as it uses the latest greatest performance enhancements from various branches, from what I gather there are more improvements in the works there, and elsewhere.

https://www.nexusmods.com/skyrimspecialedition/mods/57339

 

Just adding this link here in case anyone finds themselves on this old thread, grab the version above, various versions of the source code is linked & described there as well, for those who want to tinker.

Edited by infiniteone
Link to comment
  • 1 month later...
  • 1 month later...

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