Remove Version requirment from mod folder names

Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Remove Version requirment from mod folder names

Post by Nexela »

2 Slightly related requested changes regarding unzipped mods:

#1 Unzipped mods should not be required to have the version # appended to it.

If someone makes changes to a mod that include a change in version in info.json # (i.e new migrations/on_config_changed etc), they now have to rename all of their folders with the new version # before they can test their changes. This gets doubly annoying if the mod being tested has some sort of Version Control system and you are constantly going back and for between 2 (or more) versions for testing/fixes

#2 Unzipped mods should be ignored when updating in game (or have some way of manually clicking to add them to the update list). Chances are a config change or other local change was made and upgrading without thinking can throw this out the windows.

Just my 2 cents.

User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 2124
Joined: Thu Jun 12, 2014 3:05 am
Contact:

Re: Remove Version requirment from mod folder names

Post by Ranakastrasz »

Same here. If there was an easy way to use git or similar with a folder that keeps changing name, this is fine. But there isnt, so its a problem.

This is my second least favorite part of nodding. Worst part is getting migration scripts to work.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16

Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: Remove Version requirment from mod folder names

Post by Nexela »

Ranakastrasz wrote:Same here. If there was an easy way to use git or similar with a folder that keeps changing name, this is fine. But there isnt, so its a problem.

This is my second least favorite part of nodding. Worst part is getting migration scripts to work.
Migrations are easy. .json for swapping one item to another, .lua to change anything in game. (but no global)

User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1190
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: Remove Version requirment from mod folder names

Post by Mooncat »

I like #1. The most troublesome part for the current approach IMO is the need to set up the whole workspace again after changing the mod folder name, thus the references to files are lost.

I'm not sure about #2. Unzipped mods are supposed to be used for quick testing. If the changes are not recognized by the game, it will lose their purpose.
But I guess manual update will do the job, according to FFF #168.

Ranakastrasz wrote:Same here. If there was an easy way to use git or similar with a folder that keeps changing name, this is fine. But there isnt, so its a problem.
You can create a folder above the mod folder and use it as a repo, so changing the mod folder name will not affect the reference to that repo. ;)

Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: Remove Version requirment from mod folder names

Post by Nexela »

Mooncat wrote:I like #1. The most troublesome part for the current approach IMO is the need to set up the whole workspace again after changing the mod folder name, thus the references to files are lost.

I'm not sure about #2. Unzipped mods are supposed to be used for quick testing. If the changes are not recognized by the game, it will lose their purpose.
But I guess manual update will do the job, according to FFF #168.

Ranakastrasz wrote:Same here. If there was an easy way to use git or similar with a folder that keeps changing name, this is fine. But there isnt, so its a problem.
You can create a folder above the mod folder and use it as a repo, so changing the mod folder name will not affect the reference to that repo. ;)
Symlinks/junctions are your friend here as the only thing you need to change is the shortcut name in the mods folder. Which is still a pain and hence the change

Factorio/Devel/name_of_repository -- your mod code here

Factorio/Mods/name_of_repositry_0.0.0 -- junction to name_of_repository

As for #2 if a mod is unzipped it is typically for a reason i.e. config change or some other changes in a mod pack

User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 2124
Joined: Thu Jun 12, 2014 3:05 am
Contact:

Re: Remove Version requirment from mod folder names

Post by Ranakastrasz »

While I can make it inside another folder, and make that an archive instead, if I do that the comparison function fails since literally everything changes when I change the version.

Where Can I learn about "Symlinks/junctions?"
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16

Rseding91
Factorio Staff
Factorio Staff
Posts: 13175
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Remove Version requirment from mod folder names

Post by Rseding91 »

Nexela wrote:#1 Unzipped mods should not be required to have the version # appended to it.
That would defeat the entire purpose of the requirement if it wasn't there for unzipped.
Nexela wrote:#2 Unzipped mods should be ignored when updating in game (or have some way of manually clicking to add them to the update list). Chances are a config change or other local change was made and upgrading without thinking can throw this out the windows.
The game makes no differentiation between zipped or unzipped mods as that would make no sense. If someone does manual modification of a mod then it's up to them to handle those changes.
If you want to get ahold of me I'm almost always on Discord.

Yoyobuae
Filter Inserter
Filter Inserter
Posts: 499
Joined: Fri Nov 04, 2016 11:04 pm
Contact:

Re: Remove Version requirment from mod folder names

Post by Yoyobuae »

So I decided to cook up a quick solution for myself:
http://sprunge.us/cWYC

Code: Select all

#!/bin/sh

DEPLOY_DIR=__user_folder__/mods/
MOD_NAME=${1%/}
MOD_VERSION=$( cd ${MOD_NAME} ; python << 'EOFEOF'
import json
with open("info.json") as file:
	print(json.load(file)[u'version'])
EOFEOF
)
git --git-dir=${MOD_NAME}/.git archive --format zip --output ${DEPLOY_DIR}/${MOD_NAME}_${MOD_VERSION}.zip master
It's a small shell script which finds out the mod version from the JSON file and creates a zip file at the right location with the right name. Now I can just keep my mods in a separate dir without the version in the dir name.

Just replace __user_folder__ accordingly.

User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7351
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: Remove Version requirment from mod folder names

Post by bobingabout »

Nexela wrote:If someone makes changes to a mod that include a change in version in info.json # (i.e new migrations/on_config_changed etc), they now have to rename all of their folders with the new version # before they can test their changes. This gets doubly annoying if the mod being tested has some sort of Version Control system and you are constantly going back and for between 2 (or more) versions for testing/fixes
I can agree this is annoying. it caused no end of problems for my 3rd party locale mod, in that one version was updated, where the other wasn't, and vica verca. long story short, they didn't match, which caused an issue.

As a modder myself though, it is a pain in the arse making sure they both match all the time. I never used to have a number on my folders, just the zip file when I made one, and that worked fine for me until the version requirement came in, then it was a huge headache.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: Remove Version requirment from mod folder names

Post by Nexela »

I just don't understand the version requirement at all. It reads the info.json to tell you that it doesn't match so......

orzelek
Smart Inserter
Smart Inserter
Posts: 3911
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: Remove Version requirment from mod folder names

Post by orzelek »

Nexela wrote:I just don't understand the version requirement at all. It reads the info.json to tell you that it doesn't match so......
This is the part I don't really understand.
It needs to look into zip anyway to grab the json and read the version number. So why it also needs folder name to have the version?

When mod is extracted folder name needs to match mod name afaik but why need the version in there if you have it in json.

User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7351
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: Remove Version requirment from mod folder names

Post by bobingabout »

There was a reason for it given when they decided to add it in the first place. I think it was somewhere mid 0.11 or something, I forget. But there should still be a topic floating around somewhere that details why they added it.

But yeah, the obvious answer is: so you can tell at a glance what version you have installed... and although this might be useful for a zip file you've downloaded... the necessity is lost, I mean, it's right there in the json file. There's no logical reason I can think of WHY you NEED it, especially considering it loads the json files to get the version numbers anyway, and instead of loading the mod, throws and error telling you it has no version number in the zip/folder name. Just load the damn mod!
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

danielbrauer
Long Handed Inserter
Long Handed Inserter
Posts: 93
Joined: Thu May 18, 2017 2:22 pm
Contact:

Allow uncompressed mod folders without version

Post by danielbrauer »

Like many modders, I'm using git to version my work. This works nicely except when I have to bump the version number. The process is:
  • Close the VSCode workspace
  • Close the repo in SourceTree
  • Rename the folder
  • Open the workspace again
  • Change the info file to match
  • Open the repo again
  • Commit
If Factorio allowed mod folders without a version number (as a special case: it should still check that they match if they're there), the process would look like this:
  • Change the info file
  • Commit
Ooh, that would be so satisfying...

Bilka
Factorio Staff
Factorio Staff
Posts: 3123
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Remove Version requirment from mod folder names

Post by Bilka »

Merged the above post into this older topic.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

danielbrauer
Long Handed Inserter
Long Handed Inserter
Posts: 93
Joined: Thu May 18, 2017 2:22 pm
Contact:

Re: Remove Version requirment from mod folder names

Post by danielbrauer »

I feel like I’ve missed the original premise: what’s the reason for the version number requirement for folders?

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Remove Version requirment from mod folder names

Post by darkfrei »

danielbrauer wrote:
Sat Apr 13, 2019 4:40 pm
I feel like I’ve missed the original premise: what’s the reason for the version number requirement for folders?
Only this way you can have more than one version simultaneously.
But why we need more than on unzipped mod folder - real question.

danielbrauer
Long Handed Inserter
Long Handed Inserter
Posts: 93
Joined: Thu May 18, 2017 2:22 pm
Contact:

Re: Remove Version requirment from mod folder names

Post by danielbrauer »

You could still have more than one version if one was allowed without a version number. The one without the version number should just take precedence.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13175
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Remove Version requirment from mod folder names

Post by Rseding91 »

danielbrauer wrote:
Sat Apr 13, 2019 4:40 pm
I feel like I’ve missed the original premise: what’s the reason for the version number requirement for folders?
The primary reason: so everyone can quick and easily see which version of which mod is in the mod(s) folder.

The other benefits:

* It makes for an easy way to have multiple of the same mod installed without having to go change otherwise working mods.
* It gives a consistent naming scheme for mods

But at the end of the discussion it doesn't matter what anyone else says here we are not changing it.
If you want to get ahold of me I'm almost always on Discord.

danielbrauer
Long Handed Inserter
Long Handed Inserter
Posts: 93
Joined: Thu May 18, 2017 2:22 pm
Contact:

Re: Remove Version requirment from mod folder names

Post by danielbrauer »

Ok so one last possibility: a “development mode” option for Factorio which loosens the naming requirement for mod folders. Obviously I don’t know the complexity of the code involved, but that seems like it shouldn’t be too much work to maintain, considering how many modders would appreciate it. It also feels like most users wouldn’t touch such an option, so you’d still get the benefits of strict naming requirements for 99% of your user base.

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Remove Version requirment from mod folder names

Post by darkfrei »

Rseding91 wrote:
Sun Apr 14, 2019 3:47 pm
The primary reason: so everyone can quick and easily see which version of which mod is in the mod(s) folder.

The other benefits:

* It makes for an easy way to have multiple of the same mod installed without having to go change otherwise working mods.
* It gives a consistent naming scheme for mods
Is it about zip archives or about folders? On mod creating I haven't any archive, but only one version of folder. On mod using I haven't any folder, but a lot of archives, I can see the version of them.

Post Reply

Return to “Implemented mod requests”