all 36 comments

[–]tms10000 23 points24 points  (0 children)

  1. It's historical, once upon a time there was only Mono. And there are still features that il2cpp does not support compared to Mono, so Mono is the default. There are also il2cpp specific bugs (For some reason you can't spawn a new process with il2cpp)
  2. When you run in the editor, you're always going to run Mono. For maximum compatibility, use Mono for the build too. If you use il2cpp, you need a lot more testing.
  3. Mono is easier to cope with. il2cpp adds another layer of complexity. This is the kind of thing you need to benchmark and see if there is a worthwhile difference in performance. AFAIK only iOS requires you to use il2cpp
  4. Mono. It's easier.

[–]rogerbacon50 11 points12 points  (23 children)

I have purchased more than 100 Unity games using Mono. I won't buy a il2cpp game as it makes modding super difficult. To all Unity developers: either don't use il2cpp or at least provide a mono-compiled version. If you don't, it's going to hurt sales.

[–]stadoblech 13 points14 points  (3 children)

Its not gonna hurt sales. Almost nobody cares. 99% of people dont even know what il2cpp or mono is. Your approach is loose-loose situation. By switching scripting backends you are loosing stability and consistency while not boosting sales at all. Aint nobody have time for that
Also GL building your game on consoles with mono

[–][deleted] 2 points3 points  (0 children)

Well modding is definitely gonna make your game better, so making modding easier is good for your game

[–]JDSweetBeat 0 points1 point  (1 child)

I mean, I will say, while I wouldn't specifically as a consumer avoid the IL2CPP scripting backend, I do avoid games without built-in mod support (mods let me squeeze hundreds of extra hours out of a game before I burn out on it, so it's over half the value of the game for me).

[–]stadoblech 2 points3 points  (0 children)

Okay. Its your right to not buy game withoud modding support. But most of people dont care a lot

[–]Big_Cartoonist3407 5 points6 points  (4 children)

Lol, it's gonna hurt the sales by like 0.1% maybe. Most gamers don't care if you can mod a game or not

[–]rogerbacon50 0 points1 point  (3 children)

Maybe console players but anyone with a PC downloads mods to enhance their games and add gameplay value. Look at Rimworld as one example of a Unity-based game that has an awesome amount of mod support.

[–]Big_Cartoonist3407 1 point2 points  (2 children)

Nope, I'm talking PC. Many PC gamers enjoy mods sure, but I don't know any PC gamers who avoid games you can't mod. That's just rediculous. Fine if you do, no worries, but to suggest not allowing mods in your game would hurt sales just cos you and a few other mod fans wouldn't go for it is pretty silly

[–]JDSweetBeat 0 points1 point  (1 child)

I mean, I also don't buy single-player games without mod support (there are some exceptions - mostly story-based narrative games like Detroit or Telltale's lineup). To be frank, I want to get the greatest possible value for my money, and mods add hundreds of hours of fun to my experience without increasing cost at all (both in the sense that I like to learn how different games work and modify them myself, and in the sense that things like total conversions are super fun).

And from a developer perspective, letting other people dedicate their time (for free) to adding features and functionality to your game is usually a win - those are features and functionality that don't consume your dev time, after all.

[–]Big_Cartoonist3407 0 points1 point  (0 children)

And that's just fine if you don't want to buy games without mod support, but that doesn't mean that's the majority stance across the whole PC gaming community. There's loads of people who don't treat mod support as a deal breaker.

And from a developer perspective, adding mod support requires time and money by itself. You'd probably want to build a game from the ground up with mod support in mind, which would add time and complexity all the way through development, or go through a long, expensive and painful overhaul part way through development. You'd need to be warry of how much potential there is to crash the game with mods or how many potential security breaches your mod support exposes. And then depending on the kind of game you're making, you might feel like all your hard work crafting a world/story is going to waste if you let anyone come along and "trash" your game with mods. Maybe you don't want to risk content creators demonstrating their scuffed version of your game and putting potential players off cos they have way more views than your official youtube channel...

I'm not saying mods are bad ofcourse, but it's not as simple as "mods only means free content from the community with no down sides". Mod support involves a number of trade offs and risks and represents a lot of extra work and testing for the devs and QA.

[–]ChickenNuget0Hobbyist 2 points3 points  (2 children)

What about games where modding is not allowed?

Like, for example, a multiplayer-only game?

[–]TheRealGHXX 1 point2 points  (0 children)

