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.
21 (c) 2010 Perttu Ahola <celeron55@gmail.com>
24 #ifndef CONSTANTS_HEADER
25 #define CONSTANTS_HEADER
27 #define DEBUGFILE "debug.txt"
29 // Define for simulating the quirks of sending through internet
30 // WARNING: This disables unit testing of socket and connection
31 #define INTERNET_SIMULATOR 0
33 #define CONNECTION_TIMEOUT 30
35 #define RESEND_TIMEOUT_MIN 0.333
36 #define RESEND_TIMEOUT_MAX 3.0
37 // resend_timeout = avg_rtt * this
38 #define RESEND_TIMEOUT_FACTOR 4
42 // This is the same as in minecraft and everything else
43 #define FOV_ANGLE (PI/2.5)
45 // The absolute working limit is (2^15 - viewing_range).
46 #define MAP_GENERATION_LIMIT (31000)
48 // Time after building, during which the following limit
50 //#define FULL_BLOCK_SEND_ENABLE_MIN_TIME_FROM_BUILDING 2.0
51 // This many blocks are sent when player is building
52 #define LIMITED_MAX_SIMULTANEOUS_BLOCK_SENDS 0
53 // Override for the previous one when distance of block
55 #define BLOCK_SEND_DISABLE_LIMITS_MAX_D 1
57 // Viewing range stuff
59 //#define FREETIME_RATIO 0.15
60 //#define FREETIME_RATIO 0.0
61 #define FREETIME_RATIO 0.05
63 // Sectors are split to SECTOR_HEIGHTMAP_SPLIT^2 heightmaps
64 #define SECTOR_HEIGHTMAP_SPLIT 2
66 #define PLAYER_INVENTORY_SIZE (8*4)
68 #define SIGN_TEXT_MAX_LENGTH 50
70 // Whether to catch all std::exceptions.
71 // Assert will be called on such an event.
73 #define CATCH_UNHANDLED_EXCEPTIONS 0
75 #define CATCH_UNHANDLED_EXCEPTIONS 1
79 Collecting active blocks is stopped after object data
82 #define MAX_OBJECTDATA_SIZE 450
84 #define WATER_LEVEL (0)
86 // Length of cracking animation in count of images
87 #define CRACK_ANIMATION_LENGTH 5