Page 1 of 2

Monogame Noesis GUI 2.0 integration

Posted: 06 Apr 2017, 16:07
by Ziriax
I updated my AIEnabled fork to work with Noesis GUI 2.0, see https://github.com/Ziriax/NoesisGUI.MonoGameWrapper.

It still included the on-the-fly XAML reloading. My C# hot code reloading works for WPF, but I didn't find the time yet to try it out with Noesis 2.0, to be continued.

NOTE: I noticed a strange rendering problem, when opening the comboboxes, the screen flashes. I'm not sure what I'm doing wrong.

Re: Monogame Noesis GUI 2.0 integration

Posted: 06 Apr 2017, 19:45
by jsantos
NOTE: I noticed a strange rendering problem, when opening the comboboxes, the screen flashes. I'm not sure what I'm doing wrong.
Probably related to offscreen rendering. Are you restoring the render target and viewport dimensions after rendering that phase?

Re: Monogame Noesis GUI 2.0 integration

Posted: 06 Apr 2017, 20:07
by Ziriax
Ah, I recall that I simplified the PreRender and PostRender steps into a single render call. But indeed that must have broken something. I'll revise. Thanks!

Re: Monogame Noesis GUI 2.0 integration

Posted: 07 Apr 2017, 05:20
by ai_enabled
In my code (updated to support NoesisGUI 2.0) it works properly. I call these methods separately, before MonoGame application draw and after that.
I will cleanup the codebase and push it on Github soon. There are a lot of changes.

Re: Monogame Noesis GUI 2.0 integration

Posted: 07 Apr 2017, 12:12
by Ziriax
Yes I reverted my code to do the same as yours again, now it works, I pushed it.

I still have troubles getting all text input working correctly. I had to do a lot of hacks. For example, when pressing ENTER the first time, Noesis does not seem to perform a linefeed in its textbox, only a CR.

Looking forward to your changes! Do you think that with the new Noesis features (allowing shutdown and initialize more than once) hot code reloading with Roslyn will work? I have it working for WPF development, and it really boosts my productivity (although I still have the nasty habit to press SHIFT+F5 to kill my application when debugging!). It does have limitations, but I don't mind trading this for higher productivity.

Re: Monogame Noesis GUI 2.0 integration

Posted: 07 Apr 2017, 12:31
by ai_enabled
I still have troubles getting all text input working correctly. I had to do a lot of hacks. For example, when pressing ENTER the first time, Noesis does not seem to perform a linefeed in its textbox, only a CR.
Good news - I've nailed this bug. Also key-repeat works properly. Thought acquiring the key delay and key repeat intervals from OS are implemented only for Windows now.
Looking forward to your changes! Do you think that with the new Noesis features (allowing shutdown and initialize more than once) hot code reloading with Roslyn will work?
NoesisGUI shutdown (GUI.UnregisterNativeTypes() method) now works properly and we're using it very actively in our game engine, thought there are still random memory access violation crashes - but much less than our previous approach (with true NoesisGUI Shutdown and complete re-initialization) and we're not sure if this is related to reloading or simply random bugs (all reported to the bugtracker).

Re: Monogame Noesis GUI 2.0 integration

Posted: 07 Apr 2017, 12:41
by Ziriax
Nice!

Off topic, but may I ask you why you are using Monogame instead of Unity for your project?

In my case it's because

(1) Monogame is open source and I'm a control freak ;-)
(2) My app is mostly about generating 2D content and doing realtime CSG, and Unity doesn't really provide any benefits here.
(3) A lot of APIs in Unity feel a bit "hacky"

Re: Monogame Noesis GUI 2.0 integration

Posted: 07 Apr 2017, 13:40
by ai_enabled
(1) Monogame is open source and I'm a control freak ;-)
(2) My app is mostly about generating 2D content and doing realtime CSG, and Unity doesn't really provide any benefits here.
(3) A lot of APIs in Unity feel a bit "hacky"
The same points plus:
(4) We need .NET 4.6.1 and Roslyn (in runtime - as our game is highly moddable).
(5) We got really frustrated by Unity QA - so many engine bugs during about a year... One bug fixed, few new bugs were introduced every build. Unity 5.1-5.3 is a mess so big that they've announced a "bug squashing" initiative in the official blog and delayed future releases...
(6) Some features were not available in Unity and they're not easy to implement (require native C++ plugins, while they could be developed with MonoGame on C# with less effort and much better quality).
(7) We don't need most of Unity stuff. We definitely didn't want to use Unity Editor as it will limit the modding capabilities of our game and also it's very slow (1 minute recompilation of our previous game when any of the C# files changes - and that's on a very fast PC with i7 and PCI-e SSD drive).

If we needed to develop a 3D game we would use Xenko. But for a 2D game MonoGame is fine.

Re: Monogame Noesis GUI 2.0 integration

Posted: 07 Apr 2017, 14:52
by Ziriax
Thanks a lot for all these points! I have to justify to the investors why I picked Monogame and Noesis, and this really helps. I just followed my gut feeling. And although I worked 25 years in the game and graphics field, people prefer to read hard facts ;-)

I already dropped HTML5 as a platform, after 3 frustrating years creating a photo product editor for smartphoto. You cannot believe the bugs we encountered. At one time I made a complete renderer using SVG, just to find out that many browser versions and drivers had render bugs, sometimes even crashing the browser. So we switched to canvas rendering, and even then browser updates sometimes broke stuff. I even struggled with an insane Chrome V8 JIT bug that randomly turned a trivially true expression to false... I reported this on Reddit here https://www.reddit.com/r/javascript/com ... his_crazy/

Regarding 3D, would you prefer Xenko over Unreal? I looked at this engine formerly known as Paradox in the past, but it was far from ready.

Re: Monogame Noesis GUI 2.0 integration

Posted: 07 Apr 2017, 17:38
by ai_enabled
I've pushed 2.0 update https://github.com/aienabled/NoesisGUI. ... b2ba2caa27 please read the commit comment.
I know you've done a lot of changes in your repository so merge might not be an option... but it might be a good idea to replace all your input processing code with the input code from my repo. It works flawlessly for us and was tested in the game closed alpha version with positive feedback from our players.
Regarding 3D, would you prefer Xenko over Unreal? I looked at this engine formerly known as Paradox in the past, but it was far from ready.
I think for now it's the only decent 3D game engine with C# scripting and it's developing really quickly and professionally (cannot say the same about Unity, alas!). And this engine written completely in C#, with open source license. So if we decided to write a 3D game we would choose it... If you know C# perfectly well, need to make a fairly simple looking 3D game with complex mechanics and looking for a decent engine - Xenko is good enough. In almost the same way as MonoGame good enough for 2D games. Every tool has its own scope, we just need to select what suits well to our ideas and budget.
It's clear that UE4 is best engine for AAA games and I hope UE4 will eventually receive proper C# support. But it requires a much bigger budget to produce high quality 3D assets to really get all the power from the engine. If we cannot afford great 3D assets it doesn't matter if UE4 has the best renderer or great Blueprint visual scripting system. It might be good for some simple games built completely on blueprints, but I'm very skeptical about the market niche for such games now - the market is already oversaturated with simple games, with similar gameplay and features scope. It's hard to make something unique.
We've focused on developing a 2D multiplayer game (hundreds of online players per server) with unique features (including unlimited modding) and going with in-house engine (with client part built on MonoGame with NoesisGUI) already proved to be a great decision.