osc icon indicating copy to clipboard operation
osc copied to clipboard

Allow Limited Arrays

Open Nifty255 opened this issue 2 years ago • 4 comments

What's the idea? Allow VRChat to receive limited types of arrays, validating to prevent shenanigans where appropriate. For example:

/avatar/parameters/xy/TailWag would auto-inflate to the avatar params TailWagX and TailWagY. /avatar/parameters/n/core would auto-inflate to the avatar params core0, core1, core2, etc. up to a limit.

Is there another way? Currently, to fill my avatar's 8 CPU core params, I have to separately send 8 floats as ...ms/core0, ...ms/core1, so on.

Additional context See below for how I have to loop and separately send each CPU core's floats to my avatar.

Nifty255 avatar Feb 17 '22 23:02 Nifty255

Neat approach! OSC can technically support arrays of any size (and event mixing arg types in the same message) but we need to know the expected argument number and type for our case for performance reasons. I like your solves here, and I'll do some thinking about how we could support this in the config file (and eventually some kind of in-client GUI).

momo-the-monster avatar Feb 18 '22 01:02 momo-the-monster

For /xy/paramPrefix you could safely assume length of 2 and throw/debug log for shorter arrays. For /n/paramPrefix, you could require the very first element be an extra int for the length and similarly throw/debug log.

This'd allow you to be performant with properly formed arrays, and badly formed data would only lag the single affected user. I suppose that could still be a problem if they got the malsending OSC driver from someone else and they can't fix the issue. Perhaps stop processing for that param and fire some sort of notification if possible? That's the best I could think of without knowing the system.

Nifty255 avatar Feb 18 '22 02:02 Nifty255

Personally I'd advice against this or at least in this particular format as Unity internally uses / for sorting an categorizing of parameters. for example if you name your parameter example/sub1/sub2 it will be folderized as example > sub1 > sub2 in the parameter menu. myself and mother others i know frequently use this for sorting purposes. and this could potentially cause some issues depending on the naming used.

an example of this behaviour. Categorized Parameters

brandonvdongen avatar Feb 20 '22 09:02 brandonvdongen

I imagined this: /avatar/parameters/xy/Tail -> TailX and TailY

Rather than this: /avatar/parameters/xy/Tail -> xy/Tail

The OSC system would auto-translate the correct slashes away and simply append caps X and Y to whatever is left.

Nifty255 avatar Feb 22 '22 01:02 Nifty255