Yellow-Dog-Man / Resonite-Issues

Issue repository for Resonite.
https://resonite.com
121 stars 2 forks source link

Regression in order of onsave related execution #2421

Open gentlecolts opened 6 days ago

gentlecolts commented 6 days ago

Describe the bug?

One of my personal protection tools scrambles the names of proxies to prevent abuse via other users manipulating them without my consent. This is on a toggle, and not permanent, however the new names are randomly generated. One feature I was previously relying on is that, on save, my system would un-scramble the slot names, as those original names were necessary to detect proxies in the first place.

I don't know exactly when it started, but resonite no longer executes in the same order, and while the system will correctly un-scramble names on save, the scrambled names are what gets saved

To Reproduce

Stated above, but I can demonstrate this ingame if needed. The tool is in my public folder as well

Expected behavior

Resonite should evaluate slot names/states AFTER all save events have been processed

Screenshots

No response

Resonite Version Number

Beta 2024.6.25.1149

What Platforms does this occur on?

Windows, Linux

What headset if any do you use?

No response

Log Files

n/a

Additional Context

No response

Reporters

zangooseoo

gentlecolts commented 6 days ago

For clarity, I am not reporting about a bug in my system, we do not need to discuss that and I'm considering revisions to it already to work around this. This ticket is specifically about the seeming change in event execution order

shiftyscales commented 6 days ago

Please include a sample node graph that exhibits the issue you are highlighting, and attach it as a ResonitePackage, or link to the object / a public folder containing that object, or in a world containing that object.

Please also include supplemental material (screenshots / log files) that visualize the expected vs actual results.

gentlecolts commented 6 days ago

Pasting it doesn't really do anything so I'm not sure if this is right but (looks like it spawns out at a specific spot in world when pasted like this regardless of where i'm positioned, weird) hitting copy url on the tool in question gives me the following: resrec:///U-zangooseoo/R-50fbfcbd-0570-450b-b102-018ff324990e

If that does not work, my public folder is at resrec:///U-zangooseoo/R-bd44fba0-395f-4c88-b8bf-bf3545b22690 and it can be found at the root, labeled as "Anti-Parent by zangooseoo"

intended use:

  1. spawn the object
  2. select object, parent it under an avatar somewhere
  3. equip avatar save avatar and re-load it
  4. you will now have a menu labeled "Anti-Parent", one of the options is "Rename Proxies"

This all seems to work for me, as it has for years, but the problems now arise when saving the avatar: If rename proxies is enabled, it will not do so on the saved version, any references it was keeping to the proxy slots will break, and the feature will be broken on both the newly saved version (with proxies stuck having scrambled names) and your currently equipped version (with now unscrambled names). If the avatar is saved with rename proxies disabled, functionality will not break.

This was not previously an issue, and I've made no changes to the tool, though I don't know how long this behavior has been broken

mpmxyz commented 6 days ago

I got a bit curious about this but this project is quite complex. I.e. as an outsider it is hard to reason about what is supposed to happen because it has many independent impulse triggering nodes. Were you relying on the order of multiple On Loaded/On Saved firing? That order may be unspecified. Or is it? Which chain of events happenes vs. what is supposed to happen? I know from experience that it is much easier to find an issue with good directions.

gentlecolts commented 6 days ago

Were you relying on the order of multiple On Loaded/On Saved firing

No, I am relying on the state of a hierarchy, when saved, to be evaluated after any onsaved events have fired and any changes therein have taken effect. This behavior changed at some point and may have implications beyond the scope of this one item.

The structure/design of my project itself, as stated, is not what the point of this ticket, and I would like to avoid turning this ticket into a discussion of it. If you are curious about what I am doing, all of the relevant behavior exists under the "proxy shuffler" slot, and most of the node count there is just hacking around the current lack of arrays.

mpmxyz commented 5 days ago

You missed my point but I also wasn't good at getting it across: I'm only interested in the root problem and not at the project at all. Unfortunately the project is very big and I couldn't replicate the issues using the given instructions. There are ways to improve the likelyhood of others understanding the issue:

Without proper ways to replicate the issue one can only guess. I did some digging:

Here is a minimalistic example I built when I read the part "Expected Behaviour":

gentlecolts commented 5 days ago

It's been a while since I worked on this, definitely forgot some of the quirks of it, but yeah: a) it doesn't first take effect until loaded, and b) i never re-shuffle after saving, looking again those are both correct, something to fix later.

This block of code, however, should be all that's relevant to this issue: image

Little surprised your example didn't replicate the issue I'm seeing, perhaps it's something specific to the "save avatar" button?

mpmxyz commented 5 days ago

resrec:///U-TheAutopilot/R-bd03c314-9e2c-4132-b882-b6b0e575bcfc is an avatar with the button. That worked. Can I meet you within Resonite so we can boil down the cause of this behaviour? (I'll contact you.) grafik

gentlecolts commented 4 days ago

Sorry for the delay, busy weekend, and on that note I'm not really sure what my online availability is, and I'm not sure what I can contribute for reproduction/troubleshooting other than what's been posted so far, but I'm typically on in the evenings (USA eastern) most days, and my username is in the OP for this ticket