//--------------------------------------------------------------------------------------------------------------------------------------------------- // // Copyright (C)2007 DarkWynter Studios. All rights reserved. // //--------------------------------------------------------------------------------------------------------------------------------------------------- // {Contact : darkwynter.com for licensing information //--------------------------------------------------------------------------------------------------------------------------------------------------- namespace DarkWynterEngine.Globals { #region Using Statements using System; using System.Collections.Generic; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; using Microsoft.Xna.Framework.Storage; using System.Xml; using System.Diagnostics; using Physics; using ObjectLib; using Draw; #endregion /// /// Contains the Global Scoreboard where application-scope variables are posted and read. /// public static class Statics { #region System Settings /// /// System Settings /// public struct SystemSettings { /// /// Graphics Manager /// public static GraphicsDeviceManager graphics; /// /// Content Manager /// public static ContentManager content; /// /// Window in focus /// public static bool WINDOW_IN_FOCUS = true; // Disables mouse when window loses focus /// /// Change in time between frames /// public static float dt; /// /// Total GameTime Elapsed /// public static GameTime elementalGameTime; /// /// Current Engine Execution Mode /// public static Enums.EngineState gameState; /// /// Screen Saver /// public static Stopwatch screenSaverTimer; /// /// Turn Frames Per Second Counter On /// public static bool enableFPSDisplay; /// /// Turns the Compiler console application on/off /// public static bool enableCompilerConsole; /// /// Time of inactivity after which the anti-burn screen saver activates (millisecs) /// public static int ANTI_BURN_TIMER = 60000; /// /// Count of players currently connected /// public static int TOTAL_PLAYERS = 0; // Pause Menu Options /// /// Shadow Mapping for light source 1 enabled/disabled /// public static bool enableShadowMap1 = true; /// /// Shadow mapping for light source 2 enabled/disabled /// public static bool enableShadowMap2 = true; /// /// Terrain bump mapping enabled/disabled /// public static bool enableTerrainBumpMapping = true; /// /// Terrain multi-texturing enabled/disabled /// public static bool enableTerrainMultiTexturing = true; /// /// Number of textures to use for multi-texturing /// public static int numberOfTerrainTextures = 4; /// /// Single light source only enabled/disabled /// public static bool singleLightSource = false; /// /// Music enabled/disabled /// public static bool music = true; /// /// Sound effects enabled/disabled /// public static bool soundFX = true; } #endregion #region Game Settings /// /// Game Settings /// public struct GameSettings { /// /// Search radius for collision checking (obsolete) /// public static int collisionSearchArea = 2; /// /// Drawing radius (obsolete) /// public static int drawSearchArea = 40; /// /// Maximum number of levels /// public static int MAX_LEVELS = 4; /// /// Number of keys to collect inorder to progress to the next stage in story mode /// public static int STORYMODE_NUM_KEYS_TO_COLLECT = 10; /// /// Health gain for collecting a key /// public static float HEALTH_BOOST_FOR_KEY = 5.0f; /// /// Maximum time to play the sound for a particle (millisec) /// public static float PARTICLE_SOUND_TIME_LIMIT = 10000.0f; /// /// Minimum number of players to run the game /// public static int MIN_NUMBER_OF_PLAYERS = 1; /// /// Maximum number of players supported /// public static int MAX_NUMBER_OF_PLAYERS = 4; /// /// Default number of players /// public static int DEFAULT_NUMBER_OF_PLAYERS = 1; /// /// Number of players per team /// public static int NUMBER_OF_PLAYERS_PER_TEAM = 1; /// /// Set to true when after Load Screen is drawn to trigger Level Loading /// public static bool LoadScreenLoaded = false; // Gravity /// /// Vector force of gravity /// public static Vector3 accelDueToGravity = Vector3.Zero; /// /// Single downward component of gravity /// public static float gravityForce = -300f; /// /// Current game type /// public static Enums.GameType gameType = Enums.GameType.NONE_SELECTED; /// /// Maximum number of kills based on the current game type /// public static int maxNumberOfKills; /// /// AI IQ /// public static int botIntelligence; /// /// Number of bots /// public static int botCount; /// /// Number of humans /// public static int numberOfHumansActive = 4; } #endregion #region Level Settings /// /// Level Settings /// public struct LevelSettings { /// /// Amount of friction force from the terrain /// public static float TERRAIN_FRICTION = 0.0f; /// /// Density of fog (disabled) /// public static float fogDensity = 0; /// /// Color of fog /// public static float[] fogColor = { 1.0f, 1.0f, 1.0f, 0.1f }; /// /// Maximum depth for shadow mapping /// public static float zMaxDepth = 1000.0f; /// /// Number of human players /// public static int numberOfHumans; // Number humans in the game /// /// Maximum number of AI players /// public static int MAX_NUMBER_OF_BOTS = 50; // The most bots there can be /// /// Angle of rotation of light source 1 /// public static double lightMoveAngle1 = 0; /// /// Angle of rotation of light source 2 /// public static double lightMoveAngle2 = 0; /// /// Distance of light source 1 from the center of it's rotation /// public static float lightDistance1 = 0.0f; /// /// Distance of light source 2 from the center of it's rotation /// public static float lightDistance2 = 0.0f; /// /// Speed of motion of light source 1 /// public static float LIGHT_MOVE_SPEED1 = 0.0f; /// /// Speed of motion of light source 2 /// public static float LIGHT_MOVE_SPEED2 = 0; // DARK MATTER /// /// List of masses which are available for use /// public static List darkMatter; /// /// Index of the next available dark matter object /// public static int darkMatterIterator = 0; /// /// Maximum number of dark matter objects /// public static int darkMatterCount = 250000; /// /// Position of light source 1 /// public static Vector3 lightPosition1 = new Vector3(512.0f, 1024.0f, 512.0f); /// /// Ambient component of light source 1 /// public static Vector4 lightAmbient1 = new Vector4(0.9f, 0.9f, 0.9f, 1.0f); /// /// Diffused component of light source 1 /// public static Vector4 lightDiffuse1 = new Vector4(0.8f, 0.8f, 0.8f, 1.0f); /// /// Specular component of light source 1 /// public static Vector4 lightSpecular1 = new Vector4(0.7f, 0.7f, 0.7f, 1.0f); /// /// Position of light source 2 /// public static Vector3 lightPosition2 = new Vector3(1024.0f, 1024.0f, 1024.0f); /// /// Ambient component of light source 2 /// public static Vector4 lightAmbient2 = new Vector4(0.9f, 0.9f, 0.9f, 1.0f); /// /// Diffused component of light source 2 /// public static Vector4 lightDiffuse2 = new Vector4(0.8f, 0.8f, 0.8f, 1.0f); /// /// Specular component of light source 2 /// public static Vector4 lightSpecular2 = new Vector4(0.7f, 0.7f, 0.7f, 1.0f); /// /// In-game elapsed time display /// public static Stopwatch gameTimer = new Stopwatch(); /// /// Fog start distance /// public static float fogStart = 5000.0f; /// /// Fog end distance (ie, no change beyond this) /// public static float fogEnd = 10000.0f; // Scene Graph //public static LookupMap lookupMap; } #endregion #region Render /// /// Render Settings /// public struct RenderSettings { /// /// View matrix /// public static Matrix matrixView; /// /// Projection matrix /// public static Matrix matrixProjection; /// /// Position matrix /// public static Matrix matrixPosition; /// /// Zoom enabled/disabled /// public static bool zoomEnabled = false; /// /// Zoom scaling factor /// public static float zoomFactor = 2.0f; /// /// Hack for drawing the bot's view in a separate viewport /// public static bool HIJACK_VIEWPORT = false; /// /// Window Size. Width, Height /// public static int clientWidth, clientHeight; /// /// Window minimum and maximum depth /// public static float clientMinDepth, clientMaxDepth; /// /// Default view Port /// public static Viewport defaultViewport = new Viewport(); // Default viewport that takes up the whole screen /// /// List of view-ports /// public static List cameraList = new List(); // Window viewports (for multiplayer) /// /// Window Width /// public static int GAME_WINDOW_WIDTH = 800; /// /// Window Height /// public static int GAME_WINDOW_HEIGHT = 600; } #endregion #region Terrain /// /// Terrain Settings /// public struct TerrainSettings { /// /// Width of the unscaled terrain /// public static int vertexMapSize; /// /// Interpolated values for scaled terrain /// public static int collisionMapSize; /// /// Terrain scaling factor /// public static int terrainScaleFactor; /// /// Point on the terrain that the player is looking at /// public static Vector3 terrainLookAtPoint; /// /// Maximum distance at which terrain mod is possible /// public static float terrainModRange; /// /// Terrain Mod enabled/disabled /// public static bool terrainModEnabled; } #endregion #region Particle /// /// Stores all settings for particles /// public struct ParticleSettings { /// /// Earth properties /// public struct Earth { /// /// Mass /// public static float EARTH_MASS = 5.0f; /// /// Coefficient of Restitution of cold earth /// public static float EARTH_COLD_COR = 0.7f; /// /// Coefficient of Restitution of hot earth /// public static float EARTH_HOT_COR = 0.1f; /// /// Friction coeefficient of cold earth /// public static float EARTH_COLD_FRICTION = 0.5f; /// /// Friction coefficient of hot earth /// public static float EARTH_HOT_FRICTION = 0.7f; } /// /// Water properties /// public struct Water { /// /// Mass /// public static float WATER_MASS = 3.0f; // Mass value /// /// Coefficient of Restitution of cold Water /// public static float WATER_COLD_COR = 0.7f; // Coefficient of Restitution /// /// Coefficient of Restitution of hot Water /// public static float WATER_HOT_COR = 0.1f; /// /// Friction coeefficient of cold Water /// public static float WATER_COLD_FRICTION = 0.15f; /// /// Friction coefficient of hot Water /// public static float WATER_HOT_FRICTION = 0.05f; } /// /// Water properties /// public struct Wind { /// /// Mass /// public static float WIND_MASS = 2.0f; // Mass value /// /// Coefficient of Restitution of cold Wind /// public static float WIND_COLD_COR = 0.4f; // Coefficient of Restitution /// /// Coefficient of Restitution of hot Wind /// public static float WIND_HOT_COR = 0.6f; /// /// Friction coeefficient of cold Wind /// public static float WIND_COLD_FRICTION = 0.1f; /// /// Friction coefficient of hot Wind /// public static float WIND_HOT_FRICTION = 0.1f; } } #endregion #region Player Settings /// /// Player Settings /// public struct PlayerSettings { // Attack Variables /// /// Distance from player at which the particle is spawned /// public static float PARTICLE_START_DISTANCE = 20.0f; /// /// Force applied to the particle initially /// public static float DIRECT_ATTACK_FORCE = 100000; /// /// Miliseconds before allowing another automatic shot to be fired eg: 1000 = 1 sec /// public static float RATE_OF_FIRE = 100; /// /// Rate of movement in Hover mode /// public static float HOVER_SPEED = 500.0f; /// /// Maximum speed in Hover mode /// public static float MAX_HOVER_SPEED = 100000.0f; /// /// Rate of movement in Walk mode /// public static float WALK_SPEED = 2.0F; /// /// Maximum achievable velocity by a player /// public static float MAX_VELOCITY = 4000.0f; /// /// Amount of upward force for a jump /// public static float JUMP_CONSTANT = 100000.0f; /// /// Amount of upward force for an in-air jump..change before turnin /// public static float IN_AIR_JUMP_CONSTANT = 100000.0f; /// /// Milliseconds before the player spawns again /// public static int RESPAWN_DELAY = 5000; /// /// Milliseconds before the player is done spawning (invincible before then) /// public static int SPAWN_DONE_DELAY = 5000; /// /// Default maximum distance at which terrain mod is possible /// public static float TERRAIN_MOD_RANGE = 15000.0f; /// /// Default player height above the terrain (based on model properties) /// public static int DEFAULT_PLAYER_HEIGHT = 200; /// /// Maximum distance between player and sensor /// public static int MAX_SENSOR_DISTANCE = 50; /// /// Cost in manna for using an attack /// public static float ATTACK_MANNA_COST = 0.5f; /// /// Cost in manna for shielding an attack /// public static float SHIELD_MANNA_COST = 0.2f; /// /// Cost in manna for jumping /// public static float JUMP_MANNA_COST = 4.0f; /// /// Manna gain for properly shielding an attack /// public static float SHIELD_MANNA_GAIN = 5.0f; /// /// Governs how fast manna regenerates in milliseconds (lower = faster) /// public static int MANNA_INCREMENT_RATE = 1000; /// /// Health gain received from another player /// public static float PLAYER_ABSORB_HEALTH_GAIN = 0.5f; /// /// Manna gain received from a particle /// public static float PARTICLE_ABSORB_MANNA_GAIN = 3.0f; /// /// Cost of using the energy beam /// public static float ENERGY_BEAM_MANNA_COST = 0.05f; //public static float EXPEL_MANNA_COST = 0.2f; /// /// Health loss from a direct hit /// public static float DIRECT_HEALTH_LOSS = 1.0f; /// /// Health loss from an AOE (Area Of Effect) attact /// public static float AREA_HEALTH_LOSS = 0.05f; /// /// Health loss from hitting the ground too hard /// public static float FALLING_HEALTH_LOSS = 1.0f; /// /// Health loss given to other player /// public static float EXPEL_HEALTH_LOSS = 0.5f; /// /// Minimum distance at which the enemy marker is drawn /// public static float ENEMY_MARKER_MIN_DISTANCE = 5; /// /// Maximum distance beyond which the enemy marker is not drawn /// public static float ENEMY_MARKER_MAX_DISTANCE = 70000; // Number between 1 and 10 for smartness (10 being super smart) /// /// AI IQ /// public static int AI_INTELLIGENCE = 8; /// /// AI Maximum health /// public static int AI_MAX_HEALTH = 100; // The Currently Updating Player's Positional Information /// /// Current player's position /// public static Vector3 playerPosition; /// /// Current player's orientation /// public static Quaternion playerRotation; /// /// Current player's look at vector /// public static Vector2 playerLookVector; /// /// Index of the player who paused the game /// public static int playerThatPaused = -1; /// /// Current player's index /// public static int currentPlayerIndex = 0; } #endregion #region GPU Processor /// /// GPU Processor settings /// public struct GPU_ProcessorSettings { /// /// Indexed viewport target size /// public static int INDEXED_TARGET_SIZE = 256; /// /// Spatial viewport target size /// public static int SPATIAL_TARGET_SIZE = 1024; } #endregion } }