Mono relicensed under MIT - C# for UE4 can come back?

To be honest, Mono isn’t that bad. It has gotten a lot better over the past years. Under the stewardship of Xamarin it has become a viable platform for mobile app development, one that compares very favorably to the native Java and Swift development kits for Android and iOS. I agree that C# is also perfectly fine for developing indie games, with MonoGame for instance. And with Microsoft now gradually merging .NET and Mono together, things can only get better for both frameworks. Unfortunately, because of the aforementioned licensing issues, Unity has reaped none of these benefits over the past 6 years or so, and it’s becoming nigh impossible for them to play catch-up now.

Unity’s biggest performance issues do indeed stem from its outdated architecture and some backward design decisions. Despite all the recent efforts into improving parallelism under the hood, Unity still relies heavily on a single thread. And because of the way scenes are constructed in Unity, with lots of redundant game objects and components, larger more complex maps quickly clog up the CPU and create massive performance bottlenecks. I did some performance optimization work for a Unity-based game about a year ago; one of my biggest contributions consisted of creating a system to clump batches of game objects together. Not for static mesh batching - Unity already does an admirable job at that - but simply to reduce the number of individual game objects in the scene. Or more accurately: to reduce the average number of game objects per mesh vertex. This was based on the observation that while each individual game object has very little overhead, if you have 100k of them in a single scene, with many of them just to hold a single tuft of grass along with 3 LOD levels, that tiny overhead does add up to a significant amount of CPU cycles. The result: a 30% increase in performance across the board. While it was a cool moment of triumph for myself, the fact that you have to even concern yourself with things like this in Unity is madness.

Epic was smart in dropping most of Unreal Engine 3 and starting off with a clean slate for Unreal Engine 4. It allowed them to ditch a lot of accumulated cruft and reconsider all of their design choices within the context of modern hardware and game development practices. Unity would be wise to do the same, but they would risk alienating their current userbase with such a move and I don’t think that’s a risk they are willing to take.

Another pet peeve of mine is the programming style that Unity inevitably leads you towards. I love C# for its high-level productivity features: LINQ, async-await, auto-implemented properties, that sort of thing. But when performance becomes an on a game project (and usually it will), a simple thing like a foreach-loop becomes forbidden, because it heap-allocates an Iterator object in the background, and we don’t want to pressure the GC with unnecessary allocations. Next up, indexing a List<> inside of a regular for-loop is bad because List<T> implement the IList interface so indexing is a virtual function call which is slow (yes, these are discussions that I’ve actually had). So then we’re forced to use plain old arrays, without any of the safety features that you get from using container classes. Before you know it, you’re programming C# like it’s plain old C, but with none of the strengths of either language. And with it comes a whole host of bugs that C# was actually intended to avoid.

In contrast, range-based for-loops in C++ use iterators allocated on the stack, which automatically disappear when they go out of scope, and no additional memory management is needed. Indexing a TArray<> in Unreal compiles right down to a regular array access, so no impact on performance there, but no need to sacrifice safety either. C++ may not be the easiest or most productive language to work with, but at least it’s an honest language with very little hidden costs.

Any news regarding C# at the GDC17?

Your information is old, it’s been better for over a year. The situation for Mono on UE is entirely different than the classic Unity problems. Mono has been open source for a while and there is little stopping anyone from using it. Long before this happened, Unity decided to do their own .NET implementation. It seems to be tough for them.

Xamarin is working on their own free C# plugin for UE4. It is close to being ready, but to get it working like they want they need to incorporate some parts into core UE. This has caused some legel hurdles that they expect to have solved. As Mono is open source there are some other integrations in the works, the most promising being discussed in this tread:

C# is an open and standardized language, ECMA-334. There are two big open source implementations, Mono and Roslyn+.Net Core.

And Unreal’s C++ use isn’t very “open”, as it requires the proprietary Visual Studio (at least on Windows).

I saw a photo of a UE C# project in the ID@XBOX (I think)…although can’t remember where, on twitter somewhere. Someone is working on it, but no official announcements afaik.

I think we will see a huge amount of unity users switch over to unreal if C# is official support.

I’m trying to think of reasons why they would continue using unity?

Perhaps investment in some of the assets bought from asset store. Asset store is very active compared to Market place in UE. However I could count quality assets (scripts, systems, not talking about gfx or content) between 40-50 which I would like to use, however if you load those up to the project then Unity mostly dies because it gets overwhelmed by those. Also overlapping naming etc becomes problem. I’m so ready to jump to UE when I get to use .NET as main language to code (just so I can keep myself mostly productive and not learning the trade secrets of c++ again like in 2003) :).

Also currently for a team of size 1-3 its too easy to create mobile apps that works and you can almost do anything with those, anything can be found from asset store … bluetooth components, all sorts of multiplayer components etcetc. I’m missing these when I come back to UE and try it now and then just to compare how it has evolved in couple of years.

