Source management and Licensing for Mods

Place to post guides, observations, things related to modding that are not mods themselves.
User avatar
Gandalf
Filter Inserter
Filter Inserter
Posts: 294
Joined: Fri Dec 19, 2014 10:15 pm
Contact:

Source management and Licensing for Mods

Post by Gandalf »

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.
OS: Linux Mint 19 x64 | desktop: Awesome 4.2  |  Intel Core i5 8600k  |  16GB DDR4  |  NVidia GTX 1050 Ti (driver version: 410.104)    (2019-03)
Bisa
Filter Inserter
Filter Inserter
Posts: 450
Joined: Fri Jul 17, 2015 3:22 pm
Contact:

Re: Source management and Licensing for Mods

Post by Bisa »

Where is the "like" button?
Hosting a factorio server? Take a look at this || init script ||.
OBAMA MCLAMA
Filter Inserter
Filter Inserter
Posts: 337
Joined: Fri May 30, 2014 4:23 am
Contact:

Re: Source management and Licensing for Mods

Post by OBAMA MCLAMA »

I already have git, but not for a mod :)

+like.
This is good brain food right here. I completly agree with all of the above.
When i stream twitch i always answer questions and try to help, come visit me.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14334
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Source management and Licensing for Mods

Post by Rseding91 »

When I moved my mods into my Github repository it was amazing :) the change history alone is worth every second of time it took to move them in there and now I don't need to worry about "where's that copy of the mod last time I updated it?..." - it's on the repo.

I guess I should just link my Github page In my signature for anyone wanting to look at the mods I have. It sounds easier than linking each one on each of my mods page.
If you want to get ahold of me I'm almost always on Discord.
SpeedyBrain
Long Handed Inserter
Long Handed Inserter
Posts: 77
Joined: Wed May 20, 2015 12:08 am
Contact:

Re: Source management and Licensing for Mods

Post by SpeedyBrain »

I have a local repository. The only reason why I don't use github for my mods is that I want to see how many people downloaded it!
I want to know if people are interested in my mod and if it's worth developing it. Github doesn't show me how many people downloaded or cloned my mod.
ImageImageImageImage
Bisa
Filter Inserter
Filter Inserter
Posts: 450
Joined: Fri Jul 17, 2015 3:22 pm
Contact:

Re: Source management and Licensing for Mods

Post by Bisa »

SpeedyBrain wrote:I have a local repository. The only reason why I don't use github for my mods is that I want to see how many people downloaded it!
I want to know if people are interested in my mod and if it's worth developing it. Github doesn't show me how many people downloaded or cloned my mod.
are you sure the "inconvenience" of not seeing downloads is not disclosed by the statistics page:
https://github.com/USER/REPO/graphs/traffic
I can see a "popular content" section on my page, surely a zip counts as content and thus would be shown? (I could be wrong)
Hosting a factorio server? Take a look at this || init script ||.
Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: Source management and Licensing for Mods

Post by Choumiko »

This also bugged me a little. So since 0.12 I'm linking to the release and not the zip directly (they don't show up in traffic). This at least gives me a rough idea of downloads
User avatar
SHiRKiT
Filter Inserter
Filter Inserter
Posts: 706
Joined: Mon Jul 14, 2014 11:52 pm
Contact:

Re: Source management and Licensing for Mods

Post by SHiRKiT »

I use source control for EVERYTHING.
kiba
Filter Inserter
Filter Inserter
Posts: 344
Joined: Thu Jun 11, 2015 5:32 am
Contact:

Re: Source management and Licensing for Mods

Post by kiba »

I know that modders in general are not submerged in the open source ethos, but please do not use non-commercial licenses. It makes it incompatible for sharing with mods that are much more liberal in their licensing.

The most willing I am accepting is GPL or CC-BY-SA, but those are incompatible for sharing back with my preferred license, which is MIT.

The more permissive your licensing is, the more the community as a whole benefit.

[DIsclaimer: I am working on a mod that I have not yet released. I am planning to license it under the MIT.]
Bisa
Filter Inserter
Filter Inserter
Posts: 450
Joined: Fri Jul 17, 2015 3:22 pm
Contact:

Re: Source management and Licensing for Mods

Post by Bisa »