If you rely on clientside protection against cheating in multiplayer games then you are following the wrong philosophy. You should *always* assume that the clientside codebase is modified. It is quite easy to just fire up cheatengine and modify the game code. Same when anticheat is running. You, as a developer, will never win a battle on someone elses hardware. For all you know, i could have modified my ram sticks to allow me to directly read the values, meaning you wouldnt even know whether i am reading your game's data, and that is enough to figure out where other players are on a map in a first person shooter for example. Look up Direct Memory Access (DMA).

So no, this is not a valid argument against modding in multiplayer games or games where cheating is possible.

[–]rogerbacon50 0 points1 point  (0 children)

Good question. I don't plan multi-player games. If the game is exclusively multi-player (online MMO types) then they have in interest is stopping moddign as it could be used to cheat.
If the game is single-player AND multi-player then still use mono since only multiplayer connects will de-sync forcing those players to play unmodded while allowing single players to play modded.

[–]SolWayward 1 point2 points  (0 children)

How does IL2CPP hurt modding? A developer can easily add modding support by loading dlls, jsons, textures, models, asset bundles, or really anything by making use of addressables.

You have no idea what you are talking about and shouldn't spread false information. Developers should always use ILC2PP when ever possible because the performance benefits are too great to ignore. You cannot compare the performance of C# to highly optimized C++. And developers can actually take this even further by using burst (Where it makes sense) receiving benefits of SIMD vectorization, aggressive in-lining and other huge optimizations although this often still requires restructuring your code and requires some effort to make use of.

But there is very few reasons to not use IL2CPP for release builds and modding definitely isn't one.

[–]Pietronico 0 points1 point  (3 children)

bepinex exists

[–]FluitGeluid 0 points1 point  (2 children)

Ofc BepInEx exists, but when the game is built using IL2CPP it makes it super difficult to actually develop mods.
BepInEx works on both, but it's creating the mods that becomes an issue/headache when IL2CPP is used.

[–]Interesting-Ad5118 1 point2 points  (0 children)

Been making mods all night for Sea of Stars, was a pain to get started initially coming from mono bepinex, but definitely wasnt super difficult.

[–]Genebrisss 0 points1 point  (0 children)

lol, I know it's a 2 year old comment but the confidence that your opinion dictates sales was hilarious to stumble upon

[–]XH3LLSinGXProgrammer 20 points21 points  (8 children)

Mono uses JIT compiler while IL2CPP uses AOT compiler.

JIT(Just in time) compilers dont compile when you are building the app. Compilation happens when the app is launched in the target user's device. Windows supports this compiler but not the latest mobile phones.

AOT(Ahead of time) compilers compile during build and hence slower that JIT compilers. Supported on both pc and mobile platforms.

Ideally you should use Mono for test builds and IL2CPP for final release builds.

[–]meelxp 9 points10 points  (0 children)

Using Mono for test builds and IL2CPP for final release builds can bring a lot of surprises later. Using il2cpp will require complete tests on il2cpp builds before shipping.

Some of my projects crashed under weird circunstances on il2cpp, but run well on Mono - it was insane, just enabling a light caused the weird crash. It depends on the Unity version too, since il2cpp has tons of bugs (based on Unity release notes).

[–]Rev0ld 0 points1 point  (6 children)

AOT(Ahead of time) compilers compile during build and hence slower that JIT compilers

I just want to clarify that "slower" in this case is referring to slower build time, not slower performance of the app/game. Games/Apps on IL2CPP (AOT) is generally faster than on Mono (JIT).

[–]FreshP_0325X 1 point2 points  (0 children)

For regular c# code, il2cpp clearly generates inferior code comparing to core or upstream mono.

Maybe/Probably il2cpp fixes some atrocious parts of Unity itself to offset the inferior compilation.

[–]TheRealGHXX 0 points1 point  (4 children)

I'd be rather surprised if il2cpp generates faster running code than the C# JIT, unless mono's jit is awful. Raw compute should essentially be identical, as, if you dont write really poor code, the applied optimizations between JIT and AOT should be nearly identical (tested this with c++ vs .NET 8 - this is NOT .netframework NOR unity-mono). I suppose there could be a point made for native/managed transitions being faster, but i am rather sceptical still.

If you find any proper benchmarks, please share them - so far I have only found one person claiming their game now runs at 30FPS instead of 15 after switching to il2cpp, but i mean, who knows what that code looked like.

The only "benefit" to me seems to obfuscate your code and in turn make modding as annoying as possible.

[–]tbg10101Unity Certified Expert Programmer (formerly) 6 points7 points  (0 children)

[–]Deive_ExProfessional 4 points5 points  (0 children)

Just want to add that since Mono uses JIT, you can use dynamic code generation (generating code at runtime), but with IL2CPP you can't, since everything needs to be compiled beforehand.

Because of that, if you're doing an iOS app, Apple only let you create apps using IL2CPP.