Godot: Mono exporting requires CS files to be exported as well

Created on 9 Jul 2018  路  6Comments  路  Source: godotengine/godot

Godot version: e2b7a68db450d0d48d005719731619a49f96b7c8

OS/device including version: Win10 x64

Issue description:

Exporting a mono-based game requires you to include the cs files in the exported pck file, otherwise the engine fails to load said scripts despite the compiled assembly being present in the pck. This is especially an issue for closed-source/commercial games which probably don't want to ship the source to their game in the pck.

I'm guessing that fixing this will require #15661 unfortunately.

bug mono

Most helpful comment

All 6 comments

Random thought on this - does the engine actually read anything from cs files at runtime? If not, a (hacky) fix would be to have only empty cs files exported into the pck file.

It's trivially easy to decompile very readable C# from the DLLs.

Pragmatically it's probably realistic to consider the source published, FOSS or proprietary, once your product is released.

Edit: Sorry, I didn't mean for this to come across as against the suggestion. I think that removing the raw source is a good idea, but I don't think it will stop the curious from looking under the hood.

I have to absolutely disagree. Decompiling C# may give you something semi-readable, but it will be missing variable names and comments, and will have all kinds of weird code due to compiler optimizations. It is a far cry from outright shipping your code with the game.

There is no reason we should have to ship the code itself with a game.

It exports empty source files. There is an option to export the source code, which is disabled by default.

I can't check now (will do so in a few hours), but that seems incorrect from my experience. At the very least, it seems like the option is on by default. Or maybe my project settings are screwed up.

Was this page helpful?
0 / 5 - 0 ratings