The core part of my game (made with Unity 2017.3) does this:
Read a text file and a bunch of .obj files at runtime and import them into the game (according to the information from the text file), so you can walk around and interact with them.
I now want to create some kind of library from the C# code that does the reading/editing of the text/.obj files (according to the text file), so someone else can use it in their own game/program (I don’t want to sell this in the asset store!): They simply give my code the path to the text file and get the finished (imported) GameObjects in return - there’s no Editor interaction, it’s all through code.
There are two catches though:
I don’t want them to actually see/be able to change my code.
I don’t want to upload the finished thing to the asset store but pass some file to the other person, something they can then easily import into their own project
From what I’ve read so far an asset (package?) might be the right thing for me but how do you go about creating one from existing partial code? The videos I’ve found so far are about creating 3D models that are then sold in the asset store, not actual code assets.
What makes stuff even more complicated:
I’m currently using a paid asset to read the .obj files and create GameObjects at runtime. Am I right in my assumption that I can’t just add the code of said asset (the code was included and I changed tiny parts of it) to my “library”?
In most cases you can modify purchased asset content. Unless there is explicit licence, prohibiting of such. However, acquired assets can not be part of further sold asset. Only as part of your full project. See Unity Asset Store licence for more details.
You are likely have less chance to sell asset. But you can compile into dlls. However, you can not prevent anyone, from decompiling your dlls. Even if you obfuscate, still chances to read back, if someone is determined. But people prefere buy asset with source code anyway.
Then release actual application, which generates what it needs.
You need decouple your code from the project. Then you can make functional asset of it. for example as Assembly Deffinition.
Thanks for confirming. The other person will also have to buy the asset then, okay.
I don’t want to sell the code asset, think of it more as giving some code to a friend or a colleague of a different department - you don’t want them to see/change the code but if you can make their life easier and they yours with something else in return - why not. I’m aware that there’s always some way to get the actual code if you’re putting enough time into it. I’ve bought assets from the store before that didn’t contain any actual code files and that’s exactly what I’m looking for: Something that’s easy to import but hides the code.
My app is going to be released but someone else is working on a different one and the only thing my and the other person’s applications have in common is the need to read the same type of .obj file (which also comes with reading the text file).
Yes, I’m aware of that.
How exactly does this (or creating dlls in Unity) work? That’s exactly the part I can’t seem to find any information about - I’m not sure what terms to look for and what I’ve found so far is about selling 3D models as assets.
Is creating an actual asset not adviced if you want to hide your code or is it still possible?
Is creating an “Assembly Definition” basically equivalent to creating a dll file or does importing an AD also mean that you get access to the code? The website says that a .json file is created, which would also give someone else direct access to at least the class names by simply opening the file with any text editor.
Sorry, not sure if that’s what I need/want.
Looking inside the code, allows to understand, what code is doing. Including receiving feedback, if bugs are found. Meaning, easier to debug.
I suggest study topic on compiling / building code, into dll library.
Personally I don’t use Assembly Definition, but for other reasons.
Assembly Definition allows to build project and split into dlls, but inside project as an asset, is still open source code.
It’s completely possible to create an asset without including the source code, but it’s not advised for the simple reason that many people will want source included in case the asset is discontinued or they wish to make modifications without having to rely on the author of the asset. Essentially if you sell it without source code be prepared for far fewer sales.
From what I read, OP intentions are not to sell assets, but to share with coworkers with some of sort.
However, closed source code indeed, makes dev depending on updates from asset creator. And risk of become depreciated is quite high.
So unless is some form of secrecy, I would,t bother biding.
Rather create git repository, so everyone can contribute to updated features. Even if original asset creator is long gone.
From what I read, OP intentions are not to sell assets, but to share with coworkers with some of sort.
However, closed source code indeed, makes dev depending on updates from asset creator. And risk of become depreciated is quite high.
So unless is some form of secrecy, I would,t bother biding.
Rather create git repository, so everyone can contribute to updated features. Even if original asset creator is long gone.
Developing with a closed source asset is a major hassle. You’re putting yourself on the hook for ongoing support, since you’re purposely denying them the means of self support. Unless the code contains some kind of secret sauce trade secret, you’re just creating more work for them to get it working, and you for having to answer any trivial question they have since you force them to ask you instead of just looking at the code.
You are correct. You will need to direct the other person to first import this other 3rd party asset. Then direct them to make the necessary changes.
I don’t want to sell the code asset, think of it more as giving some code to a friend or a colleague of a different department - you don’t want them to see/change the code but if you can make their life easier and they yours with something else in return - why not. I’m aware that there’s always some way to get the actual code if you’re putting enough time into it.
The code isn’t supposed to be free to use and while I don’t want to sell the asset through the unity asset store (it’s something really specific, so no point there), I’m not going to give it away for free (kind of like a software license), which doesn’t include the source code.
So what whoever uses the asset will be doing: Import my asset, give it the file path of the text file and get the GameObjects in return. That other person isn’t supposed to know how my code works, what it exactly does and also isn’t allowed to change it. Not only because, like I said, they don’t need access to the code in the first place, but also because I’m going to offer support (comes with the “license”) and I don’t want to deal with e-mails like “Help, I changed your code, now the app isn’t working anymore!”.
Plus, secrecy too, to be honest (for reasons I’m not going to explain here).
Is there an adventage of using dlls compared to assets? I thought an asset is easier to install than a dll?
Okay, then I won’t us an AD.
It’s not about sales.
How do I create an asset without including the source code?
Since you know nothing about DLLs and how C# and .net works in general I assume your “clients” won’t know it either. So just research how to build a dll in visual studio and ship it.
Disclaimer: there is no real way in .net and in Unity to hide the code completely. You always can get back at least to the intermediate level. But since we’re talking about people who does not know how it works, it’s not much of a threat.
I know it has to be included but there are assets that don’t “include” the code. The asset still works but you can’t access the code or change it. How do these assets do that? Do they use dlls or is there a different way?
Thanks for the link.
No, they are working with C# and Unity too, so I don’t want to and also shouldn’t assume that they don’t know more about it than I do.
I’m aware that there’s always some way to get the original code, even if you use an obfuscator, but I don’t want to make it too easy for them either.