SLUDGE

.ini Files for Compiled SLUDGE Games


When a game is launched, the SLUDGE engine also attempts to read a file of initialisation settings. On Windows, SLUDGE puts settings and saved games in the AppData folder, on Mac it's ~/Library/Application Support, and on Linux it's $HOME/.sludge-engine/. In that folder, SLUDGE looks for (or makes) a folder with the name of the game. That's where the file with the initialisation settings should be. The file must have the same name as your compiled game file, but with the extension ".ini". For example, if the compiler builds you a compiled game file called "Turnip Quest VI.slg" your settings file would be called "Turnip Quest VI.ini". If you're going to rename your file so that it's called "mygame" or "mygame.dat" or "mygame.001" or something, your settings should be in a file called "mygame.ini". (If no matching file is found, that's fine... the game will run with the default settings.)

SLUDGE will write the current settings to that file after the startup window so that they'll be remembered.

So, what can go in an .ini file? Well, the list is growing.

Choice of language

LANGUAGE=

If the SLUDGE game's .ini file contains a line which starts with "LANGUAGE=" the rest of the line is used as the ID number of the language the game should be played in. For more information, read how you can use multiple Languages in a Single Game.

If no such line exists, or the .ini file does not exist, the default language ID is used - 0, meaning no translation.

Run game in a window

WINDOW=

If the game's .ini file contains a line which starts with "WINDOW=" the rest of the line defines whether the game should be run in a forced to run in a window. A non-zero number (for example, 1) means the game should be forced to run in a window. A value of "0" or anything else means it shouldn't. (Note that if the compiled game isn't meant to run full screen, this value won't force it to run full screen. It will have no effect.)

If no such line exists, or the .ini file does not exist, the default is 0. The game won't be forced to run in a window.

Anti-aliasing

ANTIALIAS=

Turns anti-aliasing on (a value of 1) or off (a value of 0).

Disable scaling

FIXEDPIXELS=

If the FIXEDPIXELS setting is non-zero, the engine disables the scaling of the game and simply creates a window with the exact size specified by the game.

Disable startup window

NOSTARTWINDOW=

If the NOSTARTWINDOW setting is non-zero, the engine won't display the settings window at startup.

Debugging the engine

DEBUG=

If the DEBUG setting is non-zero, the engine will write debugging information to a file named "debuggy.txt" in the same folder as the ini file. This is only useful for debugging the engine, and is off by default.

Other lines in the .ini file

You may not store any additional data in the file along with the above data, since anything else will get overwritten. Instead, you can store your own settings in another .ini file, and then read them using your own code using loadCustomData.