Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ROCK FOG invalid comments in Lego.cfg #31

Open
trigger-segfault opened this issue Jan 17, 2022 · 1 comment
Open

ROCK FOG invalid comments in Lego.cfg #31

trigger-segfault opened this issue Jan 17, 2022 · 1 comment
Labels
alteration A change to an existing feature. config Related to loading game configuration files. game data bug Misbehavior on interaction with wad files or game assets. original bug This was an issue in the original game already.

Comments

@trigger-segfault
Copy link
Owner

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 defining HighFogColourRGB. If these comments did not appear in pairs, the entire Lego.cfg file would have been broken from the start. Instead, only HighFogColourRGB is broken on the offending lines.

Config snippet

The offending lines, appearing 15 times in Lego.cfg.

    FogColourRGB        110:110:155    // ROCK FOG
    HighFogColourRGB    155:155:110    // ROCK FOG

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.

RockFogBroken1

RockFogBroken2

@trigger-segfault trigger-segfault added config Related to loading game configuration files. original bug This was an issue in the original game already. alteration A change to an existing feature. labels Jan 17, 2022
@trigger-segfault
Copy link
Owner Author

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.

Attachments

Frozen Frenzy with the "fixed" fog on the left, and the original broken fog on the right.

8B5ECB15-0B26-416D-9AF9-DF395B0489FA

@trigger-segfault trigger-segfault added the game data bug Misbehavior on interaction with wad files or game assets. label Sep 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alteration A change to an existing feature. config Related to loading game configuration files. game data bug Misbehavior on interaction with wad files or game assets. original bug This was an issue in the original game already.
Projects
None yet
Development

No branches or pull requests

1 participant