4

I'm independently developing a physics-based game using HTML5 canvas and JavaScript; I've used no external code at all (including physics or game engines), and my code is about 5000 lines in length. The development is almost complete, and now I want to release it.

I am planning to release the game as a paid app on the Chrome, Android, and Apple app stores, but I also want to release the code under an open source license - one which allows free reading and gleaning of ideas from my code, but does not allow more than a couple lines to be copied. Basically I want people who know where to look and how to use to find free code, and the general public to buy it, while preventing piracy or the development of a near copy.

Is this possible with an open source license?

What license should I use?

ChrisF
  • 38,878
  • 11
  • 125
  • 168
mindoftea
  • 141
  • 3
  • 7
    Note that "does not allow more than a couple lines to be copied" automatically means that your software will **not** be [open source.](https://de.wikipedia.org/wiki/Open_Source). All OSI-approved licenses (which is pretty much what "open source" means) require that the code may be re-used. Of course you can license it exactly the way you want, but please avoid using the phrase "open source" for such a license, it would only lead to confusion. – Joachim Sauer Feb 22 '12 at 07:51

3 Answers3

5

You are probably looking for a Creative Commons license.

Something like Creative Commons Attribution NonCommercial ShareAlike

zellio
  • 182
  • 1
  • 3
  • Thanks! I tried my hand at googling it, but couldn't find what I was looking for; can't believe I missed this! –  Feb 20 '12 at 22:59
  • 4
    Note that CC-BY-NC-SA does not fit as an open source license, because allowing copying and selling is necessary to be considered as one. – lvella Feb 22 '12 at 02:18
  • 5
    See http://creativecommons.org/weblog/entry/27081 for reasons CC license not intended for software. – codingoutloud Feb 22 '12 at 05:56
5

What you describe ...

allows free reading and gleaning of ideas from my code, but does not allow more than a couple lines to be copied. Basically I want people who know where to look and how to use to find free code, and the general public to buy it, while preventing piracy or the development of a near copy."

... does not qualify as "open source" according to the OSI definition, violating the "free distribution" clause.

So I think the answer to your question is that what you ask is not possible, but you could have a liberal commercial license. Check out Microsoft's Shared Source licensing as a model, specifically Microsoft Reference Source License (Ms-RSL).

Joachim Sauer
  • 10,956
  • 3
  • 52
  • 45
codingoutloud
  • 716
  • 5
  • 8
2

If you're concerned about protecting the code (legally), you should contact an attorney to craft a license that meets your somewhat non-typical needs, to make certain your application and code is properly protected. Creative Commons as a commenter above mentioned, isn't a good fit for software. If you feel like a CC license is right, you need to read the details of the license carefully and understand it. Don't rely only on the summaries provided.

Better though, I'd suggest that instead of (just) doing that, you'd consider creating a blog/web site that discusses the more interesting points of what you've done and why you think they were novel or interesting. I'd read it (as would likely others), whereas I wouldn't think to try to dive through your ideally minimized JavaScript code.

WiredPrairie
  • 121
  • 2