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.

2 Likes

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.

2 Likes

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?

2 Likes

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

1 Like

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

Hello, can we create a pre-compiled static libraries in VS with ‘Reflection’ for use in UE?

DLL or static libraries - there is no problem.
There are a few marketplace plugins that use this approach.

Sorry, but I don’t understand.

I dont understand why everyone is suggesting hiding code in a separate dll. Its perfectly possible to package your plugin and use it without providing source code.

Just imagine you are a plugin developer - there are portion of codes where you dont want to reveal it to anyone for many reasons - proprietary, close license etc. The rest of the code can be distributed, compiled as the users wish…