//--------------------------------------------------------------------------------------------------------------------------------------------------- // // Copyright (C)2007 DarkWynter Studios. All rights reserved. // //--------------------------------------------------------------------------------------------------------------------------------------------------- // {Contact : darkwynter.com for licensing information //--------------------------------------------------------------------------------------------------------------------------------------------------- namespace DarkWynter.Engine.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 DarkWynter.Engine.UserInterface; #endregion /// /// Contains the Global Scoreboard where application-scope variables are posted and read. /// public static class Statics_Engine { #region System Settings /// /// System Settings /// public struct SystemSettings { /// /// Content Manager /// public static ContentManager content; /// /// Window in focus /// public static bool WINDOW_IN_FOCUS = true; // Disables mouse when window loses focus /// /// Set true to commit focus change event /// public static bool WINDOW_RESET = false; /// /// Change in time between frames /// public static float dt; /// /// Total GameTime Elapsed /// public static GameTime elementalGameTime; /// /// Current Engine Execution Mode /// public static Enums_Engine.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 { public static Viewport viewport; /// /// 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; /// /// Set to true when after Load Screen is drawn to trigger Level Loading /// public static bool LoadLevel = false; // Gravity /// /// Vector force of gravity /// public static Vector3 accelDueToGravity = Vector3.Zero; /// /// Single downward component of gravity /// public static float gravityForce = -300f; /// /// Number of bots /// public static int botCount = 4; /// /// Number of humans /// public static int numberOfHumansActive = 4; /// /// Current game type /// public static Enums_Engine.GameType gameType = Enums_Engine.GameType.NONE_SELECTED; /// /// Milliseconds before the player spawns again /// public static int RESPAWN_DELAY = 5000; /// /// Maximum number of kills based on the current game type /// public static int maxNumberOfKills; // Experience points for the player public static int experiencePoints; /// /// Adds th total score for the player /// /// float public static float TotalScore() { int coinMultiplier = 4; float timeDivisor = 180 - Statics_Engine.LevelSettings.gameTimer.Elapsed.Seconds; return ((GameSettings.experiencePoints + (PlayerSettings.coinsCollected * coinMultiplier)) + timeDivisor); } /// /// G2L switch to control problem state /// public static bool isProblemFinished = false; /// /// G2L current Challenge index /// public static int currentChallengeNumber = 0; /// /// G2L position for the bombs /// public static Vector3 BombCurrentPosition; // public static string ParsesandCompilesCode = ""; /// /// 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; /// /// G2L scoring metric /// public static int[,] scoringMetric = { { 0, 0, 0 ,0 }, { 50, 100, 150, 200 }, { 40, 80, 125 ,160 }, { 30, 60, 100 , 120 }, { 20, 40, 75 ,80 }, { 10, 20, 50 ,40 }, { 0, 0, 0 ,0 }}; /// /// Scoring metric tries index /// public static int sMRows = 7; /// /// Scoring metric problem index /// public static int sMColumns = 4; /// /// G2L tracking number of tries for exp purposes /// public static int triesNumber = 0; } #endregion /// /// AI Settings /// public struct AISettings { // 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; /// /// Switches to enable/disable default AI behavior /// public static AISwitches aiSwitches = new AISwitches(); } /// /// Contains the name, description, and filepath for each level. /// public struct LevelInfo { /// /// User friendly name for level. /// public string name; /// /// User friendly description for level. /// public string description; /// /// Filepath of the level xml, which contains all xml data for that level. /// public string filepath; /// /// Holds the _Levels.xml camera enum for the individual levels /// public DarkWynter.Stream.Camera.CameraMode cameraModeEnum_XML; } /// /// Contains the name, description, and filepath for each level. /// public struct EventsInfo { /// /// User friendly name for level. /// public string name; /// /// User friendly description for level. /// public string description; /// /// Filepath of the level xml, which contains all xml data for that level. /// public string filepath; } /// /// List of availible levels contained in _Levels.xml /// public static List levelInfo; /// /// List of availible levelEvent files contained in _Levels.xml /// public static List eventsInfo; /// /// Current level index /// public static int levelIndex = 0; #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; public static int bombCounter = 0; } #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; /// /// Using an instanced mesh or not /// public static bool terrainInstanced = false; } #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 = 5000.0f; /// /// Maximum speed in Hover mode /// public static float MAX_HOVER_SPEED = 1000000.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 = 1000.0f; // 4000.0f /// /// Amount of upward force for a jump /// public static float JUMP_CONSTANT = 10000000.0f; /// /// Amount of upward force for an in-air jump..change before turnin /// public static float IN_AIR_JUMP_CONSTANT = 150000.0f; /// /// 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 = 300; /// /// 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; // 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; /// /// Reset Text for G2L stuff /// public static bool doResetText = false; // G2L name for player public static string studentName = "test"; /// /// Hold the y position for use in resetting spawn point /// public static float spawnPosYStorage = 0; /// /// Used for student messages from the compiler to the hud /// public static string studentMessage = ""; /// /// G2L particpant number for the study /// public static int studentIDNumber = 0; /// /// G2L Number of coins collected /// public static int coinsCollected = 0; /// /// Last Player Spawn Position /// public static Vector3 lastSpawnPoint; /// /// Previous Player Position /// public static Vector3 previousPosition; } public struct HumanSettings { public static Enums_Engine.HUDGPUDebugScreen debugScreen = Enums_Engine.HUDGPUDebugScreen.NONE; } #endregion /// /// Switches to enable/disable default AI behavior /// public class AISwitches { /// /// Enable/Disable AI Vision search /// public bool enableAIVisionSearch; /// /// Enable/Disable Attack mode /// public bool enableAttack; /// /// Enable/Disable default search /// public bool enableDefaultSearch; /// /// Enable/Disable Destroy mode /// public bool enableDestroy; /// /// Enable/Disable Evade mode /// public bool enableEvade; /// /// Enable/Disable moving towards the target /// public bool enableGoTo; /// /// Enable/Disable Jump /// public bool enableJump; /// /// This string is used to store an output /// check for the challenges. /// public string secretCode; /// /// Constructor /// public AISwitches() { enableAIVisionSearch = false; enableAttack = true; enableDefaultSearch = true; enableDestroy = true; enableEvade = true; enableGoTo = true; enableJump = true; } } } }