267f47fc0e
Squashed commit of the following: commit9ab0197ee1
Author: Andrei Alexeyev <akari@taisei-project.org> Date: Wed Dec 28 23:05:58 2022 +0100 build: add dummy descriptions for deprecated options commitb0c41d4719
Author: Alice D <alice@starwitch.productions> Date: Mon Dec 26 15:18:09 2022 -0500 update docker containers with ones containing meson 0.63.3 commita2dd4173fc
Author: Andrei Alexeyev <akari@taisei-project.org> Date: Sun Dec 25 19:20:44 2022 +0100 build: featurize audio options commit7c59e2a569
Author: Andrei Alexeyev <akari@taisei-project.org> Date: Sun Dec 25 19:20:35 2022 +0100 build: remove dead code commitcf500af137
Author: Andrei Alexeyev <akari@taisei-project.org> Date: Sun Dec 25 19:07:37 2022 +0100 doc: update BUILD.rst commit9764ac706f
Author: Andrei Alexeyev <akari@taisei-project.org> Date: Sun Dec 25 17:12:37 2022 +0100 ci: disable WGI joystick backend for SDL Fails to build with latest llvm-mingw commit2d4f310b90
Author: p-sam <p-sam@d3vs.net> Date: Sun Dec 25 17:03:47 2022 +0100 switch: fix missing include commit9264f1649d
Author: Andrei Alexeyev <akari@taisei-project.org> Date: Sat Dec 24 14:36:41 2022 +0100 ci: update meson to 0.63.3 due to a bug commit3e37be3d8f
Author: Andrei Alexeyev <akari@taisei-project.org> Date: Sat Dec 24 13:42:34 2022 +0100 ci: update build options commit281a39a4f5
Author: Alice D <alice@starwitch.productions> Date: Sun Dec 18 00:17:07 2022 -0500 ci: change when apt is cleaned up for switch image commit2f2100a84c
Author: Alice D <alice@starwitch.productions> Date: Sun Dec 18 00:11:08 2022 -0500 ci: bump switch homebrew container version commitebaff59260
Author: Alice D <alice@starwitch.productions> Date: Sat Dec 17 22:55:39 2022 -0500 ci: bump windows container version commit7ce6f23419
Author: Andrei Alexeyev <akari@taisei-project.org> Date: Sat Dec 17 07:36:28 2022 +0100 build: featurize renderer options commita345f21b35
Author: Andrei Alexeyev <akari@taisei-project.org> Date: Sat Dec 17 07:33:30 2022 +0100 build: revert to explicit fallback for libzstd Implicit fallback causes conflicts in the basis_universal subproject https://github.com/mesonbuild/meson/issues/11189 commitb2de61f5c5
Author: Andrei Alexeyev <akari@taisei-project.org> Date: Sat Dec 17 05:29:29 2022 +0100 build: remove debug_opengl This option was always misdocumented, as it only controlled whether GL debugging is on by default. You can still control it with the TAISEI_GL_DEBUG environment variable, which is set to 1 in meson devenv. commit4c659ba195
Author: Andrei Alexeyev <akari@taisei-project.org> Date: Fri Dec 16 08:03:37 2022 +0100 build: set up useful env vars for meson devenv Makes Taisei load resources from the source tree, making live reload work; enables OpenGL debugging by default; works around ASan stack use after return false positives. commit1ddc58b84a
Author: Andrei Alexeyev <akari@taisei-project.org> Date: Wed Dec 14 08:06:32 2022 +0100 build: featurize docs; always install licenses commitc3a94d7f5b
Author: Andrei Alexeyev <akari@taisei-project.org> Date: Wed Dec 14 07:46:28 2022 +0100 build: featurize shader_transpiler commit619d82ae36
Author: Andrei Alexeyev <akari@taisei-project.org> Date: Wed Dec 14 07:38:30 2022 +0100 build: allow libzip fallback by default commit79ab72292a
Author: Andrei Alexeyev <akari@taisei-project.org> Date: Wed Dec 14 07:35:51 2022 +0100 build: featurize use_libcrypto commitb393077f71
Author: Andrei Alexeyev <akari@taisei-project.org> Date: Wed Dec 14 05:03:20 2022 +0100 build: featurize validate_glsl commit7d76484079
Author: Andrei Alexeyev <akari@taisei-project.org> Date: Wed Dec 14 04:34:31 2022 +0100 build: featurize some more installation options commit17c0bda205
Author: Andrei Alexeyev <akari@taisei-project.org> Date: Wed Dec 14 03:24:46 2022 +0100 build: deprecate enable_zip for vfs_zip; convert package_data into feature commit9a4ef8c091
Author: Andrei Alexeyev <akari@taisei-project.org> Date: Wed Dec 14 02:37:55 2022 +0100 build: deprecate developer=auto; default to false commit807240e508
Author: Andrei Alexeyev <akari@taisei-project.org> Date: Wed Dec 14 02:24:04 2022 +0100 build: move subproject fallback info into wraps commit08c953f487
Author: Andrei Alexeyev <akari@taisei-project.org> Date: Wed Dec 14 01:57:33 2022 +0100 build: deprecate 'static' option Meson has a built-in `prefer_static` now commitc575601537
Author: Andrei Alexeyev <akari@taisei-project.org> Date: Wed Dec 14 01:49:31 2022 +0100 build: remove complicated shaderc detection logic Meson does all of this internally since 0.51.0 commitcd2d460d4b
Author: Andrei Alexeyev <akari@taisei-project.org> Date: Wed Dec 14 01:45:17 2022 +0100 build: Require meson >=0.63.0 commit10abd790f7
Author: Andrei Alexeyev <akari@taisei-project.org> Date: Mon Dec 12 05:16:47 2022 +0100 ci: remove meson dist version workaround from release workflow Meson should know the correct version now commit31a07d8c3c
Author: Andrei Alexeyev <akari@taisei-project.org> Date: Mon Dec 12 03:46:28 2022 +0100 build: use built-in summary() function commit0c47f6d14b
Author: Andrei Alexeyev <akari@taisei-project.org> Date: Mon Dec 12 04:33:01 2022 +0100 build: remove -Dversion_fallback and introduce .VERSION file The version script will now first try to read the version from a .VERSION file in the source root. If that file does not exist, it will query git. The .VERSION file is not included in the git repository, it is generated for inclusion in source tarballs. Package maintainers who had any use for -Dversion_fallback may want to create the .VERSION file themselves. Additionally, some git-specific files have been removed from source tarballs. commitd32332a5e3
Author: Andrei Alexeyev <akari@taisei-project.org> Date: Mon Dec 12 03:00:07 2022 +0100 build: set the "real" version in project() commitf9a3fbc729
Author: Andrei Alexeyev <akari@taisei-project.org> Date: Mon Dec 12 01:50:08 2022 +0100 build: raise meson_version and remove some legacy workarounds Effectively 0.56.0 was already required since we started using some of its features at some point. This also fixes all current meson warnings.
334 lines
11 KiB
ReStructuredText
334 lines
11 KiB
ReStructuredText
Taisei Project – Environment Variables
|
||
======================================
|
||
|
||
.. contents::
|
||
|
||
Introduction
|
||
------------
|
||
|
||
Some of Taisei's more advanced configuration options are delegated to
|
||
`environment
|
||
variables <https://en.wikipedia.org/wiki/Environment_variable>`__. This
|
||
document attempts to describe them all.
|
||
|
||
Generally you don't need to set any of them. They are intended for
|
||
developers and advanced users only. Therefore, familiarity with the
|
||
concept is assumed.
|
||
|
||
In addition to the variables listed here, those processed by our runtime
|
||
dependencies (such as SDL) also take effect, unless stated otherwise.
|
||
|
||
Variables
|
||
---------
|
||
|
||
Virtual filesystem
|
||
~~~~~~~~~~~~~~~~~~
|
||
|
||
**TAISEI_RES_PATH**
|
||
| Default: unset
|
||
|
||
If set, overrides the default **resource directory** path. This is
|
||
where Taisei looks for game data. The default path is platform and
|
||
build specific:
|
||
|
||
- On **macOS**, it will be the ``Contents/Resources/data`` directory
|
||
inside of the ``Taisei.app`` bundle.
|
||
- On **Linux**, **\*BSD**, and most other **Unix**-like systems
|
||
(without -DRELATIVE), it will be ``$prefix/share/taisei``. This
|
||
path is static and determined at compile time.
|
||
- On **Windows** and other platforms when built with -DRELATIVE, it
|
||
will be the ``data`` directory relative to the executable (or to
|
||
whatever ``SDL_GetBasePath`` returns on the given platform).
|
||
|
||
**TAISEI_STORAGE_PATH**
|
||
| Default: unset
|
||
|
||
If set, overrides the default **storage directory** path. This is
|
||
where Taisei saves your configuration, progress, screenshots and
|
||
replays. Taisei also loads custom data from the ``resources``
|
||
subdirectory in there, if any, in addition to the stock assets. The
|
||
custom resources shadow the default ones if the names clash. The
|
||
default path is platform specific, and is equivalent to the return
|
||
value of ``SDL_GetPrefPath("", "taisei")``:
|
||
|
||
- On **Windows**, it's ``%APPDATA%\taisei``.
|
||
- On **macOS**, it's ``$HOME/Library/Application Support/taisei``.
|
||
- On **Linux**, **\*BSD**, and most other **Unix**-like systems,
|
||
it's ``$XDG_DATA_HOME/taisei`` or ``$HOME/.local/share/taisei``.
|
||
|
||
Resources
|
||
~~~~~~~~~
|
||
|
||
**TAISEI_NOASYNC**
|
||
| Default: ``0``
|
||
|
||
If ``1``, disables asynchronous loading. Increases loading times, might
|
||
slightly reduce CPU and memory usage during loads. Generally not
|
||
recommended unless you encounter a race condition bug, in which case
|
||
you should report it.
|
||
|
||
**TAISEI_NOUNLOAD**
|
||
| Default: ``0``
|
||
|
||
If ``1``, loaded resources are never unloaded. Increases memory usage,
|
||
reduces filesystem reads and loading times over time.
|
||
|
||
**TAISEI_NOPRELOAD**
|
||
| Default: ``0``
|
||
|
||
If ``1``, disables preloading. All resources are only loaded as they
|
||
are needed. Reduces loading times and memory usage, but may cause
|
||
stuttering during gameplay.
|
||
|
||
**TAISEI_PRELOAD_REQUIRED**
|
||
| Default: ``0``
|
||
|
||
If ``1``, the game will crash with an error message when it attempts to
|
||
use a resource that hasn't been previously preloaded. Useful for
|
||
developers to debug missing preloads.
|
||
|
||
**TAISEI_PRELOAD_SHADERS**
|
||
| Default: ``0``
|
||
|
||
If ``1``, Taisei will load all shader programs at startup. This is mainly
|
||
useful for developers to quickly ensure that none of them fail to compile.
|
||
|
||
Video and OpenGL
|
||
~~~~~~~~~~~~~~~~
|
||
|
||
**TAISEI_PREFER_SDL_VIDEODRIVERS**
|
||
| Default: ``wayland,mir,cocoa,windows,x11``
|
||
|
||
List of SDL video backends that Taisei will attempt to use, in the
|
||
specified order, before falling back to SDL's default. Entries may be
|
||
separated by spaces, commas, colons, and semicolons. This variable is
|
||
ignored if ``SDL_VIDEODRIVER`` is set.
|
||
|
||
**TAISEI_VIDEO_DRIVER**
|
||
| Default: unset
|
||
| **Deprecated**
|
||
|
||
Use ``SDL_VIDEODRIVER`` instead.
|
||
|
||
**TAISEI_RENDERER**
|
||
| Default: ``gl33``
|
||
|
||
Selects the rendering backend to use. Currently available options are:
|
||
|
||
- ``gl33``: the OpenGL 3.3 Core renderer
|
||
- ``gles30``: the OpenGL ES 3.0 renderer
|
||
- ``gles20``: the OpenGL ES 2.0 renderer
|
||
- ``null``: the no-op renderer (nothing is displayed)
|
||
|
||
Note that the actual subset of usable backends, as well as the default
|
||
choice, can be controlled by build options. The ``gles`` backends are not
|
||
built by default.
|
||
|
||
**TAISEI_LIBGL**
|
||
| Default: unset
|
||
|
||
OpenGL library to load instead of the default. The value has a
|
||
platform-specific meaning (it's passed to the equivalent of ``dlopen``).
|
||
Takes precedence over ``SDL_OPENGL_LIBRARY`` if set. Has no effect if
|
||
Taisei is linked to libgl (which is not recommended, because it's not
|
||
portable).
|
||
|
||
**TAISEI_GL_DEBUG**
|
||
| Default: ``0``
|
||
|
||
Enables OpenGL debugging. A debug context will be requested, all OpenGL
|
||
messages will be logged, and errors are fatal. Requires the ``KHR_debug``
|
||
or ``ARB_debug_output`` extension.
|
||
|
||
**TAISEI_GL_EXT_OVERRIDES**
|
||
| Default: unset
|
||
|
||
Space-separated list of OpenGL extensions that are assumed to be
|
||
supported, even if the driver says they aren't. Prefix an extension with
|
||
``-`` to invert this behaviour. Might be used to work around bugs in
|
||
some weird/ancient/broken drivers, but your chances are slim. Note that
|
||
this only affects code paths that actually test for the given extensions,
|
||
not the actual OpenGL functionality. Some OpenGL implementations (such as
|
||
Mesa) provide their own mechanisms for controlling extensions. You most
|
||
likely want to use that instead.
|
||
|
||
**TAISEI_FRAMERATE_GRAPHS**
|
||
| Default: ``0`` for release builds, ``1`` for debug builds
|
||
|
||
If ``1``, framerate graphs will be drawn on the HUD.
|
||
|
||
**TAISEI_OBJPOOL_STATS**
|
||
| Default: ``0``
|
||
|
||
Displays some statistics about usage of in-game objects.
|
||
|
||
Timing
|
||
~~~~~~
|
||
|
||
**TAISEI_HIRES_TIMER**
|
||
| Default: ``1``
|
||
|
||
If ``1``, tries to use the system's high resolution timer to limit the
|
||
game's framerate. Disabling this is not recommended; it will likely make
|
||
Taisei run slower or faster than intended and the reported FPS will be
|
||
less accurate.
|
||
|
||
**TAISEI_FRAMELIMITER_SLEEP**
|
||
| Default: ``3``
|
||
|
||
If over ``0``, tries to give up processing time to other applications
|
||
while waiting for the next frame, if at least ``frame_time / this_value``
|
||
amount of time is remaining. Increasesing this value reduces CPU usage,
|
||
but may harm performance. Set to ``0`` for the v1.2 default behaviour.
|
||
|
||
**TAISEI_FRAMELIMITER_COMPENSATE**
|
||
| Default: ``1``
|
||
|
||
If ``1``, the framerate limiter may let frames finish earlier than
|
||
normal after sudden frametime spikes. This achieves better timing
|
||
accuracy, but may hurt fluidity if the framerate is too unstable.
|
||
|
||
**TAISEI_FRAMELIMITER_LOGIC_ONLY**
|
||
| Default: ``0``
|
||
| **Experimental**
|
||
|
||
If ``1``, only the logic framerate will be capped; new rendering frames
|
||
will be processed as quickly as possible, with no delay. This inherently
|
||
desynchronizes logic and rendering frames, and therefore, some logic
|
||
frames may be dropped if rendering is too slow. However, unlike with the
|
||
synchronous mode, the game speed will remain roughly constant in those
|
||
cases. ``TAISEI_FRAMELIMITER_SLEEP``, ``TAISEI_FRAMELIMITER_COMPENSATE``,
|
||
and the ``frameskip`` setting have no effect in this mode.
|
||
|
||
Miscellaneous
|
||
~~~~~~~~~~~~~
|
||
|
||
**TAISEI_GAMEMODE**
|
||
| Default: ``1``
|
||
| *Linux only*
|
||
|
||
If ``1``, enables automatic integration with Feral Interactive's GameMode
|
||
daemon. Only meaningful for GameMode-enabled builds.
|
||
|
||
Logging
|
||
~~~~~~~
|
||
|
||
Taisei's logging system currently has five basic levels and works by
|
||
dispatching messages to a few output handlers. Each handler has a level
|
||
filter, which is configured by a separate environment variable. All of
|
||
those variables work the same way: their value looks like an IRC mode
|
||
string, and represents a modification of the handler's default settings.
|
||
If this doesn't make sense, take a look at the *Examples* section.
|
||
|
||
The levels
|
||
^^^^^^^^^^
|
||
|
||
- **Debug** (*d*) is the most verbose level. It contains random
|
||
information about internal workings of the game and is disabled for
|
||
release builds at source level.
|
||
- **Info** (*i*) logs some events that are expected to occur during
|
||
normal operation, for example when a spell is unlocked or a
|
||
screenshot is taken.
|
||
- **Warning** (*w*) usually complains about misuse of the engine
|
||
features, deprecations, unimplemented functionality, other small
|
||
anomalies that aren't directly detrimental to functionality.
|
||
- **Error** (*e*) alerts of non-critical errors, for example a
|
||
missing optional resource, corrupted progress data, or failure to
|
||
save a replay due to insufficient storage space or privileges.
|
||
- **Fatal** (*f*) is an irrecoverable failure condition. Such an
|
||
event most likely signifies a programming error or a broken
|
||
installation. The game will immediately crash after writing a message
|
||
with this log level. On some platforms, it will also display a
|
||
graphical message box.
|
||
- **All** (*a*) is not a real log level, but a shortcut directive
|
||
representing all possible log levels. See *Examples* for usage.
|
||
|
||
The variables
|
||
^^^^^^^^^^^^^
|
||
|
||
**TAISEI_LOGLVLS_CONSOLE**
|
||
| Default: ``+a`` *(All)*
|
||
|
||
Controls what log levels may go to the console. This acts as a master
|
||
switch for **TAISEI_LOGLVLS_STDOUT** and **TAISEI_LOGLVLS_STDERR**.
|
||
|
||
**TAISEI_LOGLVLS_STDOUT**
|
||
| Default: ``+di`` *(Debug, Info)*
|
||
|
||
Controls what log levels go to standard output. Log levels that are
|
||
disabled by **TAISEI_LOGLVLS_CONSOLE** are ignored.
|
||
|
||
**TAISEI_LOGLVLS_STDERR**
|
||
| Default: ``+wef`` *(Warning, Error, Fatal)*
|
||
|
||
Controls what log levels go to standard error. Log levels that are
|
||
disabled by **TAISEI_LOGLVLS_CONSOLE** are ignored.
|
||
|
||
**TAISEI_LOGLVLS_FILE**
|
||
| Default: ``+a`` *(All)*
|
||
|
||
Controls what log levels go to the log file
|
||
(``{storage directory}/log.txt``).
|
||
|
||
**TAISEI_LOG_ASYNC**
|
||
| Default: ``1``
|
||
|
||
If ``1``, log messages are written asynchronously from a background
|
||
thread. This mostly benefits platforms where writing to the console
|
||
or files is very slow (such as Windows). You may want to disable this
|
||
when debugging.
|
||
|
||
**TAISEI_LOG_ASYNC_FAST_SHUTDOWN**
|
||
| Default: ``0``
|
||
|
||
If ``1``, don't wait for the whole log queue to be written when
|
||
shutting down. This will make the game quit faster if log writing is
|
||
slow, at the expense of log integrity. Ignored if ``TAISEI_LOG_ASYNC``
|
||
is disabled.
|
||
|
||
Examples
|
||
^^^^^^^^
|
||
|
||
- In release builds: print *Info* messages to stdout, in addition to
|
||
*Warning*\ s, *Error*\ s, and *Fatal*\ s as per default:
|
||
|
||
.. code:: sh
|
||
|
||
TAISEI_LOGLVLS_STDOUT=+i
|
||
|
||
- In Debug builds: remove *Debug* and *Info* output from the console:
|
||
|
||
.. code:: sh
|
||
|
||
TAISEI_LOGLVLS_STDOUT=-di
|
||
|
||
OR:
|
||
|
||
.. code:: sh
|
||
|
||
TAISEI_LOGLVLS_CONSOLE=-di
|
||
|
||
- Don't save anything to the log file:
|
||
|
||
.. code:: sh
|
||
|
||
TAISEI_LOGLVLS_FILE=-a
|
||
|
||
- Don't print anything to the console:
|
||
|
||
.. code:: sh
|
||
|
||
TAISEI_LOGLVLS_CONSOLE=-a
|
||
|
||
- Don't save anything to the log file, except for *Error*\ s and *Fatal*\ s:
|
||
|
||
.. code:: sh
|
||
|
||
TAISEI_LOGLVLS_FILE=-a+ef
|
||
|
||
- Print everything except *Debug* to ``stderr``, nothing to ``stdout``:
|
||
|
||
.. code:: sh
|
||
|
||
TAISEI_LOGLVLS_STDOUT=-a
|
||
TAISEI_LOGLVLS_STDERR=+a-d
|