Page 1 of 1

Plugins-Folder

Posted: 03 Jan 2018, 06:05
by Scherub
Hi,

now that I have had a bit of spare time to continue my project, I was looking at the directory structure of my project as the compile time keeps increasing. After I've moved most of my 'library' stuff under the "Plugins"-folder I realized that the (new) directory structure of the latest NoesisGUI version also utilizes a "Plugins"-folder.

According to this manual page there can only be one Plugins-folder and that has to be placed directly in the project root. Unfortunately the NoesisGUI scripts are in its own Plugins-folder so they are handled as normal scripts. After building the project and looking at the built assemblies I can confirm, that the Noesis-scripts are not in the firstpass assembly.

Would it be possible to move your scripts to the proper Plugins folder?


I wish also you guys and everyone else around here a happy and successful new year!


Edit: After moving your script folders to the proper Plugins folder I figured that it would probably theoretically work. Unfortunately you have lots of hard coded references to the new location in your editor scripts, which I would have to change manually. I've seen other addons that would allow you to define the script location. That would be a very nice way to handle this problem.

Re: Plugins-Folder

Posted: 09 Jan 2018, 20:30
by jsantos
Hi Scherub! Glad to see you here again : D

Yes, our Plugins folder is not a standard Unity plugins folder. We think that having all NoesisGUI stuff inside one single folder is better than having two (as we had in previous versions). In fact many of our customers are already precompiling NoesisGUI to a separate dll so I am not sure if there would be any real advantage with moving back to a /Plugins/ directory at the root folder. What do you think?

Re: Plugins-Folder

Posted: 10 Jan 2018, 04:44
by nokola
+1 for keeping Noesis in a single folder - much easier to version and update. Sometimes we also have custom fixes that we apply before next version includes them, again easier to diff and remember with one folder.

Also, Unity 2017.3.0 allows to specify how assemblies are handled - you can separate your project in multiple assemblies now to speed up compiled time. I'm planning to try it with Noesis and other parts of our project soon. Haven't yet. https://unity3d.com/unity/whats-new/unity-2017.3.0 "Editor: Added assembly definition files for script compilation pipeline in the editor. This allows you to define your own managed assemblies based on scripts inside a folder. Splitting your project's scripts into multiple assemblies can greatly reduce script compilation times in the Editor. Note that the latest version of Visual Studio Tools for Unity is required for this feature to work with solution and project generation for Visual Studio."

Re: Plugins-Folder

Posted: 10 Jan 2018, 23:35
by Scherub
Thank you for your replies!

Today I've updated to Unity v2017.3 and used the new assembly definition files to improve the build time dramatically. Well, I had to make a few changes here and there, but everything works now. So thanks for the hint, again.

Re: Plugins-Folder

Posted: 11 Jan 2018, 01:01
by jsantos
So you did it without modifying Noesis?

Re: Plugins-Folder

Posted: 11 Jan 2018, 04:29
by nokola
I'm also curious - did you add assembly definition files to all folders or just to the Noesis one?

Re: Plugins-Folder

Posted: 11 Jan 2018, 09:47
by Scherub
I didn't change anything in NoesisGUI. I just added there and at several other places various Assembly Definition Files. I've attached a quick and dirty diagram that shows how the 'assemblies' within Unity are currently structured.
LifeSim - Assembly Definition Diagram.jpg
Unfortunately I had to resolve a few problems:

1. ApexAI cannot instantiate the AI anymore so all my characters aren't doing that much apart from manually assigned jobs. I think it's because it cannot find the AI GUIDs anymore, so it could be solved by placing the 'Name Map' in its own assembly . But it doesn't matter as I was going to replace the whole AI system by my own BehaviourTrees which are defined in XML, as this allows me (and others) to modify the game AI much easier.

2. I have a GuiBehaviour in 'Proton' which initializes the GUI and which I also use for querying things like IsMouseOverGui from the game logic. I had to assign a RootViewModel (derived from BaseRootViewModel) to this Behaviour, but unfortunately the RootViewModel resided in LifeSim.GUI, which has 'Proton' as a dependency. This lead to the problem that the GuiBehaviour couldn't find and instantiate the RootViewModel. I solved this by moving the RootViewModel to Proton as most things that it previously did aren't necessary anymore.

When I upgraded to the latest NoesisGUI version I had to change a lot of things. That was when I introduced regions which I can use to display my other Views. I also added a way to automatically register all my Views and ViewModels. So now my RootViewModel basically provides just one region.

3. Many of my components discover and register their required classes automatically, usually searching a provided assembly and looking either for derived classes or certain attributes. Since it is not just one big assembly anymore, I also had to change the way I was providing the assembly. Right now it's still not the optimal solution, but it works for now and I'll change it in the future.

Re: Plugins-Folder

Posted: 12 Jan 2018, 06:07
by nokola
Thanks, this helps estimate my costs for multiple assemblies too. I appreciate it.

Re: Plugins-Folder

Posted: 15 Jan 2018, 16:23
by jsantos
I didn't change anything in NoesisGUI. I just added there and at several other places various Assembly Definition Files. I've attached a quick and dirty diagram that shows how the 'assemblies' within Unity are currently structured.
Thanks for all the details!!