Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Voting for the Unity Awards are OPEN! We’re looking to celebrate creators across games, industry, film, and many more categories. Cast your vote now for all categories
    Dismiss Notice
  3. Dismiss Notice

Code protection for asset developers?

Discussion in 'Assets and Asset Store' started by Ian-Gungee, Jun 5, 2018.

  1. Ian-Gungee

    Ian-Gungee

    Joined:
    Jul 11, 2017
    Posts:
    10
    Hi all,

    My team and I are currently working on a code-heavy tool that we plan to release in a couple months, but as I understand it, anyone who purchases the asset gains open access to all of the code that has been written by us.

    Am I wrong, or is there a way to encrypt or lock folders in the inspector to keep people from being able to view it? It seems like it would be too easy to pirate the asset via copy-and-paste...

    I haven't spent a whole lot of time on the asset store, so I could be entirely wrong in my understanding, and I really hope I am.

    Thanks ahead of time!
     
  2. RuinsOfFeyrin

    RuinsOfFeyrin

    Joined:
    Feb 22, 2014
    Posts:
    785
    You can release it as a DLL, which provides a minor amount of protection. Will stop most people, and make it more difficult and time consuming for anyone trying to code steal.

    I however also have a HUGE project ive been working on, and have had some issues with trying to use multiple dlls and the way unity 2017.3 specifically seems to be handling loading of things. Everything works great in 2017.2, 2017.4 and the 2018 versions, but something in 2017.3 is majorly fubared in that aspect and required a large portion of my intialization system to be re-written specifically for 2017.3
     
    Ian-Gungee likes this.
  3. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,526
    The general expectation is that code assets will include source code. This allows the customer to examine and customize the code for their project's needs and trace through with a debugger. It also protects the customer in case you go out of business in the middle of their project.

    You can try to hide it in a DLL, but it will impact your sales significantly. Some devs compromise by putting their custom editor code in a DLL and including the runtime source code.
     
  4. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    955
    @TonyLi is absolutely correct.

    If there's no source code included with the asset and everything is locked in a DLL, then I won't buy it. It is acceptable to offer the source code as a separate download from the developer's web site (where you need to provide your Invoice Number in order to access it).

    Some developers also sell "standard" and "professional" editions where the Pro version includes the source code but costs more (sometimes a LOT more). I'm generally less than enthusiastic about this option, but at least the source is available.

    If you choose to only include a DLL, be prepared to receive a lot of complaints and criticism. :)
     
    theANMATOR2b, Mark_01 and Ian-Gungee like this.
  5. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    12,872
    There is no much point in using DLLs, because anyone that would use the code for a as large project, would also be able to open the DLL files and see the code. You need to obfuscate the code as well.

    But in general i dont bother with that, i always leave everything open and i focus on advertising and offer the best product possible and full support, so it makes little difference when someone gets part of my code, since i always upgrade and increase my asset value.
     
  6. xeleh

    xeleh

    Joined:
    Jul 22, 2016
    Posts:
    302
    I think that really depends on the nature of your asset and your audience. I sell an easy-to-use visual scripting tool designed for users not interested in mastering C# and I can guarantee you the last thing those users want is messing with the 100k lines of the GameFlow source code. They expect me to do that.

    But yes, in general It is very true that most users expect the source to be included in code assets and I would add that they expect it with no additional cost.

    That's something I could understand for small code bases but not for huge projects that are the result of several years of work and contain very valuable information. I simply fail to see this like something "normal" but maybe that's just because I am a misfit in this weird place called Asset Store, so please take my words with a grain of salt.

    I have received no complaints or (serious) criticism for using DLLs.

    What about a public commitment to opening the source code (Github) in that case?
     
  7. orb

    orb

    Joined:
    Nov 24, 2010
    Posts:
    3,033
    Many people who want source code won't be communicating this fact when they're NOT buying ;)

    I've seen this attempted and fail before. The larger the company making the thing with a source promise, the more people need to sign off on it. This gets complicated when the people who can sign leave the company because it dissolves.
     
    Freznosis and TeagansDad like this.
  8. SteveSmithSoftware

    SteveSmithSoftware

    Joined:
    Mar 23, 2014
    Posts:
    188
    I have recently released SQL4Unity which is an RDBMS system written especially for Unity. The code for the system is in 3 dll's. There are several reasons why I took this approach.

    If you are serializing and de-serializing data you can get into all kinds of problems after the recompilation of source code due to assembly names and version numbers. You mitigate this by using dll's.

    I considered adding a CRC check to the source code files, I was told by Unity that this was not allowed.
    I considered adding an invoice number check but there is no way to do this programmatically.

    Unity appear to offer no protection of source code at all. If someone buys your code and then publishes it in a public repository for the world and his wife to download you have potentially lost a large number of sales and and any intellectual property contained within the code. It is up to you to find out that this has happened and have the offending repository taken down. Whilst this is also true for dll's although your copyright will have been infringed it is less likely that your intellectual property will have been.

    One of the greatest dangers or releasing source code as I see it is that an inexperienced user may change the code in such a way as to break it and then look to you for support.
     
    xeleh likes this.