With the tutorial, I've tried to educate modders about writing changelogs that make use of the great abilities of the in-game parser. When I posted the first version, what little information I could provide came from comparing changelogs that did parse correctly against others that didn't. It was based mainly on guesswork, and some things I'd figured out were incorrect or incomplete, but with very helpful input from the community and developers (thanks again, Bilka!), and after playing around with several "real" changelogs to find mistakes, I was able to add a lot of information over time. (It's still WIP; just as I'm writing this, somebody has pointed out a new problem in the other thread.)
By now, I've probably spent more time carefully looking over non-working changelogs than most people who care to read this. I think I know all of the common errors, and I've even found some of the rarer ones. Therefore, I believe I can rightfully claim to be quite competent in changelog matters now.
In the past few weeks, quite a number of changelogs had entries like "Added changelog", or "Fixed changelogs not showing in game". This clearly shows that many modders are willing to provide parsable changelogs once they've learnt about what is needed.
There definitely are bugs that are clearly down-to-earth bugs, and it is perfectly OK that parsing such a bug results in an error. I'm thinking of the header line starting with a dot instead of a dash, for example, or the missing line break in front of the header line (so it was glued to the end of the previous line). But there are also bugs that are really hard to find, and completely unnecessary. A space after a colon results in an error? An empty line, with just a tabulator before the line break, breaks parsing? So does a header line with 100 instead of 99 dashes? No, this can't be serious! That must be somebody's idea of a joke, but it's a bad joke by my book.
In my opinion, there are two things you could do to help modders write working changelog files:
- Relax the rules, for example by using a kind of pre-processor that converts wrong changelog files to the right format! Most minor mistakes could be caught with regular expressions. I'll use sed-commands in the following, but I guess C and Lua allow for regular expressions as well.
- Globally replace tabs with a space:
Code: Select all
's/\t/ /g'
- Delete empty lines, including lines that contain only spaces:
Code: Select all
'/^ *$/d'
- Make sure the first line is a header line:
Code: Select all
'1 s/^ *\([^-][^-].\+\)$/---------------------------------------------------------------------------------------------------\n\1/'
- Make sure the last line is not a header line:
Code: Select all
'$ s/^ *-\+ *$//'
- Make sure all headerlines have the required format:
Code: Select all
's/^ *-\+ *$/---------------------------------------------------------------------------------------------------/'
- Delete lines with empty Date fields:
Code: Select all
'/^ *[Dd][Aa][Tt][Ee] *: *$/d'
- Correctly format Version lines:
Code: Select all
's/^ *\[Vv][Ee][Rr][Ss][Ii][Oo][Nn] *:\(.\+\)*$/Version: /\1/'
- Correctly format any remaining Date lines:
Code: Select all
's/^ *[Dd][Aa][Tt][Ee] *: *\(.\+\) *$/Date: \1/'
- Make sure the other field/category names are formatted correctly:
Code: Select all
's/^ *\([^:]\+\) *: *-* *\(.\+\) *$/ \1:\n - \2/'
- Make sure the actual entries are indented correctly:
Code: Select all
's/^ *-* *\(.\+\) *$/ - \1/'
- Just to make sure, remove any trailing spaces:
Code: Select all
's/ *$//'
- Globally replace tabs with a space:
- … the error messages. Make them more expressive, please! A message like this is good: because it tells exactly what is wrong here. But a message like
Code: Select all
Failed to parse changelog for mod [insert mod name here]: invalid changelog file, error on line 4, missing category.
doesn't give any clue what could be wrong. Considering that most of the buggy files fail to parse because of too many (or not enough) spaces or dashes, or because they contain the wrong kind of white space characters (i.e. tabulators), such error messages are not really useful.Code: Select all
Failed to parse changelog for mod [insert mod name here]: invalid changelog file, error on line 123.