Crossfire Server, Trunk  R20513
config.h
Go to the documentation of this file.
1 #ifndef CONFIG_H
2 #define CONFIG_H
3 
24 /* There are 4 main sections to this file-
25  * Section 1 is feature selection (enabling/disabling certain features)
26  *
27  * Section 2 is compiler/machine dependant section (stuff that just
28  * makes the program compile and run properly, but don't change the
29  * behavior)
30  *
31  * Section 3 is location of certain files and other defaults. Things in
32  * this section generally do not need to be changed, and generally do
33  * not alter the play as perceived by players. However, you may
34  * have your own values you want to set here.
35  *
36  * Section 4 deals with save file related options.
37  */
38 
39 /*******************************************************************
40  * SECTION 1 - FEATURES
41  *
42  * You don't have to change anything here to get a working program, but
43  * you may want to on personal preferance. Items are arranged
44  * alphabetically.
45  *
46  * Short list of features, and what to search for:
47  * CS_LOGSTATS - log various new client/server data.
48  * DEBUG - more verbose message logging?
49  * MAP_CLIENT_X, MAP_CLIENT_Y - determines max size client map will receive
50  * MAX_TIME - how long an internal tick is in microseconds
51  * MANY_CORES - generate core dumps on gross errors instead of continuing?
52  * PARTY_KILL_LOG - stores party kill information
53  * WATCHDOG - allows use of an external watchdog program
54  *
55  ***********************************************************************/
56 
57 /* These are basically experimental values right now - perhaps should
58  * be turned into settings values at load time, but want to make
59  * sure we go down this road before doing that.
60  *
61  * MIN_PLAYER_SPEED: If a player is fully loaded with junk, this is
62  * how slow the character will move.
63  *
64  * MAX_PLAYER_SPEED: If the player is unloaded, this is how fast the
65  * player will move. Note that armor will still affect this (a
66  * character otherwise unloaded but wearing plate will be slower)
67  *
68  * FREE_PLAYER_LOAD_PERCENT: This value is how much of the players
69  * load is 'free' before it starts slowing them down - just because
70  * I pick up a book doesn't make me slower.
71  *
72  * Example: Player has a max carrying capacity of 1000 kg. If he is
73  * carrying 1000 KG, he moves at MIN_PLAYER_SPEED (0.25 by default).
74  * The free load is 0.50 (50%), which means he can carry 500 kg before
75  * he starts to slow down. So if his load is anywhere between 0 and 500 kg
76  * and character is otherwise not wearing armor or other things that slow
77  * him down, he moves at 0.75
78  * Once he goes above 500 kg, his speed is now a linear difference of
79  * MIN and MAX. With the nice round numbers chosen, it amounts to
80  * each 1 kg of look slows character down 0.001 (500 * 0.001 = 0.5,
81  * 0.75 - 0.5 = 0.25)
82  *
83  * The values can be adjusted in various ways - a free load percent
84  * of 1.0 means how much you carry does not affect movement speed.
85  * One could also adjust these values for slower of faster movement.
86  *
87  * 0.75 was chosen as default for fast movement as this gives room
88  * for magic (and other effects) to speed up the player, but speed
89  * still remain below 1.
90  *
91  * 0.25 was chosen as low end as that is still fairly slow (about
92  * 2 spaces/second), but not so slow to be really painful -
93  * typically it is low level characters that have this issue
94  * more, so I think this will improve playing quality.
95  */
96 #define MIN_PLAYER_SPEED 0.25
97 #define MAX_PLAYER_SPEED 0.75
98 #define FREE_PLAYER_LOAD_PERCENT 0.50
99 
100 /*
101  * BASE_WEAPON_SPEED is sort of like the speed - what the characters
102  * weapon_speed is before we start factoring in bonuses & penalties.
103  * Want fast melee? Increase this. Slow melee? decrease this.
104  * Note that weapon_speed decreases this, so generally you want
105  * to start higher, as there isn't a lot of things that
106  * will increase this
107  */
108 #define BASE_WEAPON_SPEED 1.0
109 
110 /* Use balanced stat loss code?
111  * This code is a little more merciful with repeated stat loss at lower
112  * levels. Basically, the more stats you have lost, the less likely that
113  * you will lose more. Additionally, lower level characters are shown
114  * a lot more mercy (there are caps on how much of a stat you can lose too).
115  * On the nasty side, if you are higher level, you can lose mutiple stats
116  * _at_once_ and are shown less mercy when you die. But when you're higher
117  * level, it is much easier to buy back your stats with potions.
118  * Turn this on if you want death-based stat loss to be more merciful
119  * at low levels and more cruel at high levels.
120  * Only works when stats are depleted rather than lost. This option has
121  * no effect if you are using genuine stat loss.
122  *
123  * The BALSL_.. values control this behaviour.
124  * BALSL_NUMBER_LOSSES_RATIO determines the number of stats to lose.
125  * the character level is divided by that value, and that is how many
126  * stats are lost.
127  *
128  * BALSL_MAX_LOSS_RATIO puts the upper limit on depletion of a stat -
129  * basically, level/max_loss_ratio is the most a stat can be depleted.
130  *
131  * BALSL_LOSS_CHANCE_RATIO controls how likely it is a stat is depleted.
132  * The chance not to lose a stat is
133  * depleteness^2 / (depletedness^2+ level/ratio).
134  * ie, if the stats current depleted value is 2 and the character is level
135  * 15, the chance not to lose the stat is 4/(4+3) or 4/7. The higher the
136  * level, the more likely it is a stat can get really depleted, but
137  * this gets more offset as the stat gets more depleted.
138  *
139  */
140 /* GD */
141 
142 #define BALSL_LOSS_CHANCE_RATIO 4
143 #define BALSL_NUMBER_LOSSES_RATIO 6
144 #define BALSL_MAX_LOSS_RATIO 2
145 
146 /* Don't edit these values. They are configured in lib/settings. These are
147  Simply the defaults. */
148 
149 #define BALANCED_STAT_LOSS FALSE
150 #define PERMANENT_EXPERIENCE_RATIO 50
151 #define DEATH_PENALTY_RATIO 20
152 #define DEATH_PENALTY_LEVEL 3
153 #define SET_TITLE TRUE
154 #define SIMPLE_EXP TRUE
155 #define SPELLPOINT_LEVEL_DEPEND TRUE
156 #define SPELL_ENCUMBRANCE TRUE
157 #define SPELL_FAILURE_EFFECTS FALSE
158 #define REAL_WIZ TRUE
159 #define RECYCLE_TMP_MAPS FALSE
160 #define RESURRECTION FALSE
161 #define SEARCH_ITEMS TRUE
162 #define NOT_PERMADETH TRUE
163 #define STAT_LOSS_ON_DEATH FALSE
164 #define PK_LUCK_PENALTY 1
165 #define CASTING_TIME FALSE
166 #define SET_FRIENDLY_FIRE 5
167 #define ARMOR_MAX_ENCHANT 5
168 #define ARMOR_WEIGHT_REDUCTION 10
169 #define ARMOR_WEIGHT_LINEAR TRUE
170 #define ARMOR_SPEED_IMPROVEMENT 10
171 #define ARMOR_SPEED_LINEAR TRUE
172 
173 /* you can edit the ones below */
174 
183 #ifndef WIN32 /* ***win32 we set the following stuff in the IDE */
184 #define CS_LOGSTATS
185 #endif
186 #ifdef CS_LOGSTATS
187 #define CS_LOGTIME 600
188 #endif
189 
195 #ifndef WIN32 /* ***win32 we set the following stuff in the IDE */
196 #ifndef DEBUG
197 #define DEBUG
198 #endif
199 #endif
200 
210 #define MANY_CORES
211 
236 #define MAP_CLIENT_X 25
237 #define MAP_CLIENT_Y 25
238 
245 #define MAX_TIME 120000
246 
252 #define NO_POLYMORPH
253 
260 /*
261 #define PARTY_KILL_LOG 20
262 */
263 
285 /* GD */
286 
287 #define PERM_EXP_GAIN_RATIO 0.50f
288 #define PERM_EXP_MAX_LOSS_RATIO 0.50f
289 
297 #ifndef WIN32 /* ***win32 disable watchdog as win32 default */
298 #define WATCHDOG
299 #endif
300 
301 
302 /***********************************************************************
303  * SECTION 2 - Machine/Compiler specific stuff.
304  *
305  * Short list of items:
306  * O_NDELAY - If you don't have O_NDELAY, uncomment it.
307  *
308  ***********************************************************************/
309 
319 /*
320 #define O_NDELAY O_NONBLOCK
321 */
322 
323 
324 /***********************************************************************
325  * Section 3
326  *
327  * General file and other defaults that don't need to be changed, and
328  * do not change gameplay as percieved by players much. Some options
329  * may affect memory consumption however.
330  *
331  * Values:
332  *
333  * BANFILE - ban certain users/hosts.
334  * CSPORT - port to use for new client/server
335  * DMFILE - file with dm/wizard access lists
336  * LOGFILE - where to log if using -daemon option
337  * MAP_ - various map timeout and swapping parameters
338  * MAX_OBJECTS - how many objects to keep in memory.
339  * MAX_OBJECTS_LWM - only swap maps out if below that value
340  * MOTD - message of the day - printed each time someone joins the game
341  * PERM_FILE - limit play times
342  * SHUTDOWN - used when shutting down the server
343  * SOCKETBUFSIZE - size of buffer used internally by the server for storing
344  * backlogged messages.
345  * TMPDIR - directory to use for temp files
346  * UNIQUE_DIR - directory to put unique item files into
347  * USE_CALLOC for some memory requests
348  ***********************************************************************
349  */
350 
355 #ifndef BANFILE
356 #define BANFILE "ban_file"
357 #endif
358 
363 #define CSPORT 13327 /* old port + 1 */
364 
369 #ifndef DMFILE
370 #define DMFILE "dm_file"
371 #endif
372 
377 #ifndef LOGFILE
378 #ifdef WIN32 /* change define path */
379 #define LOGFILE "var\\crossfire.log"
380 #else
381 #define LOGFILE "/var/log/crossfire/logfile"
382 #endif
383 #endif
384 
408 #define MAP_MAXTIMEOUT 1000
409 
410 #define MAP_MINTIMEOUT 500
411 
426 #define MAP_MAXRESET 7200
427 
428 #define MAP_DEFAULTRESET 7200
429 
443 #define MAX_OBJECTS 100000
444 
467 /*#define MAX_OBJECTS_LWM MAX_OBJECTS/2*/
468 
485 /*#define MEMORY_DEBUG 1*/
486 
493 #define MOTD "motd"
494 
499 #define PERM_FILE "forbid"
500 
507 #ifndef SHUTDOWN_FILE
508 #define SHUTDOWN_FILE "shutdown"
509 #endif
510 
521 #define SOCKETBUFSIZE 256*1024
522 
533 /*#define TMPDIR "/home/hugin/a/crossfire/crossfire/tmp"*/
534 #ifdef WIN32 /* change define path tmp */
535 #define TMPDIR "tmp"
536 #else
537 #define TMPDIR "/tmp"
538 #endif
539 
545 #define UNIQUE_DIR "unique-items"
546 
552 #ifdef WIN32 /* change define path city */
553 # define EMERGENCY_MAPPATH "\\world\\world_105_115"
554 #else
555 # define EMERGENCY_MAPPATH "/world/world_105_115"
556 #endif
557 # define EMERGENCY_X 5
558 # define EMERGENCY_Y 37
559 
564 #define MAPDIR "maps"
565 #define TEMPLATE_DIR "template-maps"
566 #define ARCHETYPES "archetypes"
567 #define REGIONS "regions.reg"
568 #define HIGHSCORE "highscore"
569 #define TREASURES "treasures"
570 #define BANISHFILE "banish_file"
571 
572 #define MAX_ERRORS 25
573 #define STARTMAX 500
574 #define OBJ_EXPAND 100
576 #define HIGHSCORE_LENGTH 1000
578 #define ARCHTABLE 8192
579 #define MAXSTRING 20
580 
581 #define COMMAND_HASH_SIZE 107
583 /***********************************************************************
584  * Section 4 - save player options.
585  *
586  * There are a lot of things that deal with the save files, and what
587  * gets saved with them, so I put them in there own section.
588  *
589  ***********************************************************************/
590 
601 #ifndef PLAYERDIR
602 #define PLAYERDIR "players"
603 #endif
604 
616 #define SAVE_MODE 0660
617 #define SAVE_DIR_MODE 0770
618 
619 /* NOTE ON SAVE_INTERVAL and AUTOSAVE: Only one of these two really
620  * needs to be selected. You can set both, and things will work fine,
621  * however, it just means that a lot more saving will be done, which
622  * can slow things down some.
623  */
624 
635 /*#define SAVE_INTERVAL 300*/
636 
647 #define AUTOSAVE 5000
648 
655 #define NO_EMERGENCY_SAVE
656 
663 /*#define BACKUP_SAVE_AT_HOME*/
664 
682 #define RESET_LOCATION_TIME 3600
683 
689 #define BEAT_INTERVAL 3
690 
691 #endif /* CONFIG_H */