Default values reset on first scene load when macro dependency is present

WoodenDragon 4 years ago updated by Lazlo Bonin (Lead Developer) 4 years ago 15
Not sure what I'm doing wrong, but anytime I exit Unity my variables are cleared from all my graphs the next time I reopen the project. (Yes, I'm positive I saved the scene...)
The variables themselves are still present and the values are retained; however, any variables placed in node fields are gone... 

I've removed and recreated the variables and graphs multiple times. It works fine until I exit Unity and reopen the project...

Is this a bug or something dumb I'm doing?

FYI - I upgraded to the latest version of Bolt after I found the issue, but that did not resolve the issue...

Bolt Version:
Unity Version:
Scripting Backend:
.NET Version (API Compatibility Level):

This same thing is happening to me as well.

After more testing it appears the variables are only removed when the following Super Unit is within the Graph

I'm not sure if this applies to any other Super Units in flows or something in particular with this one...

I can test further tomorrow evening, but I gotta get some rest now...

Hi WoodenDragon,

Sorry this is happening. I'm having a hard time reproducing this one.

  1. Do you get any error or warning in the console?
  2. Does it only happen with scene variables?
  3. Does it only happen with "get" units, or "set" as well?
  4. Can you send me the graph data of the graph in which it happens?

If all else fails, can you send me a project with a small graph that isolates the issue?

(Please do not include the Bolt asset in the zip)
  1. Do you get any error or warning in the console?
  2. No errors when closing or opening Unity. The flows obviously doesn't work, so it complains about the missing values upon play, but nothing more than that from what I can tell...

  3. Does it only happen with scene variables?
  4. Haven't really tried different 'Types' of variables, but it did remove the 'Horizontal ' axis from "Input - Get Axis" node

  5. Does it only happen with "get" units, or "set" as well?
  6. "set" variables are removed as well

  7. Can you send me the graph data of the graph in which it happens?
  8. Graph Data Link: Bolt Graph Data

    I just made a simple Flow, which concatenates 3 arguments together on startup. It works just fine and I can shutdown and reopen Unity without the inline values being removed. I then made a new Flow Macro (Super Unit), which is about as basic as it can get. I then add this Super unit to the previous flow. During my current session, it works flawlessly; however, as soon as I restart Unity, these inline values are gone. Something with the Super Units is causing my values to be removed...

Thanks for the follow-up.

The fact that input get axis disappeared as well is very important, it means that it has nothing to do with variables, but rather with default values. 

I'll look into it and see if I can reproduce, but I couldn't before... Any chance you could send a small project where the issue occurs?

I'll see if I can reproduce it in a new project

I was able to reproduce the issue with a blank project.

I have attached 2 scenes and the Super Unit Flow Macro. (Bolt Test Scenes)

  • The first scene has 2 scene variables (Float1 and Float2). The Flow machine simple adds the 2 values together and output the value to the console on startup.
  • The second scene is basically the same, except I introduce the Super Unit to the flow.
    • The Super Unit takes a Float input (iValue) and adds 1 to the input value and then returns the result as a Float (rValue). 
    • In the Flow we're feeding Float1 to the Super Unit, which will add 1 to the variable, then return the result.
    • This result will then carry through to the next Node in the Flow and complete as expected

Upon restarting unity:

  • Scene 1 - Bolt Test Scene (without Super Unit) loads with it's variable intact
  • Scene 2 - Bolt Test Scene 2 (with Super Unit) loads with both of it's inline values removed

Please let me know if you need any other data from the scene or have any questions...

Working on Fix

I've been able to reproduce the issue, but it's very odd and specific.

It happens only if the default loaded scene on restart is the one with the graphs only on the first load of the scene with the super unit.

A quick workaround for now is to manually double-click that same scene to force open it, and the lost values come back.

Rest assured, your values aren't lost, they only seem to get reset after deserialization for some reason...

Starting to get an idea of where it might be coming from, but it's proving hard to debug and might not make it for v.1.0.3. Use the workaround in the mean time.

No worries my friend, just happened to discover it while testing some scenarios and getting accustomed to the work flow. Nothing mission critical.

Keep up the great work Lazlo! 

Fixed in Alpha

Whew, this one was a pain to track down, but I think I got it fixed for v.1.0.3. :)

Sorry for the troubles!

Nice job!