Open trigger-segfault opened 2 years ago
This should be considered an alteration to the game, because it's no longer clear when // ROCK FOG
's brown high fog colour was really intended to be used.
There are a handful of ice biome levels that also use // ROCK FOG
comments. It's possible the original broken blue-only colour was intended in these levels without realizing it was due to the malformed comments in Lego.cfg.
Additionally, it's hard to tell if the brown high fog colour was intended at all because the paired low fog colour is usually defined as blue.
Frozen Frenzy with the "fixed" fog on the left, and the original broken fog on the right.
Describe the issue
In the standard Lego.cfg configuration file, there are invalid comments used when defining the fog colour values for Rock biomes:
// ROCK FOG
The token
//
is not a valid line comment! (only;
is valid)So when
// ROCK FOG
occurs, these 3 tokens (//
,ROCK
,FOG
) are consumed, throwing off the file's key/value property parsing until the next// ROCK FOG
comment appears on the second line definingHighFogColourRGB
. If these comments did not appear in pairs, the entire Lego.cfg file would have been broken from the start. Instead, onlyHighFogColourRGB
is broken on the offending lines.Config snippet
The offending lines, appearing 15 times in Lego.cfg.
Solution
For the time being, it's safe to assume that the exact string:
// ROCK FOG
will not appear in property keys/values, and that it will only be used in its original form. However, we should not make assumptions about the usage of//
itself, as it could be used as a property value. The solution should aim to fix// ROCK FOG
and only// ROCK FOG
, while maintaining the stance that//
is -and always will be- an invalid comment.In the future, more user-friendly solutions could be created to identify rogue double-slash comments in custom user-made Lego.cfg files. Either by having an option to correct them, or to warn the modder when loading the config file.
Attachments
Below are comparisons of the intended Rock biome fog colour vs. the actual colour.
On the left: The fog colour as it was intended. On the right: The fog colour as we get with the
// ROCK FOG
comments left unfixed.