Is hiding source code in plugin possible?

I wonder if it is possible to hide source code in plugin.
I try to delete the source folder in a plugin.It worked when the game run in editor.But it did not work when i packaged it.

After i delete the source file,the plugin fold is as following
It worked when i run in editor,but when i try to packaged it.It failed:UATHelper: Packaging (Windows (64-bit)): UnrealBuildTool: ERROR: Couldn’t find module rules file for module.
Someone told me that I should keep the .build.cs file(in the source folder).Then it packaged successfully,but the plugin did not work at all.

You might be able to build the code you don’t want to provide as a DLL and link to it in your plugin. You’ll have to change your .build.cs to do the linking instead of building of that source.

Thank you!.But what i should do to build the code in into dlls ?

Unless you have industrial secrets there’s no reason to not include source code.
If anybody “steal” your work you are protected by copyright laws, nobody need to be sued for small things and nobody need to steal your code; however everyone needs source access to make modifications when needed in a project specific case…

Btw, you get error because if you remove source files then you must pre-compile dll for every single platform supported before deleting C++ files or else packaging fails.
That means you’ll have to include pre-compiled dlls of your plugin for:

Windows editor (x64)
Linux editor
Mac editor

Debug windows game (x86)
Debug windows game (x64)
Release windows game (x64)
Release windows game (x86)

For Android, iOS, PS4, VR, etc… It’s all the same, a shiton of dlls you have to pre-compile just like Windows.
Isn’t worth the trouble at all; and after all that, costumers will requests source code access for whatever reason anyway.

Is it a requirement in marketplace to provide binaries for all platforms?

For all platforms in your whitelist, yes. Again, as [USER=“434”]BrUnO XaVIeR[/USER] was saying - if you simply provide code, then Epic will build everything as needed for the various platforms. Trying to hide functionality behind DLLs really isn’t worth it unless you are doing some licensing setup.

My targeted platform is win64.And the plugin has binaries for that.I put the plugin in Epic Games\UE_4.17\Engine\Plugins\Runtime.
It is packaged successfully.But the function in the plugin did not work.

Wait, you’re saying that Epic will build the plugins? Meaning the end user doesn’t actually get to see the source code unless the plugin developer gives access to it?

pro tip… no one will buy a plugin without source code.

1 Like

No, the code is given as well, it’s just the final binary is done by Epic’s build machine if the user is using pre-generated binaries.

I know that this topic is a few months old, but I have a question totally related to this subject. I want to hide the source code of my plugin (it’s not a plugin I plan to sell, it’s for a very specific purpose) so I will be putting my code inside a DLL.
However, for this plugin code, I need to use some of the UE types and functions (like FVector), is it possible to build this kind of DLL using these types?

1 Like

Bump this post. I second your question… Very specific use-cases, not related to selling plugins or even compiling builds. We need help on how to protect our work on editor-level use cases and workflows, like in Virtual Production.
Thanks in advance

Create on Visual Studio pre-compiled static libraries.
It’s quite easy to link them from within a plugin module, using your Build.cs script.

1 Like