
Mono for Unreal Engine - jstedfast
http://tirania.org/blog/archive/2014/Oct-23.html
======
j_s
Maybe this will light a fire under Unity to get a recent version of a C#
compiler. No one has ever been able to point me to an official explanation for
why theirs is so far behind.

~~~
WallWextra
The unoffical reason is Xamarin wants too much money.

~~~
frik
Mono is open source and free software. Because of the "single static binary"
policy (no dynamic linking) of app stores you have to obtain a proprietary
license from Xamarin.

• The C# compiler is dual-licensed under the MIT/X11 license and the GNU
General Public License (GPL).

• The tools are released under the terms of the GNU General Public License
(GPL).

• The runtime libraries are under the GNU Library GPL 2.0 (LGPL 2.0).

• The class libraries are released under the terms of the MIT X11 license.

and:

 _When do I need to obtain a license from Xamarin to the Mono Runtime?_

We only require licensing for uses of Mono and Moonlight on embedded systems,
or systems where you are unable to fulfill the obligations of the GNU LGPL.

source: [http://www.mono-project.com/docs/faq/licensing/](http://www.mono-
project.com/docs/faq/licensing/)

~~~
gillianseed
>We only require licensing for uses of Mono and Moonlight on embedded systems,
or systems where you are unable to fulfill the obligations of the GNU LGPL.

In other words, you have to pay a license fee for shipping the Mono runtime in
a proprietary game, which is what Unity does.

So Unity has negotiated a license deal with Xamarin for the Mono runtime
version they use, and if they want to use a newer version they will have to
pay more, which they aren't doing.

Instead Unity has developed il2cpp which means that they no longer have to
ship the mono runtime with each game and therefore no longer have to pay the
license fee for shipping mono.

Atleast that's what I've gathered.

~~~
mnglkhn2
Unity has negotiated a license with Novell. Now they would have to do it again
with Xamarin for the newer version of Mono. But we don't know if Unity was
really nice to the Mono guys when Novell pushed out what would quickly become
Xamarin. As always, if it were only money things would be simpler. But if
there is some beef things will drag.

Plus, Unity has forked Mono and they contribute to their own internal version.
At the same time they are working hard on their own proprietary il2cpp (to
export to C++). The writing is clear: they will drag things as long as
possible with using their old version of Mono until they are able to switch to
il2cpp.

My personal opinion is that Xamarin guys are better at Mono and that UE4
coupled w. Mono/C# might put quite a bit of pressure on Unity.

~~~
gillianseed
>Unity has negotiated a license with Novell. Now they would have to do it
again with Xamarin for the newer version of Mono.

Ah, so the deal was before Xamarin bought the rights to Mono from
Attachmate/Novell, I didn't know that.

>At the same time they are working hard on their own proprietary il2cpp (to
export to C++). The writing is clear: they will drag things as long as
possible with using their old version of Mono until they are able to switch to
il2cpp.

From what I understood they would still ship Mono as part of Unity (as in
development framework), however what they want to avoid is the license costs
that comes with shipping the Mono runtime with each Unity game, hence il2cpp,
but perhaps I'm mistaken here ?

~~~
mnglkhn2
For them to invest serious resources into a Mono fork and also in a
proprietary solution (il2cpp) shows that they do not believe in a deal for a
license of their liking, whatever the reasons: interpersonal or purely
monetary.

------
azakai
One concern here is portability: If you write your game logic in C# on Mono,
it won't run on all platforms (possibly for either technical or licensing
reasons - you're limited to where Mono runs). For example it won't run on the
HTML5 target. For comparison, Unity has written il2cpp to replace Mono to get
around that,

[http://blogs.unity3d.com/2014/05/20/the-future-of-
scripting-...](http://blogs.unity3d.com/2014/05/20/the-future-of-scripting-in-
unity/)

it basically compiles C# to C++, which they found is much faster.

I wonder if this project has a solution in mind for platforms where Mono won't
run? Or maybe it targets just a subset of the things Unreal Engine can target?

