Source management and Licensing for Mods
Posted: Thu Jul 23, 2015 11:35 am
Consider this thread the start (hopefully) of an open discussion, though mostly a question/suggestion directed at modders. Also maybe a bit of a rant.
Disclaimer: I haven't created any Factorio mods myself (yet), but I've written a fair amount of other code, some of which is publicly available.
Straight to the point: Sharing code in a zip archive from a dropbox without a licence is… not ideal.
Managing source code with a version control tool like git is basically a must. It doesn't matter if your project has only 3 files or if it's so simple it's “never going to change anyway”. Factorio is in alpha and by extension, so is every available mod. The recent changes in 0.12, which broke pretty much every single mod, should make that abundantly clear. If you're not using source control to manage the changes that your project will inevitably need, you're making your own life harder and potentially that of others.
Speaking of others.
If you give me a zip file, looking at your code is a pain. I have to download it, unzip it, open the files with a local editor… I won't do that unless I really, really want to see your code.
However having people look at your code is a good thing, something you should strive for. Not only because it helps finding bugs, but because it motivates you to write better code. Code that a lot of people look at has a very noticable tendency of becoming better code. Also, it gives other people a chance to learn from it, work with it or make it better for themselves.
Of course I realize that a lot of people who create mods here don't have much experience in creating and sharing software. Quite often it's somebody who just started out by copying and adjusting some code from an example and wrap it up for delivery. Of course that's fine! Everybody has to start somewhere. Modding a game is probably one of the easiest ways to get into programming. And obviously most people don't start using git on day one of their programming learning curve.
However things move along and at some point you should realize that working without it is just a huge disadvantage. Looking at some of the very big mods I have absolutely no understanding for them not showing any signs of version control. And downloading them from somebody's personal dropbox as a zip file makes me not want to trust them. I automatically assume that they must be badly written, by somebody with no more then a few weeks of programming experience. If you expect my trust, make your code visible without me having to download and unzip an archive.
Though maybe that's just me.
Either way, here's the way I suggest you host your mods: Put the source code up on a github repository (or bitbucket or anywhere else). Chances are github's “download as a zip archive” function will be enough for a usable download (same as git clone). Git itself has become very easy to use, with an abundance of graphical clients especially for Windows users.
The second issue is licensing, which goes a little hand-in-hand with making your code accessible. Beginners tend to be very proud of their creations in the sense that they are afraid somebody might “steal” them. Instead of including a proper licence they write “contact me” or something similar in a thread here on the forums. That's pointless and here's why:
1. Unless you specifically allow people to modify and redistribute your work, nobody is allowed to do so (except for yourself). And don't just say “I release this under the GPL/MIT/whatever licence” in a thread on the forums. Put a copy of the licence where your source code lives (i.e. inside the zip archive).
In return, people are actually more likely to give proper attribution if there is a licence included. Otherwise, if somebody really wants to use your code, they'll have to do it secretly, which is in nobody's best interest.
2. Somebody may have a similar idea and may want to use part of your work as a base. Or they may have an idea how to improve your concept or maybe they just want to fix a trivial bug or a typo. Most open licences will allow them to do that while requiring them to give proper credit to the original creator (i.e. you). Proper version control will also make it trivial to merge their changes back into your own source. That is your code's chance to become something bigger and better. And even if that doesn't happen, other people can still learn from looking at your code. You already went to all the trouble of creating and sharing a mod so I assume “helping others” is a part of your motivation.
3. Consider the possibility that you'll lose interest in developing and maintaining your mod. This happens and it's nothing to be ashamed of. However you should be very much ashamed if you didn't make sure that somebody else, who may potentially come along and feel inclined to adopt your mod, isn't prohibited from doing so. And that prohibition exists automatically unless you specifically include a licence allowing it. To put it in another way: If you ever find something better to do, why would you force your pet to starve instead of giving it up for adoption?
There are plenty of licences to choose from. So many in fact, that it may be a little hard to find a one that fits your needs. However google helps you and there are many sites that explain the fundamental differences of the common licences in an understandable way (e.g. Wikipedia). Here are the most common ones to get you started:
GPL v2, GPL v3, MIT, CC
TL;DR
– “It's my work, I want everybody to use it exactly like I made it” – Grow up.
– “Why would people need my code?” – Learning, understanding, fixing, maintaining, improving, trust,…
– “I don't need a licence for something this small” – Yes you do.
– “I don't need version control” – That just means you haven't properly tried it yet.
Alright, lemme have it.
Disclaimer: I haven't created any Factorio mods myself (yet), but I've written a fair amount of other code, some of which is publicly available.
Straight to the point: Sharing code in a zip archive from a dropbox without a licence is… not ideal.
Managing source code with a version control tool like git is basically a must. It doesn't matter if your project has only 3 files or if it's so simple it's “never going to change anyway”. Factorio is in alpha and by extension, so is every available mod. The recent changes in 0.12, which broke pretty much every single mod, should make that abundantly clear. If you're not using source control to manage the changes that your project will inevitably need, you're making your own life harder and potentially that of others.
Speaking of others.
If you give me a zip file, looking at your code is a pain. I have to download it, unzip it, open the files with a local editor… I won't do that unless I really, really want to see your code.
However having people look at your code is a good thing, something you should strive for. Not only because it helps finding bugs, but because it motivates you to write better code. Code that a lot of people look at has a very noticable tendency of becoming better code. Also, it gives other people a chance to learn from it, work with it or make it better for themselves.
Of course I realize that a lot of people who create mods here don't have much experience in creating and sharing software. Quite often it's somebody who just started out by copying and adjusting some code from an example and wrap it up for delivery. Of course that's fine! Everybody has to start somewhere. Modding a game is probably one of the easiest ways to get into programming. And obviously most people don't start using git on day one of their programming learning curve.
However things move along and at some point you should realize that working without it is just a huge disadvantage. Looking at some of the very big mods I have absolutely no understanding for them not showing any signs of version control. And downloading them from somebody's personal dropbox as a zip file makes me not want to trust them. I automatically assume that they must be badly written, by somebody with no more then a few weeks of programming experience. If you expect my trust, make your code visible without me having to download and unzip an archive.
Though maybe that's just me.
Either way, here's the way I suggest you host your mods: Put the source code up on a github repository (or bitbucket or anywhere else). Chances are github's “download as a zip archive” function will be enough for a usable download (same as git clone). Git itself has become very easy to use, with an abundance of graphical clients especially for Windows users.
The second issue is licensing, which goes a little hand-in-hand with making your code accessible. Beginners tend to be very proud of their creations in the sense that they are afraid somebody might “steal” them. Instead of including a proper licence they write “contact me” or something similar in a thread here on the forums. That's pointless and here's why:
1. Unless you specifically allow people to modify and redistribute your work, nobody is allowed to do so (except for yourself). And don't just say “I release this under the GPL/MIT/whatever licence” in a thread on the forums. Put a copy of the licence where your source code lives (i.e. inside the zip archive).
In return, people are actually more likely to give proper attribution if there is a licence included. Otherwise, if somebody really wants to use your code, they'll have to do it secretly, which is in nobody's best interest.
2. Somebody may have a similar idea and may want to use part of your work as a base. Or they may have an idea how to improve your concept or maybe they just want to fix a trivial bug or a typo. Most open licences will allow them to do that while requiring them to give proper credit to the original creator (i.e. you). Proper version control will also make it trivial to merge their changes back into your own source. That is your code's chance to become something bigger and better. And even if that doesn't happen, other people can still learn from looking at your code. You already went to all the trouble of creating and sharing a mod so I assume “helping others” is a part of your motivation.
3. Consider the possibility that you'll lose interest in developing and maintaining your mod. This happens and it's nothing to be ashamed of. However you should be very much ashamed if you didn't make sure that somebody else, who may potentially come along and feel inclined to adopt your mod, isn't prohibited from doing so. And that prohibition exists automatically unless you specifically include a licence allowing it. To put it in another way: If you ever find something better to do, why would you force your pet to starve instead of giving it up for adoption?
There are plenty of licences to choose from. So many in fact, that it may be a little hard to find a one that fits your needs. However google helps you and there are many sites that explain the fundamental differences of the common licences in an understandable way (e.g. Wikipedia). Here are the most common ones to get you started:
GPL v2, GPL v3, MIT, CC
TL;DR
– “It's my work, I want everybody to use it exactly like I made it” – Grow up.
– “Why would people need my code?” – Learning, understanding, fixing, maintaining, improving, trust,…
– “I don't need a licence for something this small” – Yes you do.
– “I don't need version control” – That just means you haven't properly tried it yet.
Alright, lemme have it.