Tool Unity Virt-a-mate (VAM) Performance Plugin/Patch - Early Alpha release

Playable2030

New Member
May 14, 2024
7
10
Hi,

I recently found VaM (and lots of addons), and noticed my performance dipped dramatically with lots of .var/addon files.
I found some time this weekend to try my handing at modding and improve the performance when there are a large # of addon files, and I think I have enough progress to share and give back.

Note:
I am not a DotNet developer, so there is a high-risk I broke something.
This is a very early release! I tried my best but expect issues.

Download:


Source code (GPLv3):


Installation Instructions:
1. Extract the contents of `VaM_PerformancePlugin.zip` to your Virt-a-mate folder.
2. Start VaM.

I'm interested in hearing if this improves performance (or if there are any issues).
 
Last edited:

Playable2030

New Member
May 14, 2024
7
10
I put up a public GitHub repo that is setup to automatically build new versions -

You can just replace the DLL in the OP.
One of the changes is a bug fix that had some patches disabled by default, so I would recommend using this DLL rather than the one included in the OP.
 

Playable2030

New Member
May 14, 2024
7
10
You should see a log file in your VaM folder under the BepInEx folder, i.e. VaM\BepInEx\LogOutput.log

You should see lines this:
Code:
[Info   :   BepInEx] Loading [VaM_PerformancePlugin 1.0.0]
[Info   :VaM_PerformancePlugin] Plugin VaM_PerformancePlugin is loaded!
You may not see improvements if you don't have a large # of addon packages, (2000+).

I'm still looking at other improvements I can make.
i.e. I see that VaM iterates overall skins/morphs/clothes/etc, so I think I can remove that part of the code via this mod.
 
  • Like
Reactions: Vitalbond

VVSSDV

Newbie
Dec 16, 2022
61
120
It's great to see someone working for the frame rate of VAM. But I tested three scenes and didn't see somthing changes, but I noticed that there seemed a bit higher frame rates with multiple characters, around 3 to 5 frames.I have over 6000 vars in VAM
 
May 19, 2022
128
67
Hi,

I recently found VaM (and lots of addons), and noticed my performance dipped dramatically with lots of .var/addon files.
I found some time this weekend to try my handing at modding and improve the performance when there are a large # of addon files, and I think I have enough progress to share and give back.

Note:
I am not a DotNet developer, so there is a high-risk I broke something.
This is a very early release! I tried my best but expect issues.

Download:


Source code (GPLv3):


Installation Instructions:
1. Extract the contents of `VaM_PerformancePlugin.zip` to your Virt-a-mate folder.
2. Start VaM.

I'm interested in hearing if this improves performance (or if there are any issues).
Bro what do you develop in normally? I don't know how well the plugin works yet but it looks like well written dotnet code so far.

There's a python script on this site for deduplicating assets within vars and also has a bunch of databases for common assets. Might have some useful info for you. There are also some other performance improvement atrempts,some paid,some not

Ultimately it's all kind of futile when we're stuck with unity 2018 but any little improvement helps
 

Playable2030

New Member
May 14, 2024
7
10
Bro what do you develop in normally? I don't know how well the plugin works yet but it looks like well written dotnet code so far.

There's a python script on this site for deduplicating assets within vars and also has a bunch of databases for common assets. Might have some useful info for you. There are also some other performance improvement atrempts,some paid,some not

Ultimately it's all kind of futile when we're stuck with unity 2018 but any little improvement helps

Thanks for the compliment about my code lol, I have lots of experience in a lot of high-level managed languages.

Yep, I saw most of those tools you're referencing I believe.
I made a fork and small fix for one of the tools on this site - https://f95zone.to/threads/varmanager-for-vam-virt-a-mate.96576/post-13831576
I might revisit it and try rewriting it at some point later, but seems like MAUI is the best way to make a desktop app these days in DotNet, so there's a learning curve.

I don't like the idea of performance improvements for bad code, that you are already expected to pay for, being paywalled.
VaM 2 is probably still years away, and I'm not convinced the performance will be better.

I don't have much experience with game dev/modding, but I figure I can give it a try, and should be able to at least make VaM match the performance of a clean/fresh install:
- There is a lot of dynamically compiled Regular Expressions, which should be pre-compiled (or un-rolled into normal "boring" code)
- VaM does iterate over every morph to figure out which ones are "active" and etc, which seems like it could easily be replaced with just storing a list of "active" morphs.
- I believe File I/O performance can be improved by being "lazy". When VaM refreshes all packages and loads, it loads everything into memory synchronously, and could look more responsive if it was asynchronous.
- This is probably a significant amount of work, since it may require 3rd party dependencies and/or re-implementing low-level File I/O
- And probably more I haven't found yet.

I'm working on the File I/O part next, since the loading performance is what personally annoys me most.
Fixing the morph iteration is probably after that, so the in-game UI becomes more responsive.
---
I'll make a post here if I make significant progress, but I'll make GitHub post automated releases for people to try out.

Thank you all who gave this a try so far.
 
Last edited:
May 19, 2022
128
67
I might revisit it and try rewriting it at some point later, but seems like MAUI is the best way to make a desktop app these days in DotNet
what makes you say that? I've been from winforms to wpf to avalonia to winui3 and back to wpf and maui is like the only one I didnt try but I hate all of them I think