~~~
Sir_Cmpwn
Mono is a well designed, very portable codebase. The only platform I can
imagine having trouble _is_ the browser, but I would bet that you could
compile mono with emscripten quite easily. Also, there's
[http://www.jsil.org/](http://www.jsil.org/)

~~~
azakai
There are also issues with Mono on some consoles and mobile devices, due to
how linking works as well as some non-technical (legal) restrictions the
platform owners place.

From talking to Mono devs, definitely Mono can be ported to new platforms, at
least if there are no license problems. But even then, it can be quite a lot
of work. il2cpp avoids all those issues, it emits C++ which every significant
platform can handle very well.

------
Xelom
This means a lot to me. I will try to contribute to this one, nice kickstart
guys!

I don't have much C++ experience and I had doubts about getting into UE only
with blueprints. It feels like there will be cases that I won't able to cover
just with blueprints.

I was experimenting Unity just because of their C# support but now I can
gladly turn back to UE and it is more exciting for me.

~~~
HeshamA
As a long time Unity developer that hasn't touched C++ in years, I can say
that I have been experimenting a lot with UE4 and I haven't really needed to
touch C++. Blueprints are really powerful.

Having said that, I'm really excited to see c# supported.

------
sremani
>>This is a project that allows Unreal Engine users to build their game code
in C# or F#.

F# support is the real kicker.

~~~
nailer
Blueprint, the default UE4 language, seems functional. All functions are pure
functions, with input and output, not methods, there's no 'self' or 'this'.

That said, I'm not an expert on Blueprint or FP so maybe someone who knows
more can tell me whether that assessment is accurate.

(And I totally understand that some people will prefer F# and access to all
those .net classes anyway)

~~~
Arelius
That's not true at all, There is indeed a "self", and nearly all functions are
executed in a context with a valid self.

Additionally, there are plenty of nodes such as "Get Player Controller by
index" which allows the user to access and modify global state.

There is a "pure" option to check on a particular function, but the language
itself makes no checks as to the validity of this, it just allows the
execution engine to make assumptions.

~~~
nailer
Ah interesting re self - how did you find out about that?

------
AlexeyBrin
From [http://mono-ue.github.io/about.html](http://mono-
ue.github.io/about.html)

> _To redistribute code written with Mono for Unreal Engine, you must have a
> commercial license to the Mono runtime. These licenses are available from
> Xamarin for Mac, Android and iOS online, and you can request Windows
> licenses through support._

So, if I want to use this commercially on Windows I will have to buy a license
for the Mono runtime ?

Judging by the price for the Mac license it should be around $300 per year,
while the Unreal license itself is about $240 per year.

Now, if I want to use the same code on iOS, Android, Windows, Mac I will pay
to Xamarin about $1200 per year.

~~~
numo16
The Unreal license is only that much if you keep your subscription going. You
can subscribe and then cancel your subscription whenever you want, while still
being allowed to publish using the latest version of UE4 that was available
while you were subscribed.

From the EULA:

After cancellation of your Subscription by either you or Epic, you will not be
entitled to access or use future Versions of the Engine Code or Assets that
Epic makes available under the License. However, cancellation of your
Subscription will not affect your rights under the License with respect to any
Licensed Technology you have already downloaded under the License.

~~~
mnglkhn2
Unreal's model of subscription+5% of top revenue becomes a real nice deal when
coupled with Mono. All o fthe sudden there is room for C#/.NET devs to be able
to contribute to the platform. It should be a nice boost for UE4's adoption

------
aric
This is another game changer. Personally, the portability of C++ is, by far,
its own reward. But I'm thrilled for others that C# is finally becoming an
option. It's been many months in waiting for Unity users sitting on the fence.

------
AlexeyBrin
Hopefully, Xamarin will add Visual Studio support in the Indie dev plan at
some point. Currently, if you want to support iOS, Android and use Visual
Studio you need to pay $1798 per year which is a bit more for a one man shop.

~~~
forgotAgain
Or you could look at Apache Cordova. Support is in CTP now and full release in
Visual Studio 2014 hopefully.

~~~
general_failure
Have you shipped an app with Cordova?

Thought so.

I always recommend Cordova to my competitors

------
Sir_Cmpwn
My only disappointment is that Linux support isn't mentioned anywhere, not
even in the roadmap.

~~~
migueldeicaza
I'll add it to the FAQ, but a variation is already there:

You should be able to make this work on any platform where Mono and Unreal
Engine work together.

------
_random_
Good! Unity is in a desperate need for competition. How old is their Mono
version again?

~~~
jbevain
Unity runs on a custom Mono 2.6.5 with some fixes cherry picked from Mono
2.10.

------
drawkbox
Definitely game changing. The barrier to move from Unity to Unreal is really
low if this works out. Still best to do C++ where possible but this opens up
Unreal drastically.

~~~
socialist_coder
> The barrier to move from Unity to Unreal is really low if this works out.

Not at all. You still have a huge chunk of your code written specifically for
interfacing with UnityEngine. Also, coroutines instead of async.

It still won't be easy to migrate.

~~~
kayoone
Migrating an existing project won't be easy sure, but making the move to UE
for a new project would be much easier for Unity devs now.

------
kayoone
Awesome, the last thing that held me back jumping ship from Unity was that i
love C# so much and have no prior C++ experience.

~~~
keyle
The installation process (PC) kinda just threw me off :/

------
cturhan
Well this is very strange. Language shouldn't matter so much. Eventually you
will use the same function name for any language. Whether it's c++, c# or f#
you will use same functions e.g. `setActorLocationAndRotation` so I didn't get
that.

------
ed_blackburn
I wonder if Xamarin are considering acquiring Untity 3D?

