2010-11-29 19:13:04 +01:00
|
|
|
/*
|
2013-02-24 18:40:43 +01:00
|
|
|
Minetest
|
2013-02-24 19:38:45 +01:00
|
|
|
Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
|
2010-11-29 19:13:04 +01:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
2012-06-05 16:56:56 +02:00
|
|
|
it under the terms of the GNU Lesser General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2.1 of the License, or
|
2010-11-29 19:13:04 +01:00
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2012-06-05 16:56:56 +02:00
|
|
|
GNU Lesser General Public License for more details.
|
2010-11-29 19:13:04 +01:00
|
|
|
|
2012-06-05 16:56:56 +02:00
|
|
|
You should have received a copy of the GNU Lesser General Public License along
|
2010-11-29 19:13:04 +01:00
|
|
|
with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
|
|
|
|
2017-08-17 22:19:39 +02:00
|
|
|
#pragma once
|
2011-01-07 18:39:27 +01:00
|
|
|
|
2010-11-27 00:02:21 +01:00
|
|
|
/*
|
2011-01-07 18:39:27 +01:00
|
|
|
All kinds of constants.
|
|
|
|
|
2019-10-24 02:17:00 +02:00
|
|
|
Cross-platform compatibility stuff should go in porting.h.
|
2012-06-16 17:15:06 +02:00
|
|
|
|
2019-10-24 02:17:00 +02:00
|
|
|
Some things here are legacy.
|
2010-11-27 00:02:21 +01:00
|
|
|
*/
|
|
|
|
|
2012-06-16 17:15:06 +02:00
|
|
|
/*
|
|
|
|
Connection
|
|
|
|
*/
|
2010-11-27 00:02:21 +01:00
|
|
|
|
2013-08-11 04:09:45 +02:00
|
|
|
#define PEER_ID_INEXISTENT 0
|
|
|
|
#define PEER_ID_SERVER 1
|
|
|
|
|
2011-01-07 18:39:27 +01:00
|
|
|
// Define for simulating the quirks of sending through internet.
|
|
|
|
// Causes the socket class to deliberately drop random packets.
|
|
|
|
// This disables unit testing of socket and connection.
|
2010-11-27 00:02:21 +01:00
|
|
|
#define INTERNET_SIMULATOR 0
|
2013-06-23 09:31:22 +02:00
|
|
|
#define INTERNET_SIMULATOR_PACKET_LOSS 10 // 10 = easy, 4 = hard
|
2010-11-27 00:02:21 +01:00
|
|
|
|
|
|
|
#define CONNECTION_TIMEOUT 30
|
|
|
|
|
2014-07-12 15:58:08 +02:00
|
|
|
#define RESEND_TIMEOUT_MIN 0.1
|
2010-11-27 00:02:21 +01:00
|
|
|
#define RESEND_TIMEOUT_MAX 3.0
|
|
|
|
// resend_timeout = avg_rtt * this
|
|
|
|
#define RESEND_TIMEOUT_FACTOR 4
|
|
|
|
|
2011-01-17 13:57:37 +01:00
|
|
|
/*
|
2012-06-16 17:15:06 +02:00
|
|
|
Server
|
2011-01-17 13:57:37 +01:00
|
|
|
*/
|
|
|
|
|
2010-12-19 15:51:45 +01:00
|
|
|
// This many blocks are sent when player is building
|
2010-11-29 09:52:07 +01:00
|
|
|
#define LIMITED_MAX_SIMULTANEOUS_BLOCK_SENDS 0
|
2012-06-16 17:15:06 +02:00
|
|
|
// Override for the previous one when distance of block is very low
|
2010-11-29 09:52:07 +01:00
|
|
|
#define BLOCK_SEND_DISABLE_LIMITS_MAX_D 1
|
2010-11-27 17:10:11 +01:00
|
|
|
|
2012-06-16 17:15:06 +02:00
|
|
|
/*
|
|
|
|
Map-related things
|
|
|
|
*/
|
2010-11-27 00:02:21 +01:00
|
|
|
|
2012-06-16 17:15:06 +02:00
|
|
|
// The absolute working limit is (2^15 - viewing_range).
|
|
|
|
// I really don't want to make every algorithm to check if it's going near
|
|
|
|
// the limit or not, so this is lower.
|
2015-07-13 17:01:31 +02:00
|
|
|
// This is the maximum value the setting map_generation_limit can be
|
|
|
|
#define MAX_MAP_GENERATION_LIMIT (31000)
|
2010-11-27 00:02:21 +01:00
|
|
|
|
2012-06-16 17:15:06 +02:00
|
|
|
// Size of node in floating-point units
|
|
|
|
// The original idea behind this is to disallow plain casts between
|
|
|
|
// floating-point and integer positions, which potentially give wrong
|
|
|
|
// results. (negative coordinates, values between nodes, ...)
|
|
|
|
// Use floatToInt(p, BS) and intToFloat(p, BS).
|
2017-08-20 19:37:55 +02:00
|
|
|
#define BS 10.0f
|
2012-06-16 17:15:06 +02:00
|
|
|
|
|
|
|
// Dimension of a MapBlock
|
|
|
|
#define MAP_BLOCKSIZE 16
|
|
|
|
// This makes mesh updates too slow, as many meshes are updated during
|
|
|
|
// the main loop (related to TempMods and day/night)
|
|
|
|
//#define MAP_BLOCKSIZE 32
|
2010-11-27 00:02:21 +01:00
|
|
|
|
2017-08-06 04:57:34 +02:00
|
|
|
// Player step height in nodes
|
|
|
|
#define PLAYER_DEFAULT_STEPHEIGHT 0.6f
|
|
|
|
|
2010-11-27 16:18:34 +01:00
|
|
|
/*
|
2012-06-16 17:15:06 +02:00
|
|
|
Old stuff that shouldn't be hardcoded
|
2010-11-27 16:18:34 +01:00
|
|
|
*/
|
2012-06-16 17:15:06 +02:00
|
|
|
|
|
|
|
// Size of player's main inventory
|
2017-04-23 09:52:40 +02:00
|
|
|
#define PLAYER_INVENTORY_SIZE (8 * 4)
|
2010-11-27 16:18:34 +01:00
|
|
|
|
2021-01-27 19:42:02 +01:00
|
|
|
// Default maximum health points of a player
|
2017-08-23 22:32:10 +02:00
|
|
|
#define PLAYER_MAX_HP_DEFAULT 20
|
2011-02-05 13:55:16 +01:00
|
|
|
|
2017-09-15 12:18:47 +02:00
|
|
|
// Default maximal breath of a player
|
2020-04-28 19:30:57 +02:00
|
|
|
#define PLAYER_MAX_BREATH_DEFAULT 10
|
2015-02-04 09:00:34 +01:00
|
|
|
|
2014-06-23 21:55:47 +02:00
|
|
|
// Number of different files to try to save a player to if the first fails
|
|
|
|
// (because of a case-insensitive filesystem)
|
|
|
|
// TODO: Use case-insensitive player names instead of this hack.
|
|
|
|
#define PLAYER_FILE_ALTERNATE_TRIES 1000
|
|
|
|
|
2015-03-31 08:13:42 +02:00
|
|
|
// For screenshots a serial number is appended to the filename + datetimestamp
|
|
|
|
// if filename + datetimestamp is not unique.
|
|
|
|
// This is the maximum number of attempts to try and add a serial to the end of
|
|
|
|
// the file attempting to ensure a unique filename
|
|
|
|
#define SCREENSHOT_MAX_SERIAL_TRIES 1000
|
|
|
|
|
2014-06-14 11:22:09 +02:00
|
|
|
/*
|
2015-01-10 18:59:43 +01:00
|
|
|
GUI related things
|
|
|
|
*/
|
2015-02-14 20:16:09 +01:00
|
|
|
|
2017-04-23 09:52:40 +02:00
|
|
|
#define TTF_DEFAULT_FONT_SIZE (16)
|
|
|
|
#define DEFAULT_FONT_SIZE (10)
|