docsReading time: 4 minutes

Game Configuration

Set the basic game information

When starting a fresh game project with the LITIENGINE, we encourage you to give your baby a name. Also, some additional information might be very useful, like the game's version, author(s) or the website. For this purpose, we've created the GameInfo class. It holds all the metadata of your game and can be accessed via There are basically two ways to set your information:

  • Directly from code, using
  • Via XML File by calling Game.setInfo("gameinfo.xml")

Setting game info from code:

// set meta information about the game"My Testgame");"Made with LITIENGINE!");"v1.0.0");"");

Example XML file:

<?xml version="1.0" encoding="UTF-8"?>
 <name>My Testgame</name>
 <subtitle>Made with LITIENGINE!</subtitle>
 <description>A game, that was implemented with the LITIENGINE.</description>
 <developer>Steffen Wilke</developer>
 <developer>Matthias Wilke</developer>

You need to set this information before Game.init() is called, because some of this information is used by the LITIENGINE to e.g. set the default JFrame title of the game.

Configure Default Behavior and Appearance

All of the components that are provided by the LITIENGINE come with a reasonable default configuration. However, they might not be applicable to your type of game which is why you should at least know about these configurations to be able to adjust them when necessary.

  • Encoding for textual Resources (default: Resources.ENCODING_ISO_8859_1) For some languages, you might prefer to store your text files with UTF-8 encoding. You can make the LITIENGINE aware of this by calling Resources.setEncoding(Resources.ENCODING_UTF_8).
  • Base Render Scale (default: RenderEngine.DEFAULT_RENDERSCALE = 3.0) Depending on what type of Art Style you're going for, it is not uncommon to render the game with an adjusted render scale. A good example would be 8-Bit pixel art. Rendering such a game at a scale of 1 would not be very practical for today's high-resolution monitors. You can adjust this by calling
  • UI properties If you intend to use our GUIComponents you might want to have a deeper look into the GuiProperties class. It provides global default appearance settings for all GUIComponents e.g. you can set a default Font by calling GuiProperties.setDefaultFont(Resources.getFont("some-font.ttf")).
  • Custom Mouse Cursor If you intend to use the Mouse to control your LITIENGINE game you should consider providing a custom Cursor Image., 16, 16);

Game Configuration File

When you want to Configure a LITIENGINE Game, there are also configurations that might have to be changed by the player or developer on the fly without changing the actual implementation. This includes things like Soundvolume, Resolution, Mouse Sensitivity or Debugging options. LITIENGINE Games store this information in a file in the application's execution folder. If no such file exists, the Game will create one for you with all default values upon starting up the game for the first time. When deploying your game, it is recommended to provide a default configuration file for your players with values that you consider reasonable for your game. The configuration is organized in ConfigurationGroups with a custom prefix each. You can also provide custom groups that hold configuration relevant only for your particular game.

Add Custom ConfigurationGroup:

MyCustomConfigurationGroup customGroup = new MyCustomConfigurationGroup();

// Example for a custom configuration group
@ConfigurationGroupInfo(prefix = "custom_")
public class MyCustomConfigurationGroup extends ConfigurationGroup {
  private int myInt = 123;

  public int getMyInt(){ return this.myInt }

  public void setMyInt(int myInt){ this.myInt = myInt; }

Configuration File Excerpt:


Logging Configuration

The LITIENGINE uses the java.util.loggingframework to log information and errors. It is possible to configure the output of the logging by providing a file in the Game's execution directory. You can read more about this HERE.

Example Logging Configuration file

handlers=java.util.logging.FileHandler, java.util.logging.ConsoleHandler


java.util.logging.FileHandler.limit = 50000
java.util.logging.FileHandler.count = 1

Hades948Last updated 1 year ago
On this page