3 Copyright (C) 2013 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 Lesser General Public License as published by
7 the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser 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.
28 Some things here are legacy crap.
35 // Define for simulating the quirks of sending through internet.
36 // Causes the socket class to deliberately drop random packets.
37 // This disables unit testing of socket and connection.
38 #define INTERNET_SIMULATOR 0
39 #define INTERNET_SIMULATOR_PACKET_LOSS 10 // 10 = easy, 4 = hard
41 #define CONNECTION_TIMEOUT 30
43 #define RESEND_TIMEOUT_MIN 0.333
44 #define RESEND_TIMEOUT_MAX 3.0
45 // resend_timeout = avg_rtt * this
46 #define RESEND_TIMEOUT_FACTOR 4
52 // This many blocks are sent when player is building
53 #define LIMITED_MAX_SIMULTANEOUS_BLOCK_SENDS 0
54 // Override for the previous one when distance of block is very low
55 #define BLOCK_SEND_DISABLE_LIMITS_MAX_D 1
61 // The absolute working limit is (2^15 - viewing_range).
62 // I really don't want to make every algorithm to check if it's going near
63 // the limit or not, so this is lower.
64 #define MAP_GENERATION_LIMIT (31000)
66 // Size of node in floating-point units
67 // The original idea behind this is to disallow plain casts between
68 // floating-point and integer positions, which potentially give wrong
69 // results. (negative coordinates, values between nodes, ...)
70 // Use floatToInt(p, BS) and intToFloat(p, BS).
73 // Dimension of a MapBlock
74 #define MAP_BLOCKSIZE 16
75 // This makes mesh updates too slow, as many meshes are updated during
76 // the main loop (related to TempMods and day/night)
77 //#define MAP_BLOCKSIZE 32
80 Old stuff that shouldn't be hardcoded
83 // Size of player's main inventory
84 #define PLAYER_INVENTORY_SIZE (8*4)
87 This is good to be a bit different than 0 so that water level is not
92 // Maximum hit points of a player
93 #define PLAYER_MAX_HP 20