3 Copyright (C) 2010 celeron55, Perttu Ahola <celeron55@gmail.com>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 #ifndef CONSTANTS_HEADER
21 #define CONSTANTS_HEADER
24 All kinds of constants.
26 Cross-platform compatibility crap should go in porting.h.
31 #define APPNAME "minetest"
33 #define DEBUGFILE "debug.txt"
35 #define WATER_ALPHA 160
36 //#define WATER_ALPHA 190
38 // Define for simulating the quirks of sending through internet.
39 // Causes the socket class to deliberately drop random packets.
40 // This disables unit testing of socket and connection.
41 #define INTERNET_SIMULATOR 0
43 #define CONNECTION_TIMEOUT 30
45 #define RESEND_TIMEOUT_MIN 0.333
46 #define RESEND_TIMEOUT_MAX 3.0
47 // resend_timeout = avg_rtt * this
48 #define RESEND_TIMEOUT_FACTOR 4
52 // This is the same as in minecraft and everything else
53 #define FOV_ANGLE (PI/2.5)
55 // The absolute working limit is (2^15 - viewing_range).
56 // I really don't want to make every algorithm to check if it's
57 // going near the limit or not, so this is lower.
58 #define MAP_GENERATION_LIMIT (31000)
60 // Size of node in rendering units
63 #define MAP_BLOCKSIZE 16
65 This makes mesh updates too slow, as many meshes are updated during
66 the main loop (related to TempMods and day/night)
68 //#define MAP_BLOCKSIZE 32
70 // Sectors are split to SECTOR_HEIGHTMAP_SPLIT^2 heightmaps
71 #define SECTOR_HEIGHTMAP_SPLIT (MAP_BLOCKSIZE/8)
73 // Time after building, during which the following limit
75 //#define FULL_BLOCK_SEND_ENABLE_MIN_TIME_FROM_BUILDING 2.0
76 // This many blocks are sent when player is building
77 #define LIMITED_MAX_SIMULTANEOUS_BLOCK_SENDS 0
78 // Override for the previous one when distance of block
80 #define BLOCK_SEND_DISABLE_LIMITS_MAX_D 1
82 #define PLAYER_INVENTORY_SIZE (8*4)
84 #define SIGN_TEXT_MAX_LENGTH 50
86 // Whether to catch all std::exceptions.
87 // Assert will be called on such an event.
88 // In debug mode, leave these for the debugger and don't catch them.
90 #define CATCH_UNHANDLED_EXCEPTIONS 1
92 #define CATCH_UNHANDLED_EXCEPTIONS 0
96 Collecting active blocks is stopped after object data
99 #define MAX_OBJECTDATA_SIZE 450
102 This is good to be a bit different than 0 so that water level
103 is not between two MapBlocks
105 #define WATER_LEVEL 1
107 // Length of cracking animation in count of images
108 #define CRACK_ANIMATION_LENGTH 5
110 // Some stuff needed by old code moved to here from heightmap.h
111 #define GROUNDHEIGHT_NOTFOUND_SETVALUE (-10e6)
112 #define GROUNDHEIGHT_VALID_MINVALUE ( -9e6)