I’ve had workshops for Unity and UE. It is so much easier to get people to jump on with Unity than with UE. In my eyes UE is PRO tool, Unity is Popular tool. ****. I got so much side tracked from the OP Topic, sorry for that. I just found this message from google when I tried to find out if anything has happened with C# and UE.

FYI, there already is a working C# implementation for UE.

It was made by a Chinese developer and I did a little bit of proving out to show how you can use it to publish a shippable configuration. I didn’t try attaching a debugger, but besides that it does seem to work. Obviously it’s just based on hooking up to blueprints.

Here is the short version I made:

"Video showing steps to get a shipping build

Note the compiled version only works with 4.14.3 and will not work with 4.15. I think it could be compiled to work for 4.15 but I had trouble compiling it.

Instructions to use Unreal CS here: .google.com/document/d/1…AKNKOpJpE/edit

Thanks xiongfang for making this product."

C# on Unreal will make almost zero difference to attract Unity users.
Most people are making mobile apps working on notebook “workstations” incapable of running UE4’s editor; Unity is so light (empty) that it can run fine on those old machines, but Unreal 4 will not help those people unless they upgrade hardware (and most want to earn money without expending a peny for it).

I agree with unity being empty and some developers not spending much, but how do you know the majority of users are using old laptops? did unity supply any stats on the user base using old notebooks?
I know they release stats on OS but I dont think they’ve mentioned notebook usage ect.

I’ve been wanting unreal to support C# for a while now. but recently I’ve found a new love… that love is blueprints with . those two combined is the ultimate productivity tool. I dont know why i didnt like blueprints before. I now think now that blueprints is quicker than using C# and I probably wouldn’t bother with using C#.

I think you will see many unity users switching over but keeping them here is a lot harder. its never going to be the same as unity’s api with C#. Thats something that unity has does well, but unfortunately its too old and needs updating asap. Anyway things dont happen quick at unity and I think long term users are losing their patience.

I think whilst fellow devs are waiting for C# they should give skookum script a try. they have a new IDE and a few tutorials. No need to download from their website, skookum script plugin is in the vault in the launcher. make sure to install the plugin to the unreal version you’re using. once installed start your project up and activate the plugin in the plugins settings. the project will restart and then you will see the skookum script button at the top. Skookum Video tutorial

Skookum offers a lot cool features but one of the most importing things for me is compile times and nothing beats .

Because I know the profile of indian, russian and chinese developers.
They are the large majority of unity users.

Looks like Mono C# is back to UE4. There main website has just been updated.

A couple of interesting notes.

  1. The C# plugin require a custom version of UE 4.16
  2. A year ago the developer of Mono wanted to make some changes to the main UE4 branch in order to support Mono as a plugin without requiring building from Github. I guess that negotiation didn’t pan out.
  3. Github link is down. I am guessing they are going to be launching soon.

I am excited to test it out when it does launch.

They recently said that a long standing blocking with Epic had been successfully resolved. Maybe we will get built in support for the plugin in 4.18?

Unity’s hardware stats don’t disagree - you can see it easily from the GPU statistics:
http://hwstats.unity3d.com/editor/gpu-win.html

Nearly half of Unity developers are apparently using Intel onboard graphics, and amongst the most popular non-Intel cards are Nvidia onboard graphics.

If you look at the mainstream ‘serious’ development cards, most have no significant user share at all (GTX970 1.7%, GTX1060 1.2%, GTX980 1%, R9200 0.8%).

Released now!

Dedicated thread for this relaunched version in the Engine Source section:

A lot of people have hybrid laptops and computers. For instance, mine would register as having an Intel video card to some program that probably doesn’t flag windows to use my GPU. If I were to open up a program like CPUZ, without changing the Nvidia default settings or right click=>run with nvidia card, it will say I’m using Intel.

I’m planning to submit the engine patches as pull requests now that we’ve been able to release the plugin. It may take a while to get them all merged as some are pretty invasive and will likely require discussion and possibly rearchitecting. Once they are merged, the plugin should work with an unmodified engine.

Those hardware stats are taken whilst the editor is running. If they have both an onboard and a dedicated GPU, then the dedicated card isn’t being used.

Yeah that might be true. I kind of figured it would pull the stats when it was installing, but either way, I’m sure a lot of the Intel stats are actually people with hybrids. The Unity editor is super lightweight and you could easily do 90% of your content creation on the integrated GPU, before needing to use a discrete gpu; so long as the Intel chipset was compatible with your target shader model. Saves a lot of wear and tear on your GPU, power supply capacitors and fans.

The same stats say 80% of users are using machines with CPUs that support 4 threads or less, and more than a quarter support only one or two threads. It’s hard to extrapolate, but I’d expect that’s a lot of dual-cores (e.g. Intel i3 dual cores would report 4 threads).

Yeah I’m not sure about it all and I guess we can only speculate. Though as someone said earlier, there are a TON of people whole only develop simple games for phones or that only develop retro 8/16bit indie games. Needless to say, you don’t need a $7000 workstation to make those.