kiba wrote:I know that modders in general are not submerged in the open source ethos, but please do not use non-commercial licenses. It makes it incompatible for sharing with mods that are much more liberal in their licensing.
Wait, isn't this contradicting itself - are you sure you did not meant to write "please use non-commercial licenses" as this makes it easier to share?

I could misunderstand exaclty what "non-commercial lcense" means tho, in that case - please ignore my comment.
Hosting a factorio server? Take a look at this || init script ||.
kiba
Filter Inserter
Filter Inserter
Posts: 344
Joined: Thu Jun 11, 2015 5:32 am
Contact:

Re: Source management and Licensing for Mods

Post by kiba »

Bisa wrote: Wait, isn't this contradicting itself - are you sure you did not meant to write "please use non-commercial licenses" as this makes it easier to share?

I could misunderstand exaclty what "non-commercial lcense" means tho, in that case - please ignore my comment.
It makes it harder to share.

For example, the MIT's license usually required only attribution, at least that's the nutshell. Otherwise, You can use it for any purpose, for any reason, without paying a cent to the original developer.

If your license has a non-commercial restriction, it means that you cannot use the mods for commercial purpose, like selling it. Those restriction is against the ethic code of some software community.

In reality though, it's unlikely that one mod's will be sold or used for some kind of commercial purpose. Even GPLed code are rarely sold, even though there's nothing to prevent people from selling GPLed code. But it nonetheless impact the community at large because you can't use non-commercial restricted code in MIT licensed code.
Bisa
Filter Inserter
Filter Inserter
Posts: 450
Joined: Fri Jul 17, 2015 3:22 pm
Contact:

Re: Source management and Licensing for Mods

Post by Bisa »

I see, thank you for clearing that out for me
Hosting a factorio server? Take a look at this || init script ||.
Zequez
Long Handed Inserter
Long Handed Inserter
Posts: 64
Joined: Sat May 03, 2014 2:59 am
Contact:

Re: Source management and Licensing for Mods

Post by Zequez »

I'm glad someone it's speaking up on the issue! Github also let's you create releases with the zipped files for specific versions, and you can host releases up to 2GB in size, so virtually no one would have issues with the file sizes.
SpeedyBrain wrote:I have a local repository. The only reason why I don't use github for my mods is that I want to see how many people downloaded it!
I want to know if people are interested in my mod and if it's worth developing it. Github doesn't show me how many people downloaded or cloned my mod.
You can use the Github API to get the number of downloads of each release! For example, here is the information of all the releases of DyTech, which is hosted in Github.

I will probably be able to read this data for use in FactorioMods to automatically create releases in the web app after they're created on Github!
SpeedyBrain
Long Handed Inserter
Long Handed Inserter
Posts: 77
Joined: Wed May 20, 2015 12:08 am
Contact:

Re: Source management and Licensing for Mods

Post by SpeedyBrain »

Zequez wrote:
SpeedyBrain wrote:I have a local repository. The only reason why I don't use github for my mods is that I want to see how many people downloaded it!
I want to know if people are interested in my mod and if it's worth developing it. Github doesn't show me how many people downloaded or cloned my mod.
You can use the Github API to get the number of downloads of each release! For example, here is the information of all the releases of DyTech, which is hosted in Github.

I will probably be able to read this data for use in FactorioMods to automatically create releases in the web app after they're created on Github!
Thank you for the information. I'll consider switching to github for future releases :)
ImageImageImageImage
User avatar
Narc
Filter Inserter
Filter Inserter
Posts: 279
Joined: Mon Feb 11, 2013 7:25 am
Contact:

Re: Source management and Licensing for Mods

Post by Narc »

Ah-ha! Thank you!

I'd been curious about the download count for evoGUI, but not enough to actually want to host it myself via my click-counting redirector. Now I don't even have to think about that.
User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12889
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Source management and Licensing for Mods

Post by ssilk »

See also the Mod-Header discussion: https://forums.factorio.com/forum/vie ... 89&t=13692

The current looks like so: https://forums.factorio.com/forum/vie ... 91&t=13835
But many choose also something more like: https://forums.factorio.com/forum/vie ... 89&t=13493
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Cooolaid
Long Handed Inserter
Long Handed Inserter
Posts: 85
Joined: Sat Jul 18, 2015 8:48 pm
Contact:

Re: Source management and Licensing for Mods

Post by Cooolaid »

I want to chime in on this in regards to Open Source or as people call it (Mod Source Files).
I think it should become a rule in these forums, that anyone who creates a mod for Factorio and posts the mods on these forums should be mandated to also post the most updated Mod Source Files for the particular mod that's been posted.
Reason would be is,
if the mod developer goes on a long hiatus or falls off the face of the earth and nowhere to be found,
can have people who are capable of coding in Lua to be able to update the mod as necessary and appropriate to whatever factorio version is released.

This would some what prevent mods from dying out because the creator of that particular mod went on a long hiatus or fall off the face of the earth and nowhere to be found.

Currently I used to played with a few previous mods in v11+ ("now going on 7+ mods") and now I cant anymore because the mod creator can't no longer be found and no Source file was left on post to have it updated to the newer version of Factorio.
So now I am left with mods I cant play with any longer because the mods can not be updated by someone with Lua experience to update them.

Hence the reason why I am requesting that any mod developer who creates a mod, must also post an updated source with each mod update they post, so things like this are prevented in the future.
People get hooked on certain mods. I just want to make sure that they are always available to players that's all.

thanks for reading :)
Bisa
Filter Inserter
Filter Inserter
Posts: 450
Joined: Fri Jul 17, 2015 3:22 pm
Contact:

Re: Source management and Licensing for Mods

Post by Bisa »

While I strongly advocate open source licensing I'm also against enforcing it on people.

Rather than forcing it on mod authors I'd rather the educated masses kindly inform them that "hey, we really like your mod but please see [argument 1], ... and [argument n] as to why open source licensing is a good thing" If they disagree, that's their choice and I hope that can be respected.
Hosting a factorio server? Take a look at this || init script ||.
Cooolaid
Long Handed Inserter
Long Handed Inserter
Posts: 85
Joined: Sat Jul 18, 2015 8:48 pm
Contact:

Re: Source management and Licensing for Mods

Post by Cooolaid »

Thats all well and good, but right now im sitting on 27+ mods and still counting, that are currently dead or severely neglected due because the mod dev for those mods are no where to be found.

Second note., it will be much harder for people to find themselves upgrading to newer versions of the game, which defeats the purpose of the game developers to make available new features & versions of the game,
when many players will avoid upgrading to newer versions of the game, because players want to play with the mods they like a lot, but wind up being dead on newer game versions due to the unavailability of the mod devs to upgrade them.

So basically it hurts the actual game itself and the creator of the game.
because many people will not want to upgrade, due to the fact that the players know that the mod has been abandoned or severely neglected on newer iterations of the game.
Its like a catch-22 , and noone seems to learn from it. - We keep doing the same crap over and over hitting the same brick wall over and over and yet no one is learning anything about it or doing something about it.
I dont know why people don't learn from this. This keeps happening over and over with so many games like this that has modding capabilities.
IMHO, A mod should be created only ONCE, and that mod should carry for the life duration of the actual game. and updates for those mods should only carry out for bugs and new features of that particular mod.
But it seems people have not developed that concept yet.
With so many intelligent people in this world, its horrifying that we have yet to make this happen in the gaming industry. yet we keep doing the same old thing over and over and never learning from it & do something better..

I dont know whats so hard to post up a source file until we find a solution for a better way. why people are making it so difficult I have no clue.
Maybe this is one of the main reasons why it takes so long for anything to get done. because people keep doing the same mistakes over and over without evolving to newer ways of doing things.

Im sorry if I sound heated, im just getting fed up and tired of the same crap with so many games that allow mods to be implemented.
its a never ending problem and it needs a fix. Every time a new version of the game comes out, a bunch of mods wind up being neglected and abandoned.
Its frustrating.
ratchetfreak
Filter Inserter
Filter Inserter
Posts: 952
Joined: Sat May 23, 2015 12:10 pm
Contact:

Re: Source management and Licensing for Mods

Post by ratchetfreak »

Cooolaid wrote:I want to chime in on this in regards to Open Source or as people call it (Mod Source Files).
I think it should become a rule in these forums, that anyone who creates a mod for Factorio and posts the mods on these forums should be mandated to also post the most updated Mod Source Files for the particular mod that's been posted.
Code in mods is in plain readable (for as much as typical code will be) LUA. Open one up and check it out.

unless the author does an obfuscation step before packing for release then you have the same files that he uses to write it.
Post Reply

Return to “Modding discussion”