• Hi Guest!

    We are extremely excited to announce the release of our first Beta for VaM2, the next generation of Virt-A-Mate which is currently in development.
    To participate in the Beta, a subscription to the Entertainer or Creator Tier is required. 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.
WindControl++

Plugins + Scripts WindControl++

wgsoup

Well-known member
Featured Contributor
Joined
Jun 4, 2020
Messages
48
Reactions
487
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...
 

Similar threads

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