src/Config.hh
author Tero Marttila <terom@fixme.fi>
Tue, 20 Jan 2009 23:30:18 +0200
changeset 408 e6cfc44266af
parent 398 306825786fba
child 412 721c60072091
permissions -rw-r--r--
reorganize Terrain/PhysicsWorld/GameState/Engine to use NetworkClientConnect, and hence handle the connection process asynchronously, and finally properly implement receiving the terrain data from the server
185
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
     1
#ifndef CONFIG_HH
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
     2
#define CONFIG_HH
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
     3
220
1c92222af6d3 use Player static vars for texture loading, and load from the PROJECT_DATA_DIR path
terom
parents: 219
diff changeset
     4
// XXX: merge this as Config.hh.in?
1c92222af6d3 use Player static vars for texture loading, and load from the PROJECT_DATA_DIR path
terom
parents: 219
diff changeset
     5
#include "config.h"
1c92222af6d3 use Player static vars for texture loading, and load from the PROJECT_DATA_DIR path
terom
parents: 219
diff changeset
     6
300
417183866f35 suicide key and respawning
terom
parents: 293
diff changeset
     7
#include "Types.hh"
417183866f35 suicide key and respawning
terom
parents: 293
diff changeset
     8
185
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
     9
#include <ClanLib/display.h>
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
    10
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
    11
// This is a temporary way to declare different constants. Maybe we
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
    12
// should do somekind of resource manager? Do we have time?
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
    13
283
7540b0859579 start adding some documentation, most core classes (outside of Network) are now doxygen-enabled
terom
parents: 276
diff changeset
    14
/**
7540b0859579 start adding some documentation, most core classes (outside of Network) are now doxygen-enabled
terom
parents: 276
diff changeset
    15
 * The value of pi used in physics/graphics calculations
7540b0859579 start adding some documentation, most core classes (outside of Network) are now doxygen-enabled
terom
parents: 276
diff changeset
    16
 */
185
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
    17
const float KG_PI = 3.14159265;
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
    18
408
e6cfc44266af reorganize Terrain/PhysicsWorld/GameState/Engine to use NetworkClientConnect, and hence handle the connection process asynchronously, and finally properly implement receiving the terrain data from the server
Tero Marttila <terom@fixme.fi>
parents: 398
diff changeset
    19
/**
e6cfc44266af reorganize Terrain/PhysicsWorld/GameState/Engine to use NetworkClientConnect, and hence handle the connection process asynchronously, and finally properly implement receiving the terrain data from the server
Tero Marttila <terom@fixme.fi>
parents: 398
diff changeset
    20
 * Random generator seed to use for terrain generator
e6cfc44266af reorganize Terrain/PhysicsWorld/GameState/Engine to use NetworkClientConnect, and hence handle the connection process asynchronously, and finally properly implement receiving the terrain data from the server
Tero Marttila <terom@fixme.fi>
parents: 398
diff changeset
    21
 */
e6cfc44266af reorganize Terrain/PhysicsWorld/GameState/Engine to use NetworkClientConnect, and hence handle the connection process asynchronously, and finally properly implement receiving the terrain data from the server
Tero Marttila <terom@fixme.fi>
parents: 398
diff changeset
    22
const int TERRAIN_RANDOM_SEED = 1337;
e6cfc44266af reorganize Terrain/PhysicsWorld/GameState/Engine to use NetworkClientConnect, and hence handle the connection process asynchronously, and finally properly implement receiving the terrain data from the server
Tero Marttila <terom@fixme.fi>
parents: 398
diff changeset
    23
e6cfc44266af reorganize Terrain/PhysicsWorld/GameState/Engine to use NetworkClientConnect, and hence handle the connection process asynchronously, and finally properly implement receiving the terrain data from the server
Tero Marttila <terom@fixme.fi>
parents: 398
diff changeset
    24
/**
e6cfc44266af reorganize Terrain/PhysicsWorld/GameState/Engine to use NetworkClientConnect, and hence handle the connection process asynchronously, and finally properly implement receiving the terrain data from the server
Tero Marttila <terom@fixme.fi>
parents: 398
diff changeset
    25
 * Terrain size, equal to physics simulation size
e6cfc44266af reorganize Terrain/PhysicsWorld/GameState/Engine to use NetworkClientConnect, and hence handle the connection process asynchronously, and finally properly implement receiving the terrain data from the server
Tero Marttila <terom@fixme.fi>
parents: 398
diff changeset
    26
 */
e6cfc44266af reorganize Terrain/PhysicsWorld/GameState/Engine to use NetworkClientConnect, and hence handle the connection process asynchronously, and finally properly implement receiving the terrain data from the server
Tero Marttila <terom@fixme.fi>
parents: 398
diff changeset
    27
const PixelDimension TERRAIN_WIDTH = 1000;
e6cfc44266af reorganize Terrain/PhysicsWorld/GameState/Engine to use NetworkClientConnect, and hence handle the connection process asynchronously, and finally properly implement receiving the terrain data from the server
Tero Marttila <terom@fixme.fi>
parents: 398
diff changeset
    28
const PixelDimension TERRAIN_HEIGHT = 800;
266
ad72d0a0cc02 increase the map size and control the camera to always have the screen full of terrain
terom
parents: 261
diff changeset
    29
380
d193dd1d8a7e new NetworkReactor, fix everything to actually work
terom
parents: 377
diff changeset
    30
/** Engine timeout, this determines our minimum tick rate */
d193dd1d8a7e new NetworkReactor, fix everything to actually work
terom
parents: 377
diff changeset
    31
const TimeMS ENGINE_TIMEOUT_MS = 10;
d193dd1d8a7e new NetworkReactor, fix everything to actually work
terom
parents: 377
diff changeset
    32
d193dd1d8a7e new NetworkReactor, fix everything to actually work
terom
parents: 377
diff changeset
    33
/** Physics tick interval */
d193dd1d8a7e new NetworkReactor, fix everything to actually work
terom
parents: 377
diff changeset
    34
const TimeMS PHYSICS_TICK_MS = 10;
185
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
    35
311
440763821484 make Input have its own timer, and add key-repeat handling, and fix some warnings
terom
parents: 300
diff changeset
    36
/** Input handling keyboard poll interval */
440763821484 make Input have its own timer, and add key-repeat handling, and fix some warnings
terom
parents: 300
diff changeset
    37
const TimeMS INPUT_POLL_INTERVAL = 10;
440763821484 make Input have its own timer, and add key-repeat handling, and fix some warnings
terom
parents: 300
diff changeset
    38
440763821484 make Input have its own timer, and add key-repeat handling, and fix some warnings
terom
parents: 300
diff changeset
    39
/** How long to block INPUT_FLAG_NOREPEAT for */
440763821484 make Input have its own timer, and add key-repeat handling, and fix some warnings
terom
parents: 300
diff changeset
    40
const TimeMS INPUT_REPEAT_DELAY = 250;
440763821484 make Input have its own timer, and add key-repeat handling, and fix some warnings
terom
parents: 300
diff changeset
    41
283
7540b0859579 start adding some documentation, most core classes (outside of Network) are now doxygen-enabled
terom
parents: 276
diff changeset
    42
/**
7540b0859579 start adding some documentation, most core classes (outside of Network) are now doxygen-enabled
terom
parents: 276
diff changeset
    43
 * The force of gravity on objects, exerted on the Y axis
7540b0859579 start adding some documentation, most core classes (outside of Network) are now doxygen-enabled
terom
parents: 276
diff changeset
    44
 */
214
6af842e348a4 Liero-kuvat lis?tty.
ekku
parents: 211
diff changeset
    45
const float MAP_GRAVITY = 1500.0;
185
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
    46
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
    47
// Player properties
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
    48
const float PLAYER_MASS = 10.0;
219
ec472f8ac482 fixed walkingspeed and improved drawing
nireco
parents: 214
diff changeset
    49
const float PLAYER_MOVE_FORCE = 1100.0;
ec472f8ac482 fixed walkingspeed and improved drawing
nireco
parents: 214
diff changeset
    50
const float PLAYER_MIN_SPEED = 10.0;
185
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
    51
const float PLAYER_JUMP_MIN_DISTANCE = 5.0;
258
833ad8d7db8b The first weapon now has a recoil so that you can fly. There is a bug with facing when you are flying with recoil.
saiam
parents: 255
diff changeset
    52
const float PLAYER_AIM_MIN = -3*KG_PI/8; 
185
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
    53
const float PLAYER_AIM_MAX = KG_PI/2;
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
    54
const float PLAYER_INITIAL_X = 400.0;
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
    55
const float PLAYER_INITIAL_Y = 300.0;
261
91f769d490a6 a better crosshair
terom
parents: 258
diff changeset
    56
const float PLAYER_CROSSHAIR_DISTANCE = 20.0;
91f769d490a6 a better crosshair
terom
parents: 258
diff changeset
    57
const float PLAYER_CROSSHAIR_WIDTH = 4;
293
d40fbf8ba13b Added some text to documentation.
saiam
parents: 288
diff changeset
    58
const float CROSSHAIR_ANGLE_SPEED = PI/2000;
185
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
    59
219
ec472f8ac482 fixed walkingspeed and improved drawing
nireco
parents: 214
diff changeset
    60
const float PLAYER_MAX_SPEED = 43;
ec472f8ac482 fixed walkingspeed and improved drawing
nireco
parents: 214
diff changeset
    61
const float PLAYER_WALK_SPEED = 33;
188
156df474ad00 sonffed Config.hh
nireco
parents: 185
diff changeset
    62
214
6af842e348a4 Liero-kuvat lis?tty.
ekku
parents: 211
diff changeset
    63
const float PLAYER_COLLISION_ELASTICITY = 0.25; // TODO: This could be
188
156df474ad00 sonffed Config.hh
nireco
parents: 185
diff changeset
    64
                                        // different for different
156df474ad00 sonffed Config.hh
nireco
parents: 185
diff changeset
    65
                                        // objects
288
47a5d7896aec some collisions on PhysicsWorld::tick
nireco
parents: 283
diff changeset
    66
const float PLAYER_RADIUS = 10;
185
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
    67
300
417183866f35 suicide key and respawning
terom
parents: 293
diff changeset
    68
/** What size of hole to dig */
417183866f35 suicide key and respawning
terom
parents: 293
diff changeset
    69
const float PLAYER_DIG_RADIUS = 15;
417183866f35 suicide key and respawning
terom
parents: 293
diff changeset
    70
417183866f35 suicide key and respawning
terom
parents: 293
diff changeset
    71
/** Player's initial health */
417183866f35 suicide key and respawning
terom
parents: 293
diff changeset
    72
const Health PLAYER_HEALTH = 100;
417183866f35 suicide key and respawning
terom
parents: 293
diff changeset
    73
417183866f35 suicide key and respawning
terom
parents: 293
diff changeset
    74
/** How long to wait after dying to respawn */
417183866f35 suicide key and respawning
terom
parents: 293
diff changeset
    75
const TimeMS PLAYER_RESPAWN_DELAY = 2500;
417183866f35 suicide key and respawning
terom
parents: 293
diff changeset
    76
276
87434abc1ba1 ability to send NetworkObjectID's via packets, modify Network Projectiles to use this and fix recoil/reloading
terom
parents: 266
diff changeset
    77
/*
87434abc1ba1 ability to send NetworkObjectID's via packets, modify Network Projectiles to use this and fix recoil/reloading
terom
parents: 266
diff changeset
    78
 * Projectiles
87434abc1ba1 ability to send NetworkObjectID's via packets, modify Network Projectiles to use this and fix recoil/reloading
terom
parents: 266
diff changeset
    79
 */
87434abc1ba1 ability to send NetworkObjectID's via packets, modify Network Projectiles to use this and fix recoil/reloading
terom
parents: 266
diff changeset
    80
87434abc1ba1 ability to send NetworkObjectID's via packets, modify Network Projectiles to use this and fix recoil/reloading
terom
parents: 266
diff changeset
    81
// object mass...
87434abc1ba1 ability to send NetworkObjectID's via packets, modify Network Projectiles to use this and fix recoil/reloading
terom
parents: 266
diff changeset
    82
const float PROJECTILE_MASS = 10.0;
87434abc1ba1 ability to send NetworkObjectID's via packets, modify Network Projectiles to use this and fix recoil/reloading
terom
parents: 266
diff changeset
    83
235
0a0c729365ee code cleanup
terom
parents: 233
diff changeset
    84
// how far away from the player the projectile spawns
0a0c729365ee code cleanup
terom
parents: 233
diff changeset
    85
const float PROJECTILE_START_DISTANCE = 10.0;
0a0c729365ee code cleanup
terom
parents: 233
diff changeset
    86
276
87434abc1ba1 ability to send NetworkObjectID's via packets, modify Network Projectiles to use this and fix recoil/reloading
terom
parents: 266
diff changeset
    87
/*
377
01d3c340b372 direction normalization functions in vector, change rope color, misc comments+whitespace
terom
parents: 311
diff changeset
    88
 * @name Rope
01d3c340b372 direction normalization functions in vector, change rope color, misc comments+whitespace
terom
parents: 311
diff changeset
    89
 * @{
276
87434abc1ba1 ability to send NetworkObjectID's via packets, modify Network Projectiles to use this and fix recoil/reloading
terom
parents: 266
diff changeset
    90
 */
87434abc1ba1 ability to send NetworkObjectID's via packets, modify Network Projectiles to use this and fix recoil/reloading
terom
parents: 266
diff changeset
    91
377
01d3c340b372 direction normalization functions in vector, change rope color, misc comments+whitespace
terom
parents: 311
diff changeset
    92
/** How much to grow the rope length by on every ROPE_UP/DOWN */
235
0a0c729365ee code cleanup
terom
parents: 233
diff changeset
    93
const float ROPE_GROWTH_RATE = 5;
276
87434abc1ba1 ability to send NetworkObjectID's via packets, modify Network Projectiles to use this and fix recoil/reloading
terom
parents: 266
diff changeset
    94
377
01d3c340b372 direction normalization functions in vector, change rope color, misc comments+whitespace
terom
parents: 311
diff changeset
    95
/** The force that the rope exerts on the player when the length is too long */
235
0a0c729365ee code cleanup
terom
parents: 233
diff changeset
    96
const float ROPE_FORCE = 3500;
276
87434abc1ba1 ability to send NetworkObjectID's via packets, modify Network Projectiles to use this and fix recoil/reloading
terom
parents: 266
diff changeset
    97
377
01d3c340b372 direction normalization functions in vector, change rope color, misc comments+whitespace
terom
parents: 311
diff changeset
    98
/** Same as player mass...? */
276
87434abc1ba1 ability to send NetworkObjectID's via packets, modify Network Projectiles to use this and fix recoil/reloading
terom
parents: 266
diff changeset
    99
const float ROPE_MASS = 10.0;
87434abc1ba1 ability to send NetworkObjectID's via packets, modify Network Projectiles to use this and fix recoil/reloading
terom
parents: 266
diff changeset
   100
377
01d3c340b372 direction normalization functions in vector, change rope color, misc comments+whitespace
terom
parents: 311
diff changeset
   101
/** Initial rope length... this should probably be a bit more dynamic? */
235
0a0c729365ee code cleanup
terom
parents: 233
diff changeset
   102
const float ROPE_LENGTH = 100.0;
276
87434abc1ba1 ability to send NetworkObjectID's via packets, modify Network Projectiles to use this and fix recoil/reloading
terom
parents: 266
diff changeset
   103
377
01d3c340b372 direction normalization functions in vector, change rope color, misc comments+whitespace
terom
parents: 311
diff changeset
   104
/** Initial velocity of the rope when thrown */
235
0a0c729365ee code cleanup
terom
parents: 233
diff changeset
   105
const float ROPE_VELOCITY = 500;
0a0c729365ee code cleanup
terom
parents: 233
diff changeset
   106
377
01d3c340b372 direction normalization functions in vector, change rope color, misc comments+whitespace
terom
parents: 311
diff changeset
   107
/**
01d3c340b372 direction normalization functions in vector, change rope color, misc comments+whitespace
terom
parents: 311
diff changeset
   108
 * Rope colors, it should alternate between these two
01d3c340b372 direction normalization functions in vector, change rope color, misc comments+whitespace
terom
parents: 311
diff changeset
   109
 */
01d3c340b372 direction normalization functions in vector, change rope color, misc comments+whitespace
terom
parents: 311
diff changeset
   110
const CL_Color ROPE_COLOR_LIGHT = CL_Color(198, 100, 2);
01d3c340b372 direction normalization functions in vector, change rope color, misc comments+whitespace
terom
parents: 311
diff changeset
   111
const CL_Color ROPE_COLOR_DARK = CL_Color(159, 79, 1);
01d3c340b372 direction normalization functions in vector, change rope color, misc comments+whitespace
terom
parents: 311
diff changeset
   112
01d3c340b372 direction normalization functions in vector, change rope color, misc comments+whitespace
terom
parents: 311
diff changeset
   113
// @}
01d3c340b372 direction normalization functions in vector, change rope color, misc comments+whitespace
terom
parents: 311
diff changeset
   114
185
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
   115
// Graphical properties
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
   116
const CL_Color COLOR_EMPTY(86, 41, 0);
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
   117
const CL_Color COLOR_DIRT(144, 82, 23);
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
   118
const CL_Color COLOR_ROCK(132, 136, 135);
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
   119
266
ad72d0a0cc02 increase the map size and control the camera to always have the screen full of terrain
terom
parents: 261
diff changeset
   120
// graphics params
398
306825786fba more tweaking of version.c ... maybe it works now
Tero Marttila <terom@fixme.fi>
parents: 397
diff changeset
   121
const std::string GRAPHICS_WINDOW_TITLE = (std::string() + PROJECT_LONG_NAME + " : Version " + PROJECT_VERSION);
266
ad72d0a0cc02 increase the map size and control the camera to always have the screen full of terrain
terom
parents: 261
diff changeset
   122
const uint32_t GRAPHICS_RESOLUTION_WIDTH = 800;
ad72d0a0cc02 increase the map size and control the camera to always have the screen full of terrain
terom
parents: 261
diff changeset
   123
const uint32_t GRAPHICS_RESOLUTION_HEIGHT = 600;
ad72d0a0cc02 increase the map size and control the camera to always have the screen full of terrain
terom
parents: 261
diff changeset
   124
const uint16_t GRAPHICS_UPDATE_INTERVAL_MS = 20;
389
e74c1820fbd2 implement --help, --fullscreen, --resolution and --list-modes
Tero Marttila <terom@fixme.fi>
parents: 380
diff changeset
   125
const bool GRAPHICS_FULLSCREEN = false;
266
ad72d0a0cc02 increase the map size and control the camera to always have the screen full of terrain
terom
parents: 261
diff changeset
   126
393
5dd4d782cf3a a basic implementation of game messages, plus some weird GameStateEvent stuff
Tero Marttila <terom@fixme.fi>
parents: 389
diff changeset
   127
/**
5dd4d782cf3a a basic implementation of game messages, plus some weird GameStateEvent stuff
Tero Marttila <terom@fixme.fi>
parents: 389
diff changeset
   128
 * Number of pixels between lines
5dd4d782cf3a a basic implementation of game messages, plus some weird GameStateEvent stuff
Tero Marttila <terom@fixme.fi>
parents: 389
diff changeset
   129
 */
5dd4d782cf3a a basic implementation of game messages, plus some weird GameStateEvent stuff
Tero Marttila <terom@fixme.fi>
parents: 389
diff changeset
   130
const PixelDimension GRAPHICS_INFO_TEXT_LINE_OFFSET = 5;
266
ad72d0a0cc02 increase the map size and control the camera to always have the screen full of terrain
terom
parents: 261
diff changeset
   131
ad72d0a0cc02 increase the map size and control the camera to always have the screen full of terrain
terom
parents: 261
diff changeset
   132
// Filesystem paths
220
1c92222af6d3 use Player static vars for texture loading, and load from the PROJECT_DATA_DIR path
terom
parents: 219
diff changeset
   133
const std::string PLAYER_SKIN_PATH = (PROJECT_DATA_DIR "/skin.png");
233
ff4ecea83cf5 start using CL_ResourceManager, change most draw methods to take a Graphics*, implment even better input handling, and draw weapon names
terom
parents: 220
diff changeset
   134
const std::string RESOURCE_XML_PATH = (PROJECT_DATA_DIR "/resources.xml");
220
1c92222af6d3 use Player static vars for texture loading, and load from the PROJECT_DATA_DIR path
terom
parents: 219
diff changeset
   135
185
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
   136
#endif