Backends

From OHRRPGCE-Wiki
(Redirected from Backend)
Jump to: navigation, search

A backend is part of the engine that handles some low-level task like displaying graphics and can be swapped out for a replacement which achieves the same thing in a different way, usually by using a different library. The OHRRPGCE uses several different backends for graphics and music. Different builds of the engine are available with differing backends or other "compile-time" options. Actually you can only get non-standard nightly builds; if you want a non-standard stable release you either need to compile it yourself, or use a nightly build from a nearby date.

The easiest way to see which backends you are using is to run Custom and go to Load Existing Game. At the bottom of the screen you'll see a line like "OHRRPGCE wip 20160610 directx/sdl" meaning gfx_directx and music_sdl. You can also examine c/g_debug.txt for lines starting with gfx_### or music_### (don't be fooled by the version info line, which lists all backends compiled in).

gfx[edit]

gfx backends provide the graphics and user-input (keyboard, mouse, joystick/gamepads) and often more (gfx_sdl contains nearly everything to do with Mac OSX or Android). The OHRRPGCE can be compiled with any combination of graphics backends, and the one to use selected with a commandline switch. Run with commandline option "/?" (or "--help") for usage information. The default graphics backend is always the first named, for example in the file ohrrpgce-wip-gfx-music.zip. By default the OHRRPGCE is compiled with support for any of gfx_sdl, gfx_directx, and gfx_fb which are available for the current platform.

name status description fullscreen smoothing platforms
gfx_sdl stable Simple DirectMedia Layer (SDL) graphics. This is the default backend on GNU/Linux, Macintosh, and Android Yes Yes GNU/Linux, Mac, Windows, Android
gfx_directx stable This backend exists as gfx_directx.dll - all Windows builds normally include support for it even if the .dll isn't included. This is the default backend on Windows Yes Yes (texture scaling) Windows
gfx_fb stable Based on Freebasic's standard graphics library. This backend is well-tested, but due to a few minor unsolvable problems is no longer the default Windows:Yes
Linux:Maybe
Yes GNU/Linux, Windows
gfx_alleg working, but very little testing Allegro backend. Yes No (Mac?, Linux?), Windows
gfx_console diagnostic Curses-based backend (displays text only, no graphics). For testing only; no builds available. NA NA All

music[edit]

music backends provide the music and sound effects. The music backend is always the second named, for example, ohrrpgce-wip-gfx-music.zip. Unlike graphics backends, each build of the engine only supports a single music backend; they can't be selected with a command-line option.

name status description advanced MIDI looping
music_native Windows:mostly-stable (but buggy)
Linux:No MIDI support
Audiere and Native windows midi. MIDI playback is very buggy. Frequently does not work on Linux because it uses OSS Windows:Yes
Linux:No
music_sdl stable (crashy on Windows) SDL 1.2+SDL_mixer backend. This is the default on Windows, Linux and Mac. MIDI playback on Windows is buggy and sometimes crashes. Variable-bitrates and unusual sample rates are broken. Some MP3 files (variable bitrate?) cause crashes. Converting .mp3s to .oggs avoid some of these problems. No
music_allegro obsolete Allegro backend. Unmaintained; no longer works or even compiles. Only worked together with gfx_alleg No
music_native2 mostly-stable (but buggy) (Windows-only) music_native variant with alternative, "better" (but still pretty buggy) MIDI implementation. Identical Audiere sound effects implementation Controller 111 loop points only
music_silence diagnostic Does not play any music or sound at all. Useful for checking whether or not a bug is related to music. No

Other builds[edit]

These aren't backends but rather are other compile-time options.

name status description
-debug diagnostic Any nightly build with -debug in the filename has been compiled with -g which adds debugging symbols for use with the GNU Debugger
-exx diagnostic Any nightly build with -exx in the filename has been compiled with -exx which adds extra error checking (asserts) for out-of-bounds array access and null pointer dereferencing. Failed asserts cause the program to instantly exit. These builds are many times slower, something which might be noticeable on very old computers.
-scriptprofile diagnostic Any nightly build with -profile in the filename has been compiled with -d SCRIPTPROFILE to perform script profiling; when you exit a game, Game prints a whole lot of statistics to g_debug.txt about how much time each script took to run.

See Also[edit]