KeldorKatarn
Topic Author
Posts: 193
Joined: 30 May 2014, 10:26

Question about workflow

26 Jan 2017, 03:27

A year after first experimenting with this wonderful project I've come back to bring myself up to date again.
One thing I wanted to ask is, what is the current best workflow for creating a GUI in Unity?
I do not mean the Component added to camera etc., rather I mean the tool setup.
Is the ideal way to create a second VS solution that just contains the WPF Project which has the XAMLs and make sure those are put in the Unity project's asset folder?
Where do most users put that solution? In a separate folder? Inside the Unity project folder next to the Unity script solution?
Also is it still the case that we have to create XAML files in Blend/VisualStudio and then manually delete every code behind file and the class reference in the XAML file or can XAML files now be created in a different way, like in the Unity Editor and then included in the Blend Solution?

I'm just looking for answers by the team and also people who have been working with this now for a while in production environments and have found a best practices kind of workflow and tool chain on how and where to create the GUI assets.

Also if you guys do create a separate solution for this, do you also create fake test ViewModels in that solution which remain outside the Unity ASsets folder, which is used to test the UI in a normal WPF WIndows Application just to make sure the UI part works aside from the actual game?

And finally there was an interest by the creator of Caliburn.Micro to extend that framework to also work with Noesis GUI. Did that go anywhere?

Thank you
 
User avatar
ai_enabled
Posts: 231
Joined: 18 Jul 2013, 05:28
Contact:

Re: Question about workflow

26 Jan 2017, 14:11

Hi,
We're making a second big game on NoesisGUI. With the first game we had the approach as described in your post - a separate WPF project which could be launched independently, but its XAML files were automatically copied into the Unity project. We had to duplicate according C# files. So practically WPF project contained just a shim classes.
We are able to edit WPF project in VS2015 and Blend with designer support and it works quite good. However the code duplication sometimes was quite high as we really tried to implement many things in WPF - mostly in prototyping reasons to ensure how the controls should work without NoesisGUI (it also helped to locate issues in NoesisGUI, but I need to say that now this is a not an important factor as there are much less issues in NoesisGUI (thanks to us?! :D )).

With the second project we choose a completely different workflow - perhaps extreme - all the gameplay-related code (C#) including UI XAML is compiled by the game itself. We could edit all that stuff in Visual Studio as regular WPF project (but cannot run it as a WPF application, so only XAML Designer works but that's enough for our needs), and the game will compile it with Roslyn compiler by using NoesisGUI Managed DLL instead of WPF. So far it works perfect for us and opens UI (and everything gameplay-related!) for modding. And we absolutely don't have any code duplication now (but we need to very accurately use constants like IsDesignMode to determine if we're in the XAML Designer or this is actual game).

For us both workflows works good, but the second workflow also allows us to dynamically reload the game code and UI, improving our productivity and allowing higher degree of modding. But it's much more complicated to properly setup.

Regards!
AtomicTorch Studio Pte. Ltd. http://atomictorch.com
 
User avatar
sfernandez
Site Admin
Posts: 2984
Joined: 22 Dec 2011, 19:20

Re: Question about workflow

26 Jan 2017, 17:26

You can take a look at how we organized our samples:
https://github.com/Noesis/Tutorials/tree/master/Samples

Basically we create the folder structure and add all new files in Blend. The folder layout should be something like:
  BlendProject/
    - Assset/
      -  ... all your resources (cs, xaml, images, fonts) here
    - BlendProject.csproj
You will need to use #if/#endif in cs files to discard .NET code that won't work in Noesis/Unity. For example:
#if UNITY_5
using Noesis;
#else
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Input;
#endif

namespace BlendProject
{
  public class TestPanel: Grid
  {
    // ...
  }
}
 
 
KeldorKatarn
Topic Author
Posts: 193
Joined: 30 May 2014, 10:26

Re: Question about workflow

26 Jan 2017, 18:27

So you integrated the roslyn compiler into your game?
 
User avatar
ai_enabled
Posts: 231
Joined: 18 Jul 2013, 05:28
Contact:

Re: Question about workflow

26 Jan 2017, 19:03

So you integrated the roslyn compiler into your game?
Yes, we did it. We wrote our custom game engine. There are some info. So the game comes "half-baked" - it quickly compile all the required assets directly from the source files. It's not only very friendly for modding, it opens opportunity to making total conversions of the game, with completely different gameplay code, assets, UI... and it provide live reloading of all that stuff, live debugging. Also I didn't mentioned this is a multiplayer game - so everything is even more extreme as modding will be completely unlimited. You may connect to a new server, download the required mod installed on the server (after approve of course) - and whoa you play a completely different game, perhaps with a completely new UI. The closed alpha test just finished and everything works very solid (thought we didn't tested modding yet but other mentioned stuff works fine).

So, that's possible, but required a great effort to do properly, and it's not possible with Unity (perhaps with latest beta version supporting .NET 4.5 profile it's possible but I didn't tried)... If you need something quick to start, sfernandez recommendations are great.

Regards!
AtomicTorch Studio Pte. Ltd. http://atomictorch.com
 
KeldorKatarn
Topic Author
Posts: 193
Joined: 30 May 2014, 10:26

Re: Question about workflow

26 Jan 2017, 19:24

Still, very interesting :) I'm glad to see Roslyn being put to good use in the gaming world :)
 
kguner
Posts: 17
Joined: 07 Apr 2015, 18:38
Contact:

Re: Question about workflow

26 Jan 2017, 21:44

It is possible to use the Roslyn Compiler with Unity. You won't be able to use newer CLR features, but you get access to newer Language features.
 
User avatar
ai_enabled
Posts: 231
Joined: 18 Jul 2013, 05:28
Contact:

Re: Question about workflow

27 Jan 2017, 07:34

kguner, yes I know, but that's nothing as most serious developers already doing this for a long time by separating their Unity Project on separate C# projects compiled outside of Unity...
I'm talking about including Roslyn into the game - and using all the new CLR features such as async-await support. So we can dynamically recompile the most important part of the game - gameplay code, UI, etc. We've moved as much as possible code into that dynamically recompilable part.
AtomicTorch Studio Pte. Ltd. http://atomictorch.com
 
User avatar
jsantos
Site Admin
Posts: 3906
Joined: 20 Jan 2012, 17:18
Contact:

Re: Question about workflow

28 Jan 2017, 00:23

And finally there was an interest by the creator of Caliburn.Micro to extend that framework to also work with Noesis GUI. Did that go anywhere?
Not for now and probably will never. The author expressed interest about it with the idea of selling it in the Unity Asset Store. But I think the numbers were not very appealing. I would say very few authors are really making money in Unity to sustain the development.
 
User avatar
jsantos
Site Admin
Posts: 3906
Joined: 20 Jan 2012, 17:18
Contact:

Re: Question about workflow

28 Jan 2017, 00:25

(it also helped to locate issues in NoesisGUI, but I need to say that now this is a not an important factor as there are much less issues in NoesisGUI (thanks to us?! :D )).
Definitely! And this is going to improve more and more with each version.

Who is online

Users browsing this forum: Bing [Bot] and 11 guests