terom@185: #ifndef CONFIG_HH terom@185: #define CONFIG_HH terom@185: terom@412: /** terom@412: * @file terom@412: * terom@412: * Various constants used to define application/game behaviour terom@412: */ terom@412: terom@412: // build settings terom@220: #include "config.h" terom@220: terom@412: // custom types terom@300: #include "Types.hh" terom@300: terom@423: // for Color terom@423: #include "Graphics/Color.hh" terom@423: using graphics::Color; terom@185: terom@283: /** terom@418: * @name General terom@418: * @{ terom@283: */ terom@418: terom@418: // @} terom@185: terom@408: /** terom@418: * @name Terrain terom@418: * @{ terom@408: */ terom@418: terom@418: /** Default random generator seed to use for terrain generator */ terom@408: const int TERRAIN_RANDOM_SEED = 1337; terom@408: terom@418: /** Default terrain size, equal to physics simulation size */ terom@418: const PixelDimensions TERRAIN_DIMENSIONS (1000, 800); terom@418: terom@418: /** Base color of empty space (i.e. background color) */ terom@423: const Color COLOR_EMPTY(86, 41, 0); terom@418: terom@418: /** Base color of dirt */ terom@423: const Color COLOR_DIRT(144, 82, 23); terom@418: terom@418: /** Base color of rock */ terom@423: const Color COLOR_ROCK(132, 136, 135); terom@418: terom@418: terom@418: // @} terom@418: terom@408: /** terom@418: * @name Engine terom@418: * @{ terom@408: */ terom@266: terom@380: /** Engine timeout, this determines our minimum tick rate */ terom@380: const TimeMS ENGINE_TIMEOUT_MS = 10; terom@380: terom@418: /** Default log output level */ terom@418: const LogLevel DEFAULT_LOG_LEVEL = DEBUG; terom@418: terom@418: // @} terom@418: terom@418: /** terom@418: * @name Physics terom@418: * @{ terom@418: */ terom@418: terom@418: /** The value of pi used in physics/graphics calculations */ terom@423: const float KG_PI = 3.14159265f; terom@418: terom@380: /** Physics tick interval */ terom@380: const TimeMS PHYSICS_TICK_MS = 10; terom@185: terom@418: /** The force of gravity on objects, exerted on the Y axis */ terom@418: const float MAP_GRAVITY = 1500.0; terom@311: terom@418: // @} terom@311: terom@283: /** terom@418: * @name Player terom@418: * @{ terom@283: */ terom@185: terom@185: const float PLAYER_MASS = 10.0; nireco@219: const float PLAYER_MOVE_FORCE = 1100.0; nireco@219: const float PLAYER_MIN_SPEED = 10.0; terom@185: const float PLAYER_JUMP_MIN_DISTANCE = 5.0; terom@423: const float PLAYER_AIM_MIN = -3 * KG_PI / 8; terom@423: const float PLAYER_AIM_MAX = KG_PI / 2; terom@185: const float PLAYER_INITIAL_X = 400.0; terom@185: const float PLAYER_INITIAL_Y = 300.0; terom@261: const float PLAYER_CROSSHAIR_DISTANCE = 20.0; terom@261: const float PLAYER_CROSSHAIR_WIDTH = 4; terom@423: const float CROSSHAIR_ANGLE_SPEED = KG_PI / 2000; nireco@219: const float PLAYER_MAX_SPEED = 43; nireco@219: const float PLAYER_WALK_SPEED = 33; terom@418: const float PLAYER_COLLISION_ELASTICITY = 0.25; nireco@288: const float PLAYER_RADIUS = 10; terom@185: terom@418: /** Radius if ground removed on digging */ terom@300: const float PLAYER_DIG_RADIUS = 15; terom@300: terom@300: /** Player's initial health */ terom@300: const Health PLAYER_HEALTH = 100; terom@300: terom@300: /** How long to wait after dying to respawn */ terom@300: const TimeMS PLAYER_RESPAWN_DELAY = 2500; terom@300: terom@418: // @} terom@418: terom@418: /** terom@418: * @name Projectile terom@418: * @{ terom@276: */ terom@276: terom@418: /** Projectiles mass is irrelevant */ terom@276: const float PROJECTILE_MASS = 10.0; terom@276: terom@418: /** How far away from the player the projectile spawns */ terom@235: const float PROJECTILE_START_DISTANCE = 10.0; terom@235: terom@418: // @} terom@418: terom@418: /** terom@377: * @name Rope terom@377: * @{ terom@276: */ terom@276: terom@377: /** How much to grow the rope length by on every ROPE_UP/DOWN */ terom@235: const float ROPE_GROWTH_RATE = 5; terom@276: terom@377: /** The force that the rope exerts on the player when the length is too long */ terom@235: const float ROPE_FORCE = 3500; terom@276: terom@377: /** Same as player mass...? */ terom@276: const float ROPE_MASS = 10.0; terom@276: terom@377: /** Initial rope length... this should probably be a bit more dynamic? */ terom@235: const float ROPE_LENGTH = 100.0; terom@276: terom@377: /** Initial velocity of the rope when thrown */ terom@235: const float ROPE_VELOCITY = 500; terom@235: terom@377: /** terom@377: * Rope colors, it should alternate between these two terom@377: */ terom@423: const Color ROPE_COLOR_LIGHT(198, 100, 2); terom@423: const Color ROPE_COLOR_DARK(159, 79, 1); terom@377: terom@377: // @} terom@377: terom@418: /** terom@418: * @name Graphics/Input terom@418: * @{ terom@418: */ terom@185: terom@418: /** Window title, XXX: PROJECT_VERSION is unreliable */ terom@398: const std::string GRAPHICS_WINDOW_TITLE = (std::string() + PROJECT_LONG_NAME + " : Version " + PROJECT_VERSION); terom@418: terom@418: /** Default resolution */ terom@418: const PixelDimensions GRAPHICS_RESOLUTION (800, 600); terom@418: terom@418: /** Interval between frames */ terom@418: const TimeMS GRAPHICS_UPDATE_INTERVAL_MS = 20; terom@418: terom@418: /** Default fullscreen mode? */ terom@389: const bool GRAPHICS_FULLSCREEN = false; terom@266: terom@418: /** Number of pixels between lines */ terom@393: const PixelDimension GRAPHICS_INFO_TEXT_LINE_OFFSET = 5; terom@266: terom@418: /** Input handling keyboard poll interval */ terom@418: const TimeMS INPUT_POLL_INTERVAL = 10; terom@418: terom@418: /** How long to block INPUT_FLAG_NOREPEAT for */ terom@418: const TimeMS INPUT_REPEAT_DELAY = 250; terom@418: terom@418: // @} terom@418: terom@417: /** terom@417: * @name Network terom@417: * @{ terom@417: */ terom@417: terom@417: /** Default port used for network games */ terom@417: const std::string NETWORK_PORT_STR = "9338"; terom@417: terom@417: /** Maximum packet size used for normal NetworkPackets... aligned to a sensible UDP mtu */ terom@417: const size_t NETWORK_PACKET_SIZE = 1280; terom@417: terom@417: /** Backlog used for TCP server... doesn't really matter all that much */ terom@417: const int NETWORK_LISTEN_BACKLOG = 5; terom@417: terom@417: /** Magic string used to identify game between client/server */ terom@417: const char NETWORK_MAGIC_STR[8+1] = "KISNGLIS"; terom@417: const uint64_t NETWORK_MAGIC_ID = * ((const uint64_t *) NETWORK_MAGIC_STR); terom@417: terom@417: // @} terom@417: terom@417: /** terom@417: * @name Filesystem paths terom@417: * @{ terom@417: */ terom@220: const std::string PLAYER_SKIN_PATH = (PROJECT_DATA_DIR "/skin.png"); terom@233: const std::string RESOURCE_XML_PATH = (PROJECT_DATA_DIR "/resources.xml"); terom@220: terom@417: // @} terom@417: terom@185: #endif