Best Practices

LilBudyWizer

Warlord
Joined
Nov 11, 2014
Messages
166
I thought maybe a best practices thread would be good. I know nothing about modding or javascript so I can't address anything technical. Hopefully others might do that. As a user I find one particular thing helpful. That is versions.

I found it was sometimes useful at this early stage to go back to previous versions. I am unfamiliar with the site and didn't see a readily apparent way to download a specific version. I found it challenging to figure out what version of a mod I was running in many cases. I had to just make up something at the start for some. Once I started archiving it was easy to tell since I rename the download to include version number. So far everything I've seen has a version number on this site. It seems to be a required field. I'm not sure it's actually required to change though. It seems I found one that just used the same version number, but I'm not positive about that. I don't really care the format as long it's clear what's oldest to newest. It seems whatever you put ought to be the official version since it's downloads from this site.

There is a version in ModInfo. That gets loaded into a database into an integer field, but it's a string in ModInfo. Anything that doesn't parse to a number, such as "Bob", goes to zero when it's loaded. Anything such as "0.1", "0.1.2" and 0.1.2.3" all goes to zero, but "1.1" goes to 1 and "2.3" goes to 2. There is a disabled flag in the table which seems to be set to null any time a new version is brought in. If it's one the mod is disabled. If you disable the mod then reenable it then it becomes zero. I tried modifying a javascript file and it didn't go back to null, but changing the ModInfo file did set it back to null. I just added a space so it's using the date changed timestamp. That information is available in game through the Modding variable, but I haven't figured out how to use it. It would seem a good idea to use something meaningful which is an integer since everything else gets lost. It seems to be setup for sequential numbering, but major.minor.trivial would work if done as a large integer such at 10203 for 1.2.3 and 101 for 0.1.1. Leading zeroes are going to get lost. ModInfo is just an XML file with a different suffix so you can put in comments with <!-- comment -->. It won't be accessible in game but might be useful when browsing files. It just seems something ought to be in ModInfo tying it back to the version on this site.

It would be nice to have the version in the download file name. It's a good practice to keep copies of what you uploaded since you may belatedly find you introduced an error a few versions back. If you use a separate directory for each version or version control software it isn't as important for the developer. It is useful for the user though for archiving previous versions. While simply extracting a zip produces a directory it would be best not to do that with version numbers in the file name. If you stick the same mod in different directories they get loaded. I haven't experimented much with it but it may resolve to the newest version if they have different version numbers in ModInfo. That's a potential downside with the version number in the file name. Along the same lines it's nice to have a directory you can just move out the zip and into the mods directory. I always delete the previous version and sometimes end up having to create a new directory by hand.

A changelog, readme is always nice to have when browsing files, but this site provides an update history which is where I would mostly use it. When all else fails it can certainly help resolve what version is this. Since I learn by browsing it is nice to bring up a change log in the editor rather than switching back to the website. Copy and paste between the two would seem to make it not too difficult to maintain. Since it's only going to be used by those browsing the files an overview from a programmer perspective would be nice. Like what files, functions, resources and such were changed. Often times the entire mod is a bit much for me, but I'm interested in how a specific change was implemented. Keeping such things up can be a bit of a hassle for newbies though I assume it's routine for more seasoned modders.

Just my thoughts. I'm not too certain on those thoughts or it would be a lot shorter. I would appreciate people's thoughts.
 
Back
Top Bottom