Interesting, I'll take a look at the Surge source, they're a clever bunch. If you have a moment - I'd like to understand this use-case more. What do you mean multi room studio? Does a per-user installation help, vs an all-users installation?
Historically, early VST plug-ins were fully portable. They were rarely communicating with the underlying file system and were leaving all state management to the host. This made a DAW and a VST library a single unit which could run from anywhere, including network attached shared drives. So, in a multi room studio of yesteryear or in a distributed band studio of modern times, only one setup was needed for all of the nodes. A studio engineer would prepare a DAW+VST directory, share it via network, and all studios would have exactly the same setup with exactly the same plug-ins, with exactly the same configuration without having to repeat the whole setup N times. Therefore, a musician/producer/engineer could work in any studio room without limitations or distractions. The leader in this field is Cockos Reaper which supports fully portable operation, plus full relative path expansion everywhere. In my experience, there are about ~3000 VST2/VST3/CLAP plug-ins in existence, running flawlessly for decades now. So, by saving the plug-in state to operating system's semi-hardcoded directories, your plugin stays non-portable, and instead of being a full part of the DAW setup, becomes an unmanageable mess that nobody wants to deal with.
Interesting! Thank you for the explanation. I wonder what file permission issues we might face trying to write adjacent to the plugin file. I'll see what Surge does.
Sure. Just make sure to bubble the error up to the UI and no problemo. Recent portable software even includes a toggle in settings to dynamically let users decide which state store to use, like, for example, the excellent LinkLever.