4 This file contains settings (or setting hints) for the game. Values here can
5 fine tune performance vs quality and personalize the final compiled game. Some
6 of these settings may be overriden by the specific platform used according to
7 its limitations. You are advised to NOT change value in this file directly,
8 but rather predefine them somewhere before this file gets included, e.g. in
9 you personal settings file.
11 by Miloslav Ciz (drummyfish), 2019
13 Released under CC0 1.0 (https://creativecommons.org/publicdomain/zero/1.0/)
14 plus a waiver of all other intellectual property. The goal of this work is to
15 be and remain completely in the public domain forever, available for any use
19 #ifndef _SFG_SETTINGS_H
20 #define _SFG_SETTINGS_H
23 Path to the save file. You may want to set this to some absolute path,
24 depending on your system.
26 #ifndef SFG_SAVE_FILE_PATH
27 #define SFG_SAVE_FILE_PATH "anarch.sav"
31 Time multiplier in SFG_Units (1.0 == 1024). This can be used to slow down or
32 speed up the game. Note that this also changes the rendering FPS accordingly
33 (e.g. half FPS at half speed), so if you want to keep the FPS, divide it by
36 #ifndef SFG_TIME_MULTIPLIER
37 #define SFG_TIME_MULTIPLIER 1024
41 Target FPS (frames per second). This sets the game logic FPS and will try to
42 render at the same rate. If such fast rendering can't be achieved, frames will
43 be droped, but the game logic will still be forced to run at this speed, so
44 the game may actually become slowed down if FPS is set too high. Too high or
45 too low FPS can also negatively affect game speeds which are computed as
46 integers and rounding errors can occur soon, so don't set this to extreme
47 values (try to keep between 20 to 100). FPS also determines the game
48 simulation step length, so different FPS values may result in very slight
49 differences in game behavior (not very noticeable but affecting demos etc.).
56 Increases or decreases the brightness of the rendered world (but not menu,
57 HUD etc.). Effective values are -8 to 8.
59 #ifndef SFG_BRIGHTNESS
60 #define SFG_BRIGHTNESS 0
64 On platforms with mouse this sets its horizontal sensitivity. 128 means 1
65 RCL_Unit turn angle per mouse pixel travelled.
67 #ifndef SFG_MOUSE_SENSITIVITY_HORIZONTAL
68 #define SFG_MOUSE_SENSITIVITY_HORIZONTAL 32
72 Like SFG_MOUSE_SENSITIVITY_HORIZONTAL but for vertical look. 128 means 1
73 shear pixel per mouse pixel travelled.
75 #ifndef SFG_MOUSE_SENSITIVITY_VERTICAL
76 #define SFG_MOUSE_SENSITIVITY_VERTICAL 64
80 Width of the screen in pixels. Set this to ACTUAL resolution. If you want the
81 game to run at smaller resolution (with bigger pixels), do this using
82 SFG_RESOLUTION_SCALEDOWN.
84 #ifndef SFG_SCREEN_RESOLUTION_X
85 #define SFG_SCREEN_RESOLUTION_X 800
89 Like SFG_SCREEN_RESOLUTION_X, but for y resolution.
91 #ifndef SFG_SCREEN_RESOLUTION_Y
92 #define SFG_SCREEN_RESOLUTION_Y 600
96 How quickly player turns left/right, in degrees per second.
98 #ifndef SFG_PLAYER_TURN_SPEED
99 #define SFG_PLAYER_TURN_SPEED 180
103 Horizontal FOV (field of vision) in RCL_Units (1024 means 360 degrees).
105 #ifndef SFG_FOV_HORIZONTAL
106 #define SFG_FOV_HORIZONTAL 256
110 Like SFG_FOV_HORIZONTAL but for vertical angle.
112 #ifndef SFG_FOV_VERTICAL
113 #define SFG_FOV_VERTICAL 330
117 Distance, in RCL_Units, to which textures will be drawn. Textures behind this
118 distance will be replaced by an average constant color, which maybe can help
119 performance and also serves as an antialiasim (2 level MIP map). Value 0 turns
120 texturing completely off, which is much faster than having just a low value,
121 values >= 65535 activate texturing completely, which can be a little faster
122 than setting having a high value lower than this limit.
124 #ifndef SFG_TEXTURE_DISTANCE
125 #define SFG_TEXTURE_DISTANCE 100000
129 How many times the screen resolution will be divided (how many times a game
130 pixel will be bigger than the screen pixel).
132 #ifndef SFG_RESOLUTION_SCALEDOWN
133 #define SFG_RESOLUTION_SCALEDOWN 1
137 Multiplier, in RCL_Units (1024 == 1.0), of the damager player takes. This can
138 be used to balance difficulty.
140 #ifndef SFG_PLAYER_DAMAGE_MULTIPLIER
141 #define SFG_PLAYER_DAMAGE_MULTIPLIER 512
145 Hint as to whether to run in fullscreen, if the platform allows it.
147 #ifndef SFG_FULLSCREEN
148 #define SFG_FULLSCREEN 0
152 Whether shadows (fog) should be dithered, i.e. more smooth (needs a bit more
153 CPU performance and memory).
155 #ifndef SFG_DITHERED_SHADOW
156 #define SFG_DITHERED_SHADOW 0
160 Depth step (in RCL_Units) after which fog diminishes a color by one value
161 point. For performance reasons this number should be kept a power of two!
163 #ifndef SFG_FOG_DIMINISH_STEP
164 #define SFG_FOG_DIMINISH_STEP 2048
168 If set, floor and ceiling will be colored differently depending on their
169 height. This can be useful when fog is turned on and different floor levels
170 are hard to distinguish.
172 #ifndef SFG_DIFFERENT_FLOOR_CEILING_COLORS
173 #define SFG_DIFFERENT_FLOOR_CEILING_COLORS 0
177 Maximum number of squares that will be traversed by any cast ray. Smaller
178 number is faster but can cause visual artifacts.
180 #ifndef SFG_RAYCASTING_MAX_STEPS
181 #define SFG_RAYCASTING_MAX_STEPS 30
185 Maximum number of hits any cast ray will register. Smaller number is faster
186 but can cause visual artifacts.
188 #ifndef SFG_RAYCASTING_MAX_HITS
189 #define SFG_RAYCASTING_MAX_HITS 10
193 Same as SFG_RAYCASTING_MAX_STEPS but for visibility rays that are used to
194 check whether sprites are visible etc.
196 #ifndef SFG_RAYCASTING_VISIBILITY_MAX_STEPS
197 #if SFG_RAYCASTING_MAX_STEPS < 15
198 #define SFG_RAYCASTING_VISIBILITY_MAX_STEPS 15
200 #define SFG_RAYCASTING_VISIBILITY_MAX_STEPS SFG_RAYCASTING_MAX_STEPS
205 Same as SFG_RAYCASTING_MAX_HITS but for visibility rays that are used to check
206 whether sprites are visible etc.
208 #ifndef SFG_RAYCASTING_VISIBILITY_MAX_HITS
209 #if SFG_RAYCASTING_MAX_HITS < 6
210 #define SFG_RAYCASTING_VISIBILITY_MAX_HITS 6
212 #define SFG_RAYCASTING_VISIBILITY_MAX_HITS SFG_RAYCASTING_MAX_HITS
217 How many times rendering should be subsampled horizontally. Bigger number
218 can significantly improve performance (by casting fewer rays), but can look
219 a little worse. This number should be a divisor of SFG_SCREEN_RESOLUTION_X!
221 #ifndef SFG_RAYCASTING_SUBSAMPLE
222 #define SFG_RAYCASTING_SUBSAMPLE 1
226 Enables or disables fog (darkness) due to distance. Recommended to keep on
227 for good look, but can be turned off for performance.
229 #ifndef SFG_ENABLE_FOG
230 #define SFG_ENABLE_FOG 1
234 Says whether sprites should diminish in fog. This takes more performance but
237 #ifndef SFG_DIMINISH_SPRITES
238 #define SFG_DIMINISH_SPRITES 1
242 How quick player head bob is, 1024 meaning once per second. 0 Means turn off
245 #ifndef SFG_HEADBOB_SPEED
246 #define SFG_HEADBOB_SPEED 900
250 Sets head bob offset, in RCL_UNITS_PER_SQUARE. 0 Means turn off head bob.
252 #ifndef SFG_HEADBOB_OFFSET
253 #define SFG_HEADBOB_OFFSET 200
257 If head bob is on, this additionally sets additional camera shear bob, in
258 pixels, which can make bobbing look more "advanced". 0 turns this option off.
260 #ifndef SFG_HEADBOB_SHEAR
261 #define SFG_HEADBOB_SHEAR 0
265 Weapon bobbing offset in weapon image pixels.
267 #ifndef SFG_WEAPONBOB_OFFSET
268 #define SFG_WEAPONBOB_OFFSET 4
272 Camera shearing (looking up/down) speed, in vertical resolutions per second.
274 #ifndef SFG_CAMERA_SHEAR_SPEED
275 #define SFG_CAMERA_SHEAR_SPEED 3
279 Maximum camera shear (vertical angle). 1024 means 1.0 * vertical resolution.
281 #ifndef SFG_CAMERA_MAX_SHEAR
282 #define SFG_CAMERA_MAX_SHEAR 1024
286 Specifies how quick some sprite animations are, in frames per second.
288 #ifndef SFG_SPRITE_ANIMATION_SPEED
289 #define SFG_SPRITE_ANIMATION_SPEED 4
293 How wide the border indicator is, in fractions of screen width.
295 #ifndef SFG_HUD_BORDER_INDICATOR_WIDTH
296 #define SFG_HUD_BORDER_INDICATOR_WIDTH 32
300 For how long border indication (being hurt etc.) stays shown, in ms.
302 #ifndef SFG_HUD_BORDER_INDICATOR_DURATION
303 #define SFG_HUD_BORDER_INDICATOR_DURATION 500
307 Color (palette index) by which being hurt is indicated.
309 #ifndef SFG_HUD_HURT_INDICATION_COLOR
310 #define SFG_HUD_HURT_INDICATION_COLOR 175
314 Color (palette index) by which taking an item is indicated.
316 #ifndef SFG_HUD_ITEM_TAKEN_INDICATION_COLOR
317 #define SFG_HUD_ITEM_TAKEN_INDICATION_COLOR 207
321 How many element (items, monsters, ...) distances will be checked per frame
322 for distance. Higher value may decrease performance a tiny bit, but things
323 will react more quickly and appear less "out of thin air".
325 #ifndef SFG_ELEMENT_DISTANCES_CHECKED_PER_FRAME
326 #define SFG_ELEMENT_DISTANCES_CHECKED_PER_FRAME 8
330 Maximum distance at which sound effects (SFX) will be played. The SFX volume
331 will gradually drop towards this distance.
333 #ifndef SFG_SFX_MAX_DISTANCE
334 #define SFG_SFX_MAX_DISTANCE (1024 * 60)
338 Says the intensity of background image blur. 0 means no blur, which improves
339 performance and lowers memory usage. Blur doesn't look very good in small
342 #ifndef SFG_BACKGROUND_BLUR
343 #define SFG_BACKGROUND_BLUR 0
347 Defines the period, in ms, of things that blink, such as text.
349 #ifndef SFG_BLINK_PERIOD
350 #define SFG_BLINK_PERIOD 500
354 Probability (0 - 255) of how often a monster makes sound during movement.
356 #ifndef SFG_MONSTER_SOUND_PROBABILITY
357 #define SFG_MONSTER_SOUND_PROBABILITY 64
361 Affects how precise monsters are in aiming, specify random range in
362 fourths of a game square. Should be power of 2 for performance.
364 #ifndef SFG_MONSTER_AIM_RANDOMNESS
365 #define SFG_MONSTER_AIM_RANDOMNESS 4
368 /// Color 1 index of player on map.
369 #ifndef SFG_MAP_PLAYER_COLOR1
370 #define SFG_MAP_PLAYER_COLOR1 93
373 /// Color 2 index of player on map.
374 #ifndef SFG_MAP_PLAYER_COLOR2
375 #define SFG_MAP_PLAYER_COLOR2 111
378 /// Color index of elevators on map.
379 #ifndef SFG_MAP_ELEVATOR_COLOR
380 #define SFG_MAP_ELEVATOR_COLOR 214
383 /// Color index of squeezers on map.
384 #ifndef SFG_MAP_SQUEEZER_COLOR
385 #define SFG_MAP_SQUEEZER_COLOR 246
388 /// Color index of door on map.
389 #ifndef SFG_MAP_DOOR_COLOR
390 #define SFG_MAP_DOOR_COLOR 188
394 Boolean value indicating whether current OS is malware.
396 #ifndef SFG_OS_IS_MALWARE
397 #define SFG_OS_IS_MALWARE 0
401 Angle difference, as a cos value in RCL_Units, between the player and a
402 monster, at which vertical autoaim will trigger. If the angle is greater, a
403 shot will go directly forward.
405 #ifndef SFG_VERTICAL_AUTOAIM_ANGLE_THRESHOLD
406 #define SFG_VERTICAL_AUTOAIM_ANGLE_THRESHOLD 50
410 Byte (0 - 255) volume of the menu click sound.
412 #ifndef SFG_MENU_CLICK_VOLUME
413 #define SFG_MENU_CLICK_VOLUME 220
417 Says whether the exit item should be showed in the menu. Platforms that can't
418 exit (such as some gaming consoles that simply use power off button) can
422 #define SFG_CAN_EXIT 1
426 On Arduino platforms this should be set to 1. That will cause some special
427 treatment regarding constant variables and PROGMEM.
430 #define SFG_ARDUINO 0
434 Whether levels background (in distance or transparent wall textures) should
435 be drawn. If turned off, the background will be constant color, which can
436 noticably increase performance.
438 #ifndef SFG_DRAW_LEVEL_BACKGROUND
439 #define SFG_DRAW_LEVEL_BACKGROUND 1
443 Says the size, in pixels, of a sprite when it is closest to the camera, which
444 is the maximum size that can be drawn. Sprites on "weird" aspect ratios can
445 look weirdly scaled, so this option can be used to fix that (typically set
446 horizontal screen resolution instead of vertical).
448 #ifndef SFG_SPRITE_MAX_SIZE
449 #define SFG_SPRITE_MAX_SIZE \
450 (SFG_SCREEN_RESOLUTION_Y / SFG_RESOLUTION_SCALEDOWN)
454 If set, single item menu will be forced.
456 #ifndef SFG_FORCE_SINGLE_ITEM_MENU
457 #define SFG_FORCE_SINGLE_ITEM_MENU 0
460 //------ developer/debug settings ------
463 Developer cheat for having infinite ammo in all weapons.
465 #ifndef SFG_INFINITE_AMMO
466 #define SFG_INFINITE_AMMO 0
470 Developer cheat for immortality.
473 #define SFG_IMMORTAL 0
477 Developer setting, with 1 every level is won immediately after start.
479 #ifndef SFG_QUICK_WIN
480 #define SFG_QUICK_WIN 0
484 Reveals all levels to be played.
486 #ifndef SFG_ALL_LEVELS
487 #define SFG_ALL_LEVELS 0
491 Turn on for previes mode for map editing (flying, noclip, fast movement etc.).
493 #ifndef SFG_PREVIEW_MODE
494 #define SFG_PREVIEW_MODE 0
498 How much faster movement is in the preview mode.
500 #ifndef SFG_PREVIEW_MODE_SPEED_MULTIPLIER
501 #define SFG_PREVIEW_MODE_SPEED_MULTIPLIER 2
505 Skips menu and starts given level immediatelly, for development. 0 means this
506 options is ignored, 1 means load level 1 etc.
508 #ifndef SFG_START_LEVEL
509 #define SFG_START_LEVEL 0
513 Reveals whole level map from start.
515 #ifndef SFG_REVEAL_MAP
516 #define SFG_REVEAL_MAP 0
520 Gives player all keys from start.
522 #ifndef SFG_UNLOCK_DOOR
523 #define SFG_UNLOCK_DOOR 0