Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

Is it copying scripts from others and publishing game with it ilegal?

Discussion in 'Scripting' started by ContraXGaming, Jan 18, 2019.

  1. ContraXGaming

    ContraXGaming

    Joined:
    Dec 15, 2017
    Posts:
    78
    Hi, well i don't have great knowledge in coding, so i dont know will it be illegal if a copy scripts from tutorials, and if i publish my game and sell it with copied scripts from the tutorials on youtube? And, i dont know do i really need to ask owner of a script for it, or i can publish my game and sell it without asking the person who made a tutorial where is shown the script i've copied?
     
    Last edited: Jan 18, 2019
  2. WallaceT_MFM

    WallaceT_MFM

    Joined:
    Sep 25, 2017
    Posts:
    394
    Legality depends on which country (and state/province) you are in and which specific tutorials you are talking about. In the US, it is almost always legal to copy scripts from tutorials since the knowledge contained there is considered common knowledge, and you do not need to obtain permission to do so. Disclaimer: I am not a lawyer, do not make decisions on this advice alone.
     
    ContraXGaming and MNNoxMortem like this.
  3. Suddoha

    Suddoha

    Joined:
    Nov 9, 2013
    Posts:
    2,824
    I would strongly recommend to ask them either way. Make sure you have the permission to use code that you get from somehwere, and keep the responses to always have them at hand.

    It gets more tricky if the code shown in tutorials was itself taken from somewhere, you might not even know that. Sometimes even basic code sample can have a copyright notice.

    I'm not an expert either, but you really need to be careful what you're publishing. The one who made the tutorials could live somewhere where it's not allowed to simply copy it as well, and if he finds out, he might attempt to charge you for that.

    As an example, at my work place, before we release anything the entire code base and all included plugins have to be submitted and run through millions of automized checks, they're checked against publicly available repositories, apparently also against code that's been posted on various websites etc...

    If there's a match that appears to be "just by accident", say a small interface defintion that happened to be just too common and generic, it's usually fine.
    If it's an entire implementation, things get stuck and the issue has to be resolved.

    As an example, we can't just take the risk of copying code from StackOverflow e.g. if that was never meant to be used "as is", even though it's been posted and looks like it's "publicly available".

    Other than that, never release anything you cannot understand / adjust / fix. Your customers expect certain QA and support, such as patches with bug fixes, improvements. It's worth either getting into coding, or hire someone to do the work for you.
     
    Joe-Censored and ContraXGaming like this.
  4. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    It depends on how the code was licensed. I'd ask if it isn't obvious, or rewrite the code yourself so it is functionally the same but no longer the potentially copyrighted code.
     
    SparrowGS likes this.
  5. lordofduct

    lordofduct

    Joined:
    Oct 3, 2011
    Posts:
    8,555
    Reason #834 that I avoid tutorials

    If I'm scouring the net for code for whatever reason I try to stick to websites that require license information (or at the least strongly annoy people to post a license with their code).

    Examples:
    GitHub - annoys members to include licenses on public repos
    CodeProject - more tutorial like, and code is under the CPOL (codeproject open license)

    If I end up on a blog, I'll look for a license. Any developer worth their skill in salt will include a license on their blog, or a link to their repo/source that has a license. If a license isn't included... I usually take that as a sign that they probably are more amateur level and honestly... why am I using their code?

    If for whatever reason at this point I REALLY need whatever I read there. I may reach out to them. Or just completely base my own logic not off their code, but off the description within their blog. Like "I used a hoozit to do a whomp whomp". Of course this usually assumes you have a reasonable skill level yourself and you're not on the blog because you're lazy and have a 1 hour deadline... rather than you just straight up don't know how to do it.

    Reaching out is seldom something I'd do.

    If I'm scouring the internet for free codes, it's usually out of time constraint rather than skill. And in which case the time to wait for a response is not reasonable for me.

    There are exceptions. For example the "Bitsy Game Engine" which can be found on itch.io as a web-based low-fi game editor. I really wanted to port it to C# and use it inside Unity, and the guy behind it had no license information anywhere. So I reached out to him to get permission under the terms that what I wrote was also made available to the internet for public use.

    Which I did:
    https://github.com/lordofduct/BitsySharp

    But that was an edge case for me.

    ...

    And then there is of course the tiny code snippets you might find on stackoverflow and the sort. Some 5-10 lines of code just publicly posted to the wild.

    This stuff I don't honestly fret over.

    First and foremost I usually copy such code into my own style-guide since the internet almost always has an anarchic style to its code found in the wild. So just that alone makes it distinct.

    Now sure there is the potential for some possible intellectual property theft going on if someone pulled that snippet out of some closed source project... and didn't say. (if they did, well... 1: don't use it and 2: I doubt you'd find it since places like stackoverflow would allow you to flag it and purge it).

    But in the edge case that something like this happens, it's such a small snippet, and because it was in the wild. It's usually considered perfectly fine based on "good faith" judgement. Most any 10 line of code snippets are such generalized ideas that the idea you found that ultra secret patented algorithm stranded on some stackoverflow post is slim to none! And anyways... if you found that algorithm, it'd be kind of obvious, since 10 lines of code worth patenting are probably some real special lines of code.

    But that isn't to say you're taking a possible risk. But I mean honestly... unless you're doing this for your entire code base. :shrug:

    ...

    In the end.

    That's just how I approach code found on the internet.

    I'm no lawyer... so yeah... umm if you get in trouble. Ain't my fault.

    Proceed at your own risk.

    This is what licenses are for.
     
  6. lordofduct

    lordofduct

    Joined:
    Oct 3, 2011
    Posts:
    8,555
    I would like to add about licenses.

    Keep in mind, read the license in full.

    Some licenses are full free and open. Like the MIT license, and the CPOL license I mentioned before.

    But licenses like GPL and the sort, and other so called "copyleft" licenses. These licenses are what I like to call "parasite licenses". They actually stipulate that you are freely able to use it... BUT whatever you use it in must ALSO maintain that license. So if you use some opensource GPL'd software in your software, you must GPL your own software.

    Don't confuse GPL with LGPL (lesser GPL). This license is effectively the parasite free version of GPL. It allows you to integrate said software into your proprietary software without having to inherit the GPL license. Software like ffmpeg fall under the LGPL and is why a lot of software used it and aren't GPL themselves.

    Getting into this realm of licensing can get really tricky.

    This is why I stick to licenses like the MIT license (which everything I release is usually under).

    It is a short, simple, clear, and permissive license:
    https://en.wikipedia.org/wiki/MIT_License

    It basically just says "yeah, you can use it... but I'm not liable for anything that goes wrong if you do"
     
    ContraXGaming and SparrowGS like this.
  7. SparrowGS

    SparrowGS

    Joined:
    Apr 6, 2017
    Posts:
    2,536
    (https://forum.unity.com/threads/is-...-if-you-copied-script-from-a-tutorial.611851/)