anarch/settings.h

419 lines
11 KiB
C
Raw Normal View History

2019-10-03 18:04:14 -04:00
/**
@file settings.h
This file contains settings (or setting hints) for the game. Values here can
fine tune performance vs quality and personalize the final compiled game. Some
of these settings may be overriden by the specific platform used according to
2020-09-12 10:11:21 -04:00
its limitations. You are advised to NOT change value in this file directly,
but rather predefine them somewhere before this file gets included, e.g. in
you personal settings file.
2019-10-03 18:04:14 -04:00
by Miloslav Ciz (drummyfish), 2019
Released under CC0 1.0 (https://creativecommons.org/publicdomain/zero/1.0/)
plus a waiver of all other intellectual property. The goal of this work is
be and remain completely in the public domain forever, available for any use
whatsoever.
*/
2019-09-26 15:18:44 -04:00
#ifndef _SFG_SETTINGS_H
#define _SFG_SETTINGS_H
2019-10-04 10:32:24 -04:00
/**
Target FPS (frames per second). This sets the game logic FPS and will try to
render at the same rate. If such fast rendering can't be achieved, frames will
be droped, but the game logic will still be forced to run at this speed, so
2020-08-08 05:10:34 -04:00
the game may actually become slowed down if FPS is set too high. Too high or
too low FPS can also negatively affect game speeds which are computed as
integers and rounding errors can occur soon, so don't set this to extreme
values (try to keep from 20 to 100).
2019-10-04 10:32:24 -04:00
*/
2020-09-11 15:22:57 -04:00
#ifndef SFG_FPS
#define SFG_FPS 60
#endif
2019-10-04 10:32:24 -04:00
2020-01-18 05:10:05 -05:00
/**
On platforms with mouse this sets its horizontal sensitivity. 128 means 1
RCL_Unit per mouse pixel travelled.
*/
2020-09-06 15:00:19 -04:00
#ifndef SFG_MOUSE_SENSITIVITY_HORIZONTAL
#define SFG_MOUSE_SENSITIVITY_HORIZONTAL 32
#endif
2020-01-18 05:10:05 -05:00
2020-01-18 06:27:20 -05:00
/**
Like SFG_MOUSE_SENSITIVITY_HORIZONTAL but for vertical look. 128 means 1
shear pixel per mouse pixel travelled.
*/
2020-09-06 15:00:19 -04:00
#ifndef SFG_MOUSE_SENSITIVITY_VERTICAL
#define SFG_MOUSE_SENSITIVITY_VERTICAL 64
#endif
2020-01-18 06:27:20 -05:00
2019-10-04 10:32:24 -04:00
/**
Width of the screen in pixels. Set this to ACTUAL resolution. If you want the
game to run at smaller resolution (with bigger pixels), do his using
SFG_RESOLUTION_SCALEDOWN;
*/
2020-09-06 15:00:19 -04:00
#ifndef SFG_SCREEN_RESOLUTION_X
#define SFG_SCREEN_RESOLUTION_X 800
#endif
2019-10-04 10:32:24 -04:00
/**
Height of the screen in pixels. Set this to ACTUAL resolution. If you want the
game to run at smaller resolution (with bigger pixels), do his using
SFG_RESOLUTION_SCALEDOWN;
*/
2020-09-06 15:00:19 -04:00
#ifndef SFG_SCREEN_RESOLUTION_Y
#define SFG_SCREEN_RESOLUTION_Y 600
#endif
2020-03-13 15:16:10 -04:00
2020-10-03 14:29:15 -04:00
/**
How quickly player turns left/right, in degrees per second.
*/
2020-10-03 17:38:33 -04:00
#define SFG_PLAYER_TURN_SPEED 180
2020-10-03 14:29:15 -04:00
2020-03-10 14:56:11 -04:00
/**
Distance, in RCL_Units, to which textures will be drawn. Textures behind this
2020-10-09 08:47:35 -04:00
distance will be replaced by an average constant color, which maybe can help
performance and also serves as an antialiasim (2 level MIP map). Value 0 turns
texturing completely off, which is much faster than having just a low value,
values >= 65535 activate texturing completely, which can be a little faster
than setting having a high value lower than this limit.
2020-03-10 14:56:11 -04:00
*/
2020-09-06 15:00:19 -04:00
#ifndef SFG_TEXTURE_DISTANCE
#define SFG_TEXTURE_DISTANCE 100000
#endif
2020-03-10 14:56:11 -04:00
2019-10-04 10:32:24 -04:00
/**
How many times the screen resolution will be divided (how many times a game
pixel will be bigger than the screen pixel).
*/
2020-09-06 15:00:19 -04:00
#ifndef SFG_RESOLUTION_SCALEDOWN
#define SFG_RESOLUTION_SCALEDOWN 1
#endif
2019-09-26 15:18:44 -04:00
2020-09-11 15:22:57 -04:00
/**
Multiplier, in RCL_Units (1024 == 1.0), of the damager player takes. This can
be used to balance difficulty.
*/
#ifndef SFG_PLAYER_DAMAGE_MULTIPLIER
#define SFG_PLAYER_DAMAGE_MULTIPLIER 512
#endif
2019-09-29 08:54:40 -04:00
/**
Hint as to whether run in fullscreen, if the platform allows it.
*/
2020-09-06 15:00:19 -04:00
#ifndef SFG_FULLSCREEN
#define SFG_FULLSCREEN 0
#endif
2019-09-29 08:54:40 -04:00
2019-09-28 15:42:02 -04:00
/**
Whether shadows (fog) should be dithered, i.e. more smooth (needs a bit more
2019-10-03 17:37:52 -04:00
CPU performance and memory).
2019-09-28 15:42:02 -04:00
*/
2020-09-06 15:00:19 -04:00
#ifndef SFG_DITHERED_SHADOW
2020-10-03 12:53:18 -04:00
#define SFG_DITHERED_SHADOW 0
2020-09-06 15:00:19 -04:00
#endif
2019-09-26 19:25:22 -04:00
2020-02-01 17:17:22 -05:00
/**
Depth step (in RCL_Units) after which fog diminishes a color by one value
point. For performance reasons this number should be kept a power of two!
*/
2020-09-06 15:00:19 -04:00
#ifndef SFG_FOG_DIMINISH_STEP
#define SFG_FOG_DIMINISH_STEP 2048
#endif
2020-02-01 17:17:22 -05:00
2019-09-28 15:42:02 -04:00
/**
Maximum number of squares that will be traversed by any cast ray. Smaller
number is faster but can cause visual artifacts.
*/
2020-09-06 15:00:19 -04:00
#ifndef SFG_RAYCASTING_MAX_STEPS
#define SFG_RAYCASTING_MAX_STEPS 30
#endif
2019-09-27 13:04:49 -04:00
2019-09-28 15:42:02 -04:00
/**
Maximum number of hits any cast ray will register. Smaller number is faster
but can cause visual artifacts.
*/
2020-09-06 15:00:19 -04:00
#ifndef SFG_RAYCASTING_MAX_HITS
#define SFG_RAYCASTING_MAX_HITS 10
#endif
2019-09-27 13:04:49 -04:00
2019-09-28 15:42:02 -04:00
/**
How many times rendering should be subsampled horizontally. Bigger number
can significantly improve performance (by casting fewer rays), but can look
2020-10-03 12:53:18 -04:00
a little worse. This number should be a divisor of SFG_SCREEN_RESOLUTION_X!
2019-09-28 15:42:02 -04:00
*/
2020-09-06 15:00:19 -04:00
#ifndef SFG_RAYCASTING_SUBSAMPLE
#define SFG_RAYCASTING_SUBSAMPLE 1
#endif
2019-09-28 15:42:02 -04:00
2019-10-04 16:40:41 -04:00
/**
Enables or disables fog (darkness) due to distance. Recommended to keep on
for good look, but can be turned off for performance.
*/
2020-09-06 15:00:19 -04:00
#ifndef SFG_ENABLE_FOG
#define SFG_ENABLE_FOG 1
#endif
2019-10-04 16:40:41 -04:00
2019-10-06 11:12:12 -04:00
/**
Says whether sprites should diminish in fog. This takes more performance but
looks better.
*/
2020-09-06 15:00:19 -04:00
#ifndef SFG_DIMINISH_SPRITES
#define SFG_DIMINISH_SPRITES 1
#endif
2019-10-06 11:12:12 -04:00
2019-10-09 11:44:31 -04:00
/**
How quick player head bob is, 1024 meaning once per second. 0 Means turn off
head bob.
*/
2020-09-06 15:00:19 -04:00
#ifndef SFG_HEADBOB_SPEED
#define SFG_HEADBOB_SPEED 900
#endif
2019-10-09 11:44:31 -04:00
/**
Sets head bob offset, in RCL_UNITS_PER_SQUARE. 0 Means turn off head bob.
*/
2020-09-06 15:00:19 -04:00
#ifndef SFG_HEADBOB_OFFSET
#define SFG_HEADBOB_OFFSET 200
#endif
2019-10-09 11:44:31 -04:00
2020-10-03 17:38:33 -04:00
/**
If head bob is on, this additionally sets additional camera shear bob, in
pixels, which can make bobbing look more "advanced". 0 turns this option off.
*/
#ifndef SFG_HEADBOB_SHEAR
#define SFG_HEADBOB_SHEAR 0
#endif
2019-10-13 20:15:13 -04:00
/**
Weapon bobbing offset in weapon image pixels.
*/
2020-09-06 15:00:19 -04:00
#ifndef SFG_WEAPONBOB_OFFSET
#define SFG_WEAPONBOB_OFFSET 4
#endif
2019-10-13 20:15:13 -04:00
2019-10-11 09:01:36 -04:00
/**
Camera shearing (looking up/down) speed, in vertical resolutions per second.
*/
2020-09-06 15:00:19 -04:00
#ifndef SFG_CAMERA_SHEAR_SPEED
#define SFG_CAMERA_SHEAR_SPEED 3
#endif
2019-10-11 09:01:36 -04:00
/**
Maximum camera shear (vertical angle). 1024 means 1.0 * vertical resolution.
*/
2020-09-06 15:00:19 -04:00
#ifndef SFG_CAMERA_MAX_SHEAR
#define SFG_CAMERA_MAX_SHEAR 1024
#endif
2019-10-11 09:01:36 -04:00
2019-10-22 10:48:27 -04:00
/**
Specifies how quick some sprite animations are, in frames per second.
*/
2020-09-06 15:00:19 -04:00
#ifndef SFG_SPRITE_ANIMATION_SPEED
#define SFG_SPRITE_ANIMATION_SPEED 4
#endif
2019-10-22 10:48:27 -04:00
2019-10-25 16:41:52 -04:00
/**
2020-01-12 10:48:42 -05:00
How wide the border indicator is, in fractions of screen width.
2019-10-25 16:41:52 -04:00
*/
2020-09-06 15:00:19 -04:00
#ifndef SFG_HUD_BORDER_INDICATOR_WIDTH
#define SFG_HUD_BORDER_INDICATOR_WIDTH 32
#endif
2019-10-25 16:41:52 -04:00
/**
2020-01-12 10:48:42 -05:00
For how long border indication (being hurt etc.) stays shown, in ms.
2019-10-25 16:41:52 -04:00
*/
2020-09-06 15:00:19 -04:00
#ifndef SFG_HUD_BORDER_INDICATOR_DURATION
#define SFG_HUD_BORDER_INDICATOR_DURATION 500
#endif
2020-01-12 10:48:42 -05:00
/**
Color (palette index) by which being hurt is indicated.
*/
2020-09-06 15:00:19 -04:00
#ifndef SFG_HUD_HURT_INDICATION_COLOR
#define SFG_HUD_HURT_INDICATION_COLOR 175
#endif
2020-01-12 10:48:42 -05:00
/**
Color (palette index) by which taking an item is indicated.
*/
2020-09-06 15:00:19 -04:00
#ifndef SFG_HUD_ITEM_TAKEN_INDICATION_COLOR
#define SFG_HUD_ITEM_TAKEN_INDICATION_COLOR 207
#endif
2019-10-25 16:41:52 -04:00
2019-12-27 07:39:16 -05:00
/**
How many element (items, monsters, ...) distances will be checked per frame
for distance. Higher value may decrease performance a tiny bit, but things
will react more quickly and appear less "out of thin air".
*/
2020-09-06 15:00:19 -04:00
#ifndef SFG_ELEMENT_DISTANCES_CHECKED_PER_FRAME
#define SFG_ELEMENT_DISTANCES_CHECKED_PER_FRAME 8
#endif
2019-12-27 07:39:16 -05:00
2020-02-06 02:42:39 -05:00
/**
Maximum distance at which sound effects (SFX) will be played. The SFX volume
will gradually drop towards this distance.
*/
2020-09-06 15:00:19 -04:00
#ifndef SFG_SFX_MAX_DISTANCE
2020-09-19 05:52:24 -04:00
#define SFG_SFX_MAX_DISTANCE (1024 * 60)
2020-09-06 15:00:19 -04:00
#endif
2020-02-06 02:42:39 -05:00
2019-12-29 15:09:50 -05:00
/**
Says the intensity of background image blur. 0 means no blur, improves
performance and lowers memory usage.
*/
2020-09-06 15:00:19 -04:00
#ifndef SFG_BACKGROUND_BLUR
#define SFG_BACKGROUND_BLUR 0
#endif
2019-12-29 15:09:50 -05:00
2020-03-22 06:31:02 -04:00
/**
Defines the period, in ms, of things that blink, such as text.
*/
2020-09-06 15:00:19 -04:00
#ifndef SFG_BLINK_PERIOD
#define SFG_BLINK_PERIOD 500
#endif
2020-03-22 06:31:02 -04:00
2020-03-30 12:52:54 -04:00
/**
Probability (0 - 255) of how often a monster makes sound during movement.
*/
2020-09-06 15:00:19 -04:00
#ifndef SFG_MONSTER_SOUND_PROBABILITY
#define SFG_MONSTER_SOUND_PROBABILITY 64
#endif
2020-03-30 12:52:54 -04:00
2020-08-04 15:49:53 -04:00
/**
Affects how precise monsters are in aiming, specify random range in
fourths of a game square. Should be power of 2 for performance.
*/
2020-09-06 15:00:19 -04:00
#ifndef SFG_MONSTER_AIM_RANDOMNESS
#define SFG_MONSTER_AIM_RANDOMNESS 4
#endif
2020-08-04 15:49:53 -04:00
2020-08-09 07:33:22 -04:00
/// Color 1 index of player on map.
2020-09-06 15:00:19 -04:00
#ifndef SFG_MAP_PLAYER_COLOR1
#define SFG_MAP_PLAYER_COLOR1 93
#endif
2020-08-09 07:33:22 -04:00
/// Color 2 index of player on map.
2020-09-06 15:00:19 -04:00
#ifndef SFG_MAP_PLAYER_COLOR2
#define SFG_MAP_PLAYER_COLOR2 111
#endif
2020-08-09 07:33:22 -04:00
/// Color index of elevators on map.
2020-09-06 15:00:19 -04:00
#ifndef SFG_MAP_ELEVATOR_COLOR
#define SFG_MAP_ELEVATOR_COLOR 214
#endif
2020-08-09 07:33:22 -04:00
/// Color index of squeezers on map.
2020-09-06 15:00:19 -04:00
#ifndef SFG_MAP_SQUEEZER_COLOR
#define SFG_MAP_SQUEEZER_COLOR 246
#endif
2020-08-09 07:33:22 -04:00
/// Color index of door on map.
2020-09-06 15:00:19 -04:00
#ifndef SFG_MAP_DOOR_COLOR
#define SFG_MAP_DOOR_COLOR 188
#endif
2020-08-09 07:33:22 -04:00
2020-08-05 14:44:33 -04:00
/**
Boolean value indicating whether current OS is malware.
*/
#ifndef SFG_OS_IS_MALWARE
#define SFG_OS_IS_MALWARE 0
#endif
2020-09-14 13:58:23 -04:00
/**
Angle difference, as a cos value in RCL_Units, between the player and a
monster, at which vertical autoaim will trigger. If the angle is greater, a
shot will go directly forward.
*/
#ifndef SFG_VERTICAL_AUTOAIM_ANGLE_THRESHOLD
#define SFG_VERTICAL_AUTOAIM_ANGLE_THRESHOLD 50
#endif
2020-09-19 05:52:24 -04:00
/**
Byte (0 - 255) volume of the menu click sound.
*/
#ifndef SFG_MENU_CLICK_VOLUME
#define SFG_MENU_CLICK_VOLUME 220
#endif
2020-09-20 03:51:59 -04:00
/**
Says whether the exit item should be showed in the menu. Platforms that can't
exit (such as some gaming consoles that simply use power off button) can
define this to 0.
*/
#ifndef SFG_CAN_EXIT
#define SFG_CAN_EXIT 1
#endif
2020-09-23 08:01:25 -04:00
/**
On Arduino platforms this should be set to 1. That will cause some special
treatment regarding constant variables and PROGMEM.
*/
#ifndef SFG_ARDUINO
#define SFG_ARDUINO 0
#endif
2020-02-15 17:04:22 -05:00
//------ developer/debug settings ------
2020-01-18 06:27:20 -05:00
/**
Developer cheat for having infinite ammo in all weapons.
*/
2020-09-06 15:00:19 -04:00
#ifndef SFG_INFINITE_AMMO
2020-09-11 15:22:57 -04:00
#define SFG_INFINITE_AMMO 0
2020-09-06 15:00:19 -04:00
#endif
2020-01-18 06:27:20 -05:00
2020-02-15 17:04:22 -05:00
/**
Developer cheat for immortality.
*/
2020-09-06 15:00:19 -04:00
#ifndef SFG_IMMORTAL
2020-09-11 15:22:57 -04:00
#define SFG_IMMORTAL 0
2020-09-06 15:00:19 -04:00
#endif
2020-02-15 17:04:22 -05:00
/**
Turn on for previes mode for map editing (flying, noclip, fast movement etc.).
*/
2020-09-06 15:00:19 -04:00
#ifndef SFG_PREVIEW_MODE
#define SFG_PREVIEW_MODE 0
#endif
2020-02-15 17:04:22 -05:00
/**
How much faster movement is in the preview mode.
*/
2020-09-06 15:00:19 -04:00
#ifndef SFG_PREVIEW_MODE_SPEED_MULTIPLIER
#define SFG_PREVIEW_MODE_SPEED_MULTIPLIER 2
#endif
2020-02-15 17:04:22 -05:00
/**
Skips menu and starts given level immediatelly, for development. 0 means this
options is ignored, 1 means load level 1 etc.
*/
2020-09-06 15:00:19 -04:00
#ifndef SFG_START_LEVEL
2020-09-11 15:22:57 -04:00
#define SFG_START_LEVEL 0
2020-09-06 15:00:19 -04:00
#endif
2020-02-15 17:04:22 -05:00
2020-08-08 15:54:43 -04:00
/**
Reveals whole level map from start.
*/
2020-09-06 15:00:19 -04:00
#ifndef SFG_REVEAL_MAP
2020-09-11 15:22:57 -04:00
#define SFG_REVEAL_MAP 0
2020-09-06 15:00:19 -04:00
#endif
2020-08-08 15:54:43 -04:00
2020-08-09 10:01:21 -04:00
/**
Gives player all keys from start.
*/
2020-09-06 15:00:19 -04:00
#ifndef SFG_UNLOCK_DOOR
#define SFG_UNLOCK_DOOR 0
#endif
2020-08-16 06:06:24 -04:00
/**
Whether levels background (in distance or transparent wall textures) should
be drawn. If turned off, the background will be constant color, which can
noticably increase performance.
*/
2020-09-06 15:00:19 -04:00
#ifndef SFG_DRAW_LEVEL_BACKGROUND
#define SFG_DRAW_LEVEL_BACKGROUND 1
#endif
2020-08-09 10:01:21 -04:00
2019-09-26 15:18:44 -04:00
#endif // guard