0
Cannot Reproduce

Units added with the unit options wizard disappear from the list on Unity Restart

Benjamin Mark 2 years ago updated by Lazlo Bonin (Lead Developer) 2 years ago 6

Whenever I add a custom class to the unit options wizard and then restart Unity, it will disappear from the unit options list, and give me the following warning:


Sometimes it will also give me the following error, but that seems somewhat inconsistent and doesn't show up every time.


It seems like the actual unit itself is working. I can add it to a flow machine with no troubles, even if it doesn't show up in the list. It is, however, somewhat problematic that I can't remove classes and can't see what classes I have added.

I am currently using unity 2018.1 with .net 4.x and the newest version of bolt.


Edit:

Another thing that I have noticed is because the custom classes doesn't show up in the list, if you generate unit options again, you are effectively removing any of those custom classes you have added beforehand. This requires you to constantly remember which things you have added and re-add them every time if you want to add them to a new flow machine.



Bolt Version:
Unity Version:
Platform(s):
Scripting Backend:
.NET Version (API Compatibility Level):
Pending Review

Hi Benjamin, sorry you're having this issue.

I haven't seen that dictionary asset warning, but it is possible that I have just missed it.

I am, however, 100% sure that those scripts exist. I can reproduce this every time simply by adding any custom script with the wizard, and then immediately restarting unity without doing anything else.

Cannot Reproduce

Hi Benjamin,

I tried reproducing the issue by creating this class in my project:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace LunaSea
{
    public class CountdownTimer
    {
        // Use this for initialization
        void Start()
        {
        }
        // Update is called once per frame
        void Update()
        {
        }
    }
}

Then adding it to the unit options wizard:


And generating.

I then restarted Unity, and I don't get any warning, and the class is available in the fuzzy finder:


Can you create a minimal project that reproduces the issue?

Or a set of clear steps from a blank project with Bolt in it to recreate it?

I have managed to reproduce this in a completely blank project, which I have uploaded here: BoltTest.7z

This project is in the broken state. I added the TestScript class to the unit options wizard, built unit options and then restarted unity. This gives me to serialization error, and TestScript is gone from the unit options wizard.

Do note, however, that TestScript is still showing in the fuzzy finder and works fine even though it is not showing up in the unit options wizard. It will break once you rebuild unit options unless you re-add it to the wizard, as it is not part of the list anymore.


An interesting sidenote is that I actually ran into the variableAsset/DictionaryAsset bug that you mentioned above. It actually completely broke bolt for me, as I couldn't add machines to gameobjects when it occured. The interesting part is that it only happened for me when I imported the .net 4 version of bolt in a project that was set to .net 3.5 and then afterwards switched to .net 4. Importing it directly to a .net 4 project works fine apart from the deserialization error.


I have an update to this. It seems like this might have been a problem with the specific version of unity I was on. I just updated our project to unity version 2018.2.4f1, and it seems to have fixed that specific problem. I seem to sometimes have the "unable to load dictionary/variable asset" bug that was mentioned above.

Hi Benjamin! Glad you got it resolved somehow.

The good news is that I finally got a response from a Unity engineer regarding the loading issue, so I'm closer to finding a reliable fix soon. Fingers crossed!