Skip to content

Configure Your Game – Configuration Files Made Easy by Play!

This Post is simply making a statement about the usefulness and simplicity of Typesafe Config Library within Play! I used it because I needed to balance my Monsters’ strengths. Things like health, offense, damage and defense should be configurable and best be very distinct from Monster to Monster.

What would be easier than having them quickly available in a config file rather than in DB? For tweaking and testing this is enough and it keeps me going.

You can do that quite easy too:

  1. Put a the file into your Play /conf folder, named yourname.conf
  2. Load the file using the name:
  3. Access the config file properties via

     

Here is how I proceeded loading the Werwolf properties from the werwolf.conf document into the corresponding Java class:

config

 

Have fun configuring!