about summary refs log tree commit diff homepage
path: root/docs/source/config.rst
blob: d3aed3f90147f5aba6c6c515d8e86b5939f21788 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
Configuration
=============

Configuration Files
-------------------

At the time of writing, this is the default configuration file:

.. code-block:: ini

   [Graphics]
   Screen width: 640
   Screen height: 480
   # FPS should not be greater than refresh rate.
   Maximum FPS: 60

   [Sound]
   Muted: no
   # Volume must be between 0.0 and 1.0.
   Music volume: 1.0
   # Use space music background, which sounds cold and creepy.
   Space theme: no

   [Control]
   # Touch-friendly control
   Touch: no
   # Input values should be either from Mouse1 to Mouse3 or a keyboard key
   # and they are case-insensitively read.
   # Aliases for special keys are listed here (without the K_ part):
   # http://www.pygame.org/docs/ref/key.html
   # Key combinations are not supported.
   New game: F2
   Toggle pause: p
   Toggle mute: m
   Move left: a
   Move right: d
   Move up: w
   Move down: s
   Long-range attack: Mouse1
   Close-range attack: Mouse3

   [Record]
   # Directory to write record of game states, leave blank to disable.
   Directory:
   # Number of snapshots per second. This is preferably from 3 to 60.
   Frequency: 30

   [Server]
   # Enabling remote control will disable control via keyboard and mouse.
   Enable: no
   Host: localhost
   Port: 42069
   # Timeout on blocking socket operations, in seconds.
   Timeout: 1.0
   # Disable graphics and sound (only if socket server is enabled).
   Headless: no

By default, Brutal Maze also then tries to read site (system-wide)
and user configuration.

Site Config File Location
^^^^^^^^^^^^^^^^^^^^^^^^^

* Apple macOS: ``/Library/Application Support/brutalmaze/settings.ini``
* Other Unix-like: ``$XDG_CONFIG_DIRS/brutalmaze/settings.ini`` or
  ``/etc/xdg/brutalmaze/settings.ini``
* Microsoft Windows:

    * XP: ``C:\Documents and Settings\All Users\Application Data\brutalmaze\settings.ini``
    * Vista: Fail! (``C:\ProgramData`` is a hidden *system* directory,
      however if you use Windows Vista, please file an issue telling us
      which error you receive)
    * 7 and above: ``C:\ProgramData\brutalmaze\settings.ini``

User Config File Location
^^^^^^^^^^^^^^^^^^^^^^^^^

* Apple macOS: ``~/Library/Application Support/brutalmaze/settings.ini``
* Other Unix-like: ``$XDG_CONFIG_HOME/brutalmaze/settings.ini`` or
  ``~/.config/brutalmaze/settings.ini``
* Microsoft Windows (roaming is not supported until someone requests):

    * XP: ``C:\Documents and Settings\<username>\Application Data\brutalmaze\settings.ini``
    * Vista and above: ``C:\Users\<username>\AppData\Local\brutalmaze\settings.ini``

Command-Line Arguments
----------------------

.. code-block:: console

   $ brutalmaze --help
   usage: brutalmaze [options]

   optional arguments:
     -h, --help            show this help message and exit
     -v, --version         show program's version number and exit
     --write-config [PATH]
                           write default config and exit, if PATH not specified use stdout
     -c PATH, --config PATH
                           location of the configuration file
     -s X Y, --size X Y    the desired screen size
     -f FPS, --max-fps FPS
                           the desired maximum FPS
     --mute, -m            mute all sounds
     --unmute              unmute sound
     --music-volume VOL    between 0.0 and 1.0
     --space-music         use space music background
     --default-music       use default music background
     --touch               enable touch-friendly control
     --no-touch            disable touch-friendly control
     --record-dir DIR      directory to write game records
     --record-rate SPF     snapshots of game state per second
     --server              enable server
     --no-server           disable server
     --host HOST           host to bind server to
     --port PORT           port for server to listen on
     -t TIMEOUT, --timeout TIMEOUT
                           socket operations timeout in seconds
     --head                run server with graphics and sound
     --headless            run server without graphics or sound

First, Brutal Mazes read the default settings, then it try to read site and
user config whose locations are shown above.  These files are listed as fallback
of the ``--config`` option and their contents are fallback for other options
(if they are absent default values are used instead).  We don't support control
configuration via CLI because that is unarguably ugly.

If ``--config`` option is set, Brutal Maze parse it before other command-line
options.  Later-read preferences will override previous ones.