• Hi Guest!

    We are extremely excited to announce the release of our first Beta1.1 and the first release of our Public AddonKit!
    To participate in the Beta, a subscription to the Entertainer or Creator Tier is required. For access to the Public AddonKit you must be a Creator tier member. Once subscribed, download instructions can be found here.

    Click here for information and guides regarding the VaM2 beta. Join our Discord server for more announcements and community discussion about VaM2.
  • Hi Guest!

    VaM2 Resource Categories have now been added to the Hub! For information on posting VaM2 resources and details about VaM2 related changes to our Community Forums, please see our official announcement here.
WindControl++

Plugins + Scripts WindControl++

Download [<1 MB]

wgsoup

Well-known member
Featured Contributor
Joined
Jun 4, 2020
Messages
52
Reactions
501
wgsoup submitted a new resource:

WindControl++ - Plugin to add wind to scenes

New version of my WindControl+ plugin, rewritten from scratch.

The logic was changed in order to apply the wind force to any rigidbody, cloth or hair element in the scene (in theory also clothes on CUA).
For this reason I decided to treat is as a separate plugin.

The drop down lists all the Atoms that have Rigidbodies on them, selecting an Atom makes all the sub elements show on the right side of the menu.
The plugin allows to enable the wind on multiple Atoms at the same time, switching...

Read more about this resource...
 
Hi, great job with the update :)

I recall the old one having an issue with high continuous memory usage, and went ahead an tested WindControl++ as well. It looks like the issue is still there. It consumes about 10 MB/s of heap at 60 fps as soon as the plugin is added to the scene. The higher the fps, the more memory is consumed (indicating the problem is in your Update loop). This results in garbage collection occurring much more often during scene playback and animation, which interrupts the game for a short duration every time it occurs.

I took a quick look and it's entirely due to the expensive FindObjectsOfType<Rigidbody>(); call in your ApplyForceToPenis method. This is not only bad for memory use but performance as well. (I gained about 2-3 fps from commenting out ApplyForceToPenis in an empty scene with 1 person atom.) A much better way to implement this would be to add OnAtomAdded/OnAtomRemoved handlers that update a penis rigidbodies list on demand rather than doing that every frame. Looks like you're already using OnAtomRemoved in the plugin, you can probably figure it out pretty easily, but let me know / DM me if you need help with it. Thanks
 
thank you very much for the feedback, I'll look into that asap
 
Hi, great job with the update :)

I recall the old one having an issue with high continuous memory usage, and went ahead an tested WindControl++ as well. It looks like the issue is still there. It consumes about 10 MB/s of heap at 60 fps as soon as the plugin is added to the scene. The higher the fps, the more memory is consumed (indicating the problem is in your Update loop). This results in garbage collection occurring much more often during scene playback and animation, which interrupts the game for a short duration every time it occurs.

I took a quick look and it's entirely due to the expensive FindObjectsOfType<Rigidbody>(); call in your ApplyForceToPenis method. This is not only bad for memory use but performance as well. (I gained about 2-3 fps from commenting out ApplyForceToPenis in an empty scene with 1 person atom.) A much better way to implement this would be to add OnAtomAdded/OnAtomRemoved handlers that update a penis rigidbodies list on demand rather than doing that every frame. Looks like you're already using OnAtomRemoved in the plugin, you can probably figure it out pretty easily, but let me know / DM me if you need help with it. Thanks
I added the penis rigidbodies to the list of the rest of the rigidbodies, had some issues because those do not have a forcereceiver associated and I was only considering those. Now they all get cached only when necessary and there's additional toggles and sliders. I'll test it more and then publish it. Thank you again for the feedback, I'm no dev but I'm trying to get better and learn :)
 
I see what you mean about the heap usage, my rigidbody update function is really using too much. I've been optimizing the whole script. Hopefully the next update will behave a lot better.
 
wgsoup updated WindControl++ with a new update entry:

Version 1.2

  • - Implements Further performance improvements and memory usage improvements
  • - Fixes bugs preventing proper handling of rigidbodies when an atom is removed or added
  • - Adds wind oscillation function:
    • if enabled currentWindMagnitude oscillates between a random value in the range minWindMagnitude-midWindMagnitude and a random value in the range midWindMagnitude and Wind Strength (maxWindMagnitude)
    • Works only with "randomize currentWindMagnitude" enabled
    • "Wind...

Read the rest of this update entry...
 
wgsoup updated WindControl++ with a new update entry:

Version 1.2

  • Implements Further performance improvements and memory usage improvements
  • Fixes bugs preventing proper handling of rigidbodies when an atom is removed or added
  • Adds wind oscillation function:
    • if enabled currentWindMagnitude oscillates between a random value in the range minWindMagnitude-midWindMagnitude and a random value in the range midWindMagnitude and Wind Strength (maxWindMagnitude)
    • Works only with "randomize currentWindMagnitude" enabled
    • "Wind...

Read the rest of this update entry...
 
Hey Soup, really appreciate how I can now tailor the wind to affect only what I want and how strong for each atom.

Anyhow, I've run into a problem that's causing an exception in VaM and not allowing me to load any scenes once I've loaded the scene I've been working on with Wind++.

Here's the error message. This dumps into the red error log when I try to load another scene after loading mine:


Code:
!> Exception during load System.NullReferenceException: Object reference not set to an instance of an object
  at WgSoup.WindControl.findWindControllerFR () [0x00000] in <filename unknown>:0
  at WgSoup.WindControl.UpdatdeStringChooser () [0x00000] in <filename unknown>:0
  at WgSoup.WindControl.OnAtomRm (.Atom atom) [0x00000] in <filename unknown>:0
  at (wrapper delegate-invoke) SuperController/OnAtomRemoved:invoke_void__this___Atom (Atom)
  at SuperController.RemoveAtom (.Atom atom, Boolean syncList) [0x00000] in <filename unknown>:0
  at SuperController.RemoveNonStartingAtoms () [0x00000] in <filename unknown>:0
  at SuperController.LoadInternal (System.String saveName, Boolean loadMerge, Boolean editMode) [0x00000] in <filename unknown>:0

I've poked through the JSON to see if any of the atoms I'm targeting are still in Windd++ list but maybe removed from my scene, but it all looks clear to me.

I can get this error to go away if I reload the plugin, not looking forward to wiring up the 20+ atoms I had custom set though, but that's what I'll likely have to do.

Anyhow, hope you find this helpful. Unfortunately I can't give you any repro steps, as I've been marathoning on a scene and changing tons of stuff, adding and removing loads of atoms.
 
Hey Soup, really appreciate how I can now tailor the wind to affect only what I want and how strong for each atom.

Anyhow, I've run into a problem that's causing an exception in VaM and not allowing me to load any scenes once I've loaded the scene I've been working on with Wind++.

Here's the error message. This dumps into the red error log when I try to load another scene after loading mine:


Code:
!> Exception during load System.NullReferenceException: Object reference not set to an instance of an object
  at WgSoup.WindControl.findWindControllerFR () [0x00000] in <filename unknown>:0
  at WgSoup.WindControl.UpdatdeStringChooser () [0x00000] in <filename unknown>:0
  at WgSoup.WindControl.OnAtomRm (.Atom atom) [0x00000] in <filename unknown>:0
  at (wrapper delegate-invoke) SuperController/OnAtomRemoved:invoke_void__this___Atom (Atom)
  at SuperController.RemoveAtom (.Atom atom, Boolean syncList) [0x00000] in <filename unknown>:0
  at SuperController.RemoveNonStartingAtoms () [0x00000] in <filename unknown>:0
  at SuperController.LoadInternal (System.String saveName, Boolean loadMerge, Boolean editMode) [0x00000] in <filename unknown>:0

I've poked through the JSON to see if any of the atoms I'm targeting are still in Windd++ list but maybe removed from my scene, but it all looks clear to me.

I can get this error to go away if I reload the plugin, not looking forward to wiring up the 20+ atoms I had custom set though, but that's what I'll likely have to do.

Anyhow, hope you find this helpful. Unfortunately I can't give you any repro steps, as I've been marathoning on a scene and changing tons of stuff, adding and removing loads of atoms.
thank you for the feedback, yes i noticed this behavior too. it's kinda random, seems to happen only if the destroy is called in specific moments. will look into this further asap
 
wgsoup updated WindControl++ with a new update entry:

Version 1.4.1

Includes fix for the issue mentioned in this thread


Read the rest of this update entry...
 
Hey @wgsoup, just a thought, but something to consider adding is support for EZSoftBone colliders, now that rigged CUA hair is much more viable. EZSoftBone uses it's own colliders, and with initial tests it doesn't look like they have all of the same properties as a normal Unity rigid body. EZSB has it's own force components that only affect their own colliders, and after some poking around it looks like it should be possible to scan a CUA to see if there are any EZSB components on something. Anyhow, just a thought, I'm not a plugin maestro, so I have no idea how complicated or fiddly adding this functionality might be.

Regardless, thanks for the awesome plugin!
 
Hey @wgsoup, just a thought, but something to consider adding is support for EZSoftBone colliders, now that rigged CUA hair is much more viable. EZSoftBone uses it's own colliders, and with initial tests it doesn't look like they have all of the same properties as a normal Unity rigid body. EZSB has it's own force components that only affect their own colliders, and after some poking around it looks like it should be possible to scan a CUA to see if there are any EZSB components on something. Anyhow, just a thought, I'm not a plugin maestro, so I have no idea how complicated or fiddly adding this functionality might be.

Regardless, thanks for the awesome plugin!
Thank you for the input. Do you know any CUA that uses EZSoftbone colliders I can use to test?
 
Cool, thanks for considering this. For one, you might need to reference @zgok's guide just to see how EZSoftBone is set up and used, not to make your own CUA hair, but just the component structure:

And then @Skynet has a clothing component that is a plug and play collider for G2F, so that EZSoftBoneColliders can collide with the G2F atom. So here's a link to all of the resources that use his clothing item as a dependency. If they're using it, then that means they have EZSoftBone rigged hair with colliders:

I'm giving you the full dependencies in case you want to check different hair arrangements (long, short, bangs, etc...).
I can't vouch for the quality of anything in that list. I can send you a CUA hair I'm currently working on, or track down a good example tomorrow if you like.

Thanks for looking into this!
 
Last edited:
Cool, thanks for considering this. For one, you might need to reference @zgok's guide just to see how EZSoftBone is set up and used, not to make your own CUA hair, but just the component structure:

And then @Skynet has a clothing component that is a plug and play collider for G2F, so that EZSoftBoneColliders can collide with the G2F atom. So here's a link to all of the resources that use his clothing item as a dependency. If they're using it, then that means they have EZSoftBone rigged hair with colliders:

I'm giving you the full dependencies in case you want to check different hair arrangements (long, short, bangs, etc...).
I can't vouch for the quality of anything in that list. I can send you a CUA hair I'm currently working on, or track down a good example tomorrow if you like.

Thanks for looking into this!
Much appreciated, will have a look when I can.
 

Similar threads

Plugins + Scripts WindControl+
Replies
46
Views
7K
Back
Top Bottom