From 047e71a4e15001ca028b6f7ce60ae4da4d26b57d Mon Sep 17 00:00:00 2001 From: verysecrethero Date: Thu, 4 Feb 2016 16:18:54 +0100 Subject: [PATCH 01/51] Added BoostAssault,BoostDefender components. Added their effects in HealthSystem,PlayerMovementSystem --- resources/Schema/Components.xsd | 2 + resources/Schema/Components/BoostAssault.xml | 16 ++ resources/Schema/Components/BoostAssault.xsd | 18 ++ resources/Schema/Components/BoostDefender.xml | 16 ++ resources/Schema/Components/BoostDefender.xsd | 18 ++ .../Schema/Entities/BoostAssaultTest.xml | 243 ++++++++++++++++++ src/Game/Systems/HealthSystem.cpp | 3 + src/Game/Systems/PlayerMovementSystem.cpp | 9 +- 8 files changed, 322 insertions(+), 3 deletions(-) create mode 100644 resources/Schema/Components/BoostAssault.xml create mode 100644 resources/Schema/Components/BoostAssault.xsd create mode 100644 resources/Schema/Components/BoostDefender.xml create mode 100644 resources/Schema/Components/BoostDefender.xsd create mode 100644 resources/Schema/Entities/BoostAssaultTest.xml diff --git a/resources/Schema/Components.xsd b/resources/Schema/Components.xsd index ab46b0ea..36060753 100644 --- a/resources/Schema/Components.xsd +++ b/resources/Schema/Components.xsd @@ -29,4 +29,6 @@ + + \ No newline at end of file diff --git a/resources/Schema/Components/BoostAssault.xml b/resources/Schema/Components/BoostAssault.xml new file mode 100644 index 00000000..099d3b0c --- /dev/null +++ b/resources/Schema/Components/BoostAssault.xml @@ -0,0 +1,16 @@ + + + + + + 5 + + + 5 + + + + + + + diff --git a/resources/Schema/Components/BoostAssault.xsd b/resources/Schema/Components/BoostAssault.xsd new file mode 100644 index 00000000..f7d348b7 --- /dev/null +++ b/resources/Schema/Components/BoostAssault.xsd @@ -0,0 +1,18 @@ + + + + + + + + This is the assault's class boost component + + + + + This is the strength of the boost effect + + + + + diff --git a/resources/Schema/Components/BoostDefender.xml b/resources/Schema/Components/BoostDefender.xml new file mode 100644 index 00000000..489d30cd --- /dev/null +++ b/resources/Schema/Components/BoostDefender.xml @@ -0,0 +1,16 @@ + + + + + + 10 + + + 5 + + + + + + + diff --git a/resources/Schema/Components/BoostDefender.xsd b/resources/Schema/Components/BoostDefender.xsd new file mode 100644 index 00000000..167b41dd --- /dev/null +++ b/resources/Schema/Components/BoostDefender.xsd @@ -0,0 +1,18 @@ + + + + + + + + This is the defender's class boost component + + + + + This is the strength of the boost effect + + + + + diff --git a/resources/Schema/Entities/BoostAssaultTest.xml b/resources/Schema/Entities/BoostAssaultTest.xml new file mode 100644 index 00000000..97fd3f4d --- /dev/null +++ b/resources/Schema/Entities/BoostAssaultTest.xml @@ -0,0 +1,243 @@ + + + + + + + + + + + + Models\MapVersion1.mesh + + + + + + + + + 2 + + + Models/DirectionalLightWidget.mesh + false + + + + + + + + + + + + + 8 + 2.7999999523162842 + + + + + + + + + + + 8 + 2.7999999523162842 + + + + + + + + + + + + + Models/Core/UnitCube.mesh + + + + + + + + + + + + + Models/Core/UnitCube.mesh + + + + + + + + + + + + + Models/Core/UnitCube.mesh + + + + + + + + + + + + + + Models/Core/UnitCube.mesh + + + + + + + + + + + + + Models/Core/UnitCube.mesh + + + + + + + + + + + + + Models/Core/UnitCube.mesh + false + + + Schema/Entities/Player.xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Models/Core/UnitCube.mesh + false + + + Schema/Entities/Player.xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Game/Systems/HealthSystem.cpp b/src/Game/Systems/HealthSystem.cpp index 9e118070..3f64d7b9 100644 --- a/src/Game/Systems/HealthSystem.cpp +++ b/src/Game/Systems/HealthSystem.cpp @@ -49,6 +49,9 @@ bool HealthSystem::OnPlayerDamaged(Events::PlayerDamage& e) { ComponentWrapper cHealth = e.Player["Health"]; double& health = cHealth["Health"]; + if (e.Player.HasComponent("BoostDefender")) { + e.Damage -= (double)e.Player["BoostDefender"]["StrengthOfEffect"]; + } health -= e.Damage; if (health <= 0.0) { diff --git a/src/Game/Systems/PlayerMovementSystem.cpp b/src/Game/Systems/PlayerMovementSystem.cpp index 72900d7a..bb50942d 100644 --- a/src/Game/Systems/PlayerMovementSystem.cpp +++ b/src/Game/Systems/PlayerMovementSystem.cpp @@ -1,6 +1,6 @@ #include "Systems/PlayerMovementSystem.h" -PlayerMovementSystem::PlayerMovementSystem(World* world, EventBroker* eventBroker) +PlayerMovementSystem::PlayerMovementSystem(World* world, EventBroker* eventBroker) : System(world, eventBroker) , PureSystem("Player") { @@ -72,6 +72,10 @@ void PlayerMovementSystem::Update(double dt) ImGui::InputFloat("surfaceFriction", &surfaceFriction); float accelerationSpeed = actualAccel * (float)dt * wishSpeed * surfaceFriction; accelerationSpeed = glm::min(accelerationSpeed, addSpeed); + //if player has Boost from an Assault class, accelerate the player faster + if (player.HasComponent("BoostAssault")) { + accelerationSpeed *= (double) player["BoostAssault"]["StrengthOfEffect"]; + } velocity += accelerationSpeed * wishDirection; ImGui::Text("velocity: (%f, %f, %f) |%f|", velocity.x, velocity.y, velocity.z, glm::length(velocity)); } @@ -79,8 +83,7 @@ void PlayerMovementSystem::Update(double dt) if (controller->Jumping() && !controller->Crouching() && (velocity.y == 0.f || !controller->DoubleJumping())) { if (velocity.y == 0.f) { controller->SetDoubleJumping(false); - } - else { + } else { controller->SetDoubleJumping(true); } velocity.y += 4.f; From 1c9a1a99044b3825bdbcd3aeb73028873bb6ef25 Mon Sep 17 00:00:00 2001 From: verysecrethero Date: Wed, 17 Feb 2016 16:04:44 +0100 Subject: [PATCH 02/51] playerMovementSpeed,playerCrouchSpeed in the player component now also gets AssaultBoosted. --- resources/Schema/Entities/NewMap.xml | 20 ++++++++++---------- src/Game/Systems/HealthSystem.cpp | 4 ++-- src/Game/Systems/PlayerMovementSystem.cpp | 8 +++++++- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/resources/Schema/Entities/NewMap.xml b/resources/Schema/Entities/NewMap.xml index 00dc476f..8fb8d9f4 100644 --- a/resources/Schema/Entities/NewMap.xml +++ b/resources/Schema/Entities/NewMap.xml @@ -5019,7 +5019,7 @@ - + @@ -5089,7 +5089,7 @@ - + @@ -5165,7 +5165,7 @@ - + @@ -5184,7 +5184,7 @@ - + @@ -5203,7 +5203,7 @@ - + @@ -5222,7 +5222,7 @@ - + @@ -5241,7 +5241,7 @@ - + @@ -5260,7 +5260,7 @@ - + @@ -5279,7 +5279,7 @@ - + @@ -5298,7 +5298,7 @@ - + diff --git a/src/Game/Systems/HealthSystem.cpp b/src/Game/Systems/HealthSystem.cpp index 201e4760..b4ea210c 100644 --- a/src/Game/Systems/HealthSystem.cpp +++ b/src/Game/Systems/HealthSystem.cpp @@ -30,8 +30,8 @@ bool HealthSystem::OnPlayerDamaged(Events::PlayerDamage& e) ComponentWrapper cHealth = e.Victim["Health"]; double& health = cHealth["Health"]; - if (e.Player.HasComponent("BoostDefender")) { - e.Damage -= (double)e.Player["BoostDefender"]["StrengthOfEffect"]; + if (e.Victim.HasComponent("BoostDefender")) { + e.Damage -= (double)e.Victim["BoostDefender"]["StrengthOfEffect"]; } health -= e.Damage; diff --git a/src/Game/Systems/PlayerMovementSystem.cpp b/src/Game/Systems/PlayerMovementSystem.cpp index 64216e58..e754252d 100644 --- a/src/Game/Systems/PlayerMovementSystem.cpp +++ b/src/Game/Systems/PlayerMovementSystem.cpp @@ -53,6 +53,11 @@ void PlayerMovementSystem::updateMovementControllers(double dt) float playerMovementSpeed = player["Player"]["MovementSpeed"]; float playerCrouchSpeed = player["Player"]["CrouchSpeed"]; glm::vec3& wishDirection = player["Player"]["CurrentWishDirection"]; + if (player.HasComponent("BoostAssault")) { + playerMovementSpeed *= (double)player["BoostAssault"]["StrengthOfEffect"]; + playerCrouchSpeed *= (double)player["BoostAssault"]["StrengthOfEffect"]; + } + if (player.HasComponent("Physics")) { ComponentWrapper cPhysics = player["Physics"]; @@ -104,9 +109,10 @@ void PlayerMovementSystem::updateMovementControllers(double dt) //if doubleTapped do Assault Dash - but only boost maximum 50.0f float doubleTapDashBoost = controller->AssaultDashDoubleTapped() ? 40.0f : 1.0f; accelerationSpeed = glm::min(doubleTapDashBoost*glm::min(accelerationSpeed, addSpeed), 50.0f); + accelerationSpeed = doubleTapDashBoost*glm::min(accelerationSpeed, addSpeed); //if player has Boost from an Assault class, accelerate the player faster if (player.HasComponent("BoostAssault")) { - accelerationSpeed *= (double) player["BoostAssault"]["StrengthOfEffect"]; + accelerationSpeed *= (double)player["BoostAssault"]["StrengthOfEffect"]; } velocity += accelerationSpeed * wishDirection; ImGui::Text("velocity: (%f, %f, %f) |%f|", velocity.x, velocity.y, velocity.z, glm::length(velocity)); From 56bc1fee3ddf5767bc5af135652fe519894f9df0 Mon Sep 17 00:00:00 2001 From: verysecrethero Date: Wed, 17 Feb 2016 16:43:38 +0100 Subject: [PATCH 03/51] Added LifeTimeOfEffect in BoostAssault,BoostDefender components. --- resources/Schema/Components/BoostAssault.xml | 15 ++------------- resources/Schema/Components/BoostAssault.xsd | 3 +++ resources/Schema/Components/BoostDefender.xml | 15 ++------------- resources/Schema/Components/BoostDefender.xsd | 3 +++ src/Game/Systems/PlayerMovementSystem.cpp | 1 - 5 files changed, 10 insertions(+), 27 deletions(-) diff --git a/resources/Schema/Components/BoostAssault.xml b/resources/Schema/Components/BoostAssault.xml index 099d3b0c..20ec953c 100644 --- a/resources/Schema/Components/BoostAssault.xml +++ b/resources/Schema/Components/BoostAssault.xml @@ -1,16 +1,5 @@ - - - - 5 - - - 5 - - - - - - + 2 + 5 diff --git a/resources/Schema/Components/BoostAssault.xsd b/resources/Schema/Components/BoostAssault.xsd index f7d348b7..b965b1fa 100644 --- a/resources/Schema/Components/BoostAssault.xsd +++ b/resources/Schema/Components/BoostAssault.xsd @@ -12,6 +12,9 @@ This is the strength of the boost effect + + How long the effect lasts + diff --git a/resources/Schema/Components/BoostDefender.xml b/resources/Schema/Components/BoostDefender.xml index 489d30cd..c1810544 100644 --- a/resources/Schema/Components/BoostDefender.xml +++ b/resources/Schema/Components/BoostDefender.xml @@ -1,16 +1,5 @@ - - - - 10 - - - 5 - - - - - - + 10 + 5 diff --git a/resources/Schema/Components/BoostDefender.xsd b/resources/Schema/Components/BoostDefender.xsd index 167b41dd..ed59f89c 100644 --- a/resources/Schema/Components/BoostDefender.xsd +++ b/resources/Schema/Components/BoostDefender.xsd @@ -12,6 +12,9 @@ This is the strength of the boost effect + + How long the effect lasts + diff --git a/src/Game/Systems/PlayerMovementSystem.cpp b/src/Game/Systems/PlayerMovementSystem.cpp index e754252d..a0289f3d 100644 --- a/src/Game/Systems/PlayerMovementSystem.cpp +++ b/src/Game/Systems/PlayerMovementSystem.cpp @@ -109,7 +109,6 @@ void PlayerMovementSystem::updateMovementControllers(double dt) //if doubleTapped do Assault Dash - but only boost maximum 50.0f float doubleTapDashBoost = controller->AssaultDashDoubleTapped() ? 40.0f : 1.0f; accelerationSpeed = glm::min(doubleTapDashBoost*glm::min(accelerationSpeed, addSpeed), 50.0f); - accelerationSpeed = doubleTapDashBoost*glm::min(accelerationSpeed, addSpeed); //if player has Boost from an Assault class, accelerate the player faster if (player.HasComponent("BoostAssault")) { accelerationSpeed *= (double)player["BoostAssault"]["StrengthOfEffect"]; From c3ed429377210709d4ab2664dc26ce6ff7343e5d Mon Sep 17 00:00:00 2001 From: verysecrethero Date: Wed, 17 Feb 2016 18:11:36 +0100 Subject: [PATCH 04/51] Added BoostSystem, Added BoostAssault entity XML --- include/Game/Systems/BoostSystem.h | 25 + resources/Schema/Entities/BoostAssault.xml | 14 + .../Schema/Entities/BoostAssaultTest.xml | 5370 ++++++++++++++++- src/Game/Game.cpp | 2 + src/Game/Systems/BoostSystem.cpp | 60 + .../Systems/Weapon/AssaultWeaponBehaviour.cpp | 10 +- 6 files changed, 5326 insertions(+), 155 deletions(-) create mode 100644 include/Game/Systems/BoostSystem.h create mode 100644 resources/Schema/Entities/BoostAssault.xml create mode 100644 src/Game/Systems/BoostSystem.cpp diff --git a/include/Game/Systems/BoostSystem.h b/include/Game/Systems/BoostSystem.h new file mode 100644 index 00000000..8d87f065 --- /dev/null +++ b/include/Game/Systems/BoostSystem.h @@ -0,0 +1,25 @@ +#ifndef BoostSystem_h__ +#define BoostSystem_h__ + +#include "Core/System.h" +#include "Core/Transform.h" +#include "Core/ResourceManager.h" +#include "Core/EntityFileParser.h" +#include "Core/EPlayerDamage.h" +#include "Common.h" +#include + +#include "Rendering/Util/CommonFunctions.h" + +class BoostSystem : public System +{ +public: + BoostSystem(SystemParams params); + +private: + EventRelay m_EPlayerDamage; + bool OnPlayerDamage(Events::PlayerDamage& e); + + std::string determineClass(EntityWrapper player); +}; +#endif \ No newline at end of file diff --git a/resources/Schema/Entities/BoostAssault.xml b/resources/Schema/Entities/BoostAssault.xml new file mode 100644 index 00000000..727e5363 --- /dev/null +++ b/resources/Schema/Entities/BoostAssault.xml @@ -0,0 +1,14 @@ + + + + + + + 55 + + + + + + + diff --git a/resources/Schema/Entities/BoostAssaultTest.xml b/resources/Schema/Entities/BoostAssaultTest.xml index 97fd3f4d..89dcd0d7 100644 --- a/resources/Schema/Entities/BoostAssaultTest.xml +++ b/resources/Schema/Entities/BoostAssaultTest.xml @@ -6,130 +6,5080 @@ - + - - Models\MapVersion1.mesh - - + + + + + + Models/Props/Ground.mesh + + + + + + + + + Models/Props/Highground1.mesh + + + + + + + + + + Models/Props/Highground2.mesh + + + + + + + + + + Models/Props/Highground1.mesh + + + + + + + + + + + + Models/Props/Highground2.mesh + + + + + + + + + + + + Models/Props/Highground3.mesh + + + + + + + + + + Models/Props/Highground4.mesh + + + + + + + + + + Models/Props/Highground5.mesh + + + + + + + + + + + Models/Props/Highground6.mesh + + + + + + + + + + Models/Props/Walls/SciFiWallTop.mesh + + + + + + + + + Models/Props/Walls/SciFiWallBig.mesh + + + + + + + + + + Models/Props/Walls/SciFiWallMedium.mesh + + + + + + + + + + Models/Props/Walls/SciFiWallSmall1.mesh + + + + + + + + + + Models/Props/Walls/SciFiWallSmall2.mesh + + + + + + + + + + Models/Props/Walls/SciFiWallBig.mesh + + + + + + + + + + + + Models/Props/Walls/SciFiWallMedium.mesh + + + + + + + + + + + + Models/Props/Walls/SciFiWallSmall3.mesh + + + + + + + + + + Models/Props/Walls/SciFiWallSmall4.mesh + + + + + + + + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar1Blue.mesh + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar1Red.mesh + + + + + + + + + + + + + Models/Props/Pillars/StonePillar.mesh + + + + + + + + + + + + Models/Props/Pillars/StonePillar.mesh + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar2Red.mesh + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar3Blue.mesh + + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar1Blue.mesh + + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar1Red.mesh + + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar3Red.mesh + + + + + + + + + + + + + + Models/Props/Pillars/StonePillar.mesh + + + + + + + + + + + + Models/Props/Pillars/StonePillar.mesh + + + + + + + + + + + + + Models/Props/Pillars/StonePillar.mesh + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar2Blue.mesh + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar2Red.mesh + + + + + + + + + + + + + Models/Props/Pillars/StonePillar.mesh + + + + + + + + + + + Models/Props/Pillars/StonePillar.mesh + + + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar2Blue.mesh + + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar2Blue.mesh + + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar2Blue.mesh + + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar2Blue.mesh + + + + + + + + + + + + + Models/Props/Pillars/StonePillar.mesh + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar2Red.mesh + + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar2Red.mesh + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar2Red.mesh + + + + + + + + + + + + + + Models/Props/Pillars/StonePillar.mesh + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar2Red.mesh + + + + + + + + + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + + + + Models/Props/Walls/MediumWall3.mesh + + + + + + + + + + + + Models/Props/Walls/MediumWall3.mesh + + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + + Models/Props/Walls/SmallWall2.mesh + + + + + + + + + + + + + Models/Props/Walls/SmallWall4.mesh + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + Models/Props/Walls/SmallWall2.mesh + + + + + + + + + + + + + Models/Props/Walls/SmallWall2.mesh + + + + + + + + + + + + + Models/Props/Walls/SmallWall2.mesh + + + + + + + + + + + + + Models/Props/Walls/MediumWall2.mesh + + + + + + + + + + + + Models/Props/Walls/MediumWall2.mesh + + + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + Models/Props/Walls/SmallWall4.mesh + + + + + + + + + + + + + + Models/Props/Walls/SmallWall4.mesh + + + + + + + + + + + + Models/Props/Walls/SmallWall2.mesh + + + + + + + + + + + + + + Models/Props/Walls/SmallWall2.mesh + + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + + + + Models/Props/Walls/SmallWall2.mesh + + + + + + + + + + + + + + Models/Props/Walls/SmallWall2.mesh + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + + + + Models/Props/Walls/MediumWall3.mesh + + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + Models/Props/Walls/SmallWall2.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + Models/Props/Walls/SpecialWall1.mesh + + + + + + + + + + + + + + Models/Props/Flora/SpecialRoot.mesh + + + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + Models/Props/Walls/MediumWall3.mesh + + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + + + Models/Props/Walls/SmallWall2.mesh + + + + + + + + + + + + + Models/Props/Walls/SmallWall2.mesh + + + + + + + + + + + + Models/Props/Walls/SmallWall2.mesh + + + + + + + + + + + + Models/Props/Walls/MediumWall3.mesh + + + + + + + + + + + + Models/Props/Walls/MediumWall2.mesh + + + + + + + + + + + Models/Props/Walls/MediumWall2.mesh + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + Models/Props/Walls/SmallWall4.mesh + + + + + + + + + + + + + + + + Models/Props/Walls/MediumWall3.mesh + + + + + + + + + + + + + Models/Props/Walls/MediumWall2.mesh + + + + + + + + + + + + + Models/Props/Walls/SpecialWall1.mesh + + + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + + Models/Props/Walls/SpecialWall1.mesh + + + + + + + + + + + + Models/Props/Walls/SpecialWall1.mesh + + + + + + + + + + + + + Models/Props/Walls/SpecialWall1.mesh + + + + + + + + + + + + + Models/Props/Walls/SpecialWall1.mesh + + + + + + + + + + + + + Models/Props/Walls/SpecialWall1.mesh + + + + + + + + + + + + + + Models/Props/Walls/SpecialWall1.mesh + + + + + + + + + + + + + + + + + + + + + Models/Props/Bridges/WoodenBridge.mesh + + + + + + + + + + + + + + Models/Props/Bridges/WoodenBridge.mesh + + + + + + + + + + + + + + Models/Props/Bridges/WoodenBridge.mesh + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridge1Red.mesh + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridge1Blue.mesh + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + + + + + + + + + + Models/Props/Pillars/SciFiBridgePillar1.mesh + + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridge1Blue.mesh + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridge1Blue.mesh + + + + + + + + + + + + + Models/Props/Pillars/SciFiBridgePillar1.mesh + + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridge1Red.mesh + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridge1Red.mesh + + + + + + + + + + + + + Models/Props/Bridges/WoodenBridge.mesh + + + + + + + + + + + + + + + + + + + + + Models/Props/Pillars/SciFiBridgePillar1.mesh + + + + + + + + + + + + + + Models/Props/Pillars/SciFiBridgePillar1.mesh + + + + + + + + + + + + + + Models/Props/Walls/MediumWall2.mesh + + + + + + + + + + + Models/Props/Walls/MediumWall2.mesh + + + + + + + + + + + + + + + Models/Props/Walls/MediumWall3.mesh + + + + + + + + + + + Models/Props/Walls/MediumWall3.mesh + + + + + + + + + + + + + + Models/Props/Pillars/SciFiBridgePillar1.mesh + + + + + + + + + + + + Models/Core/UnitCube.mesh + + + + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + + + Models/Core/UnitCube.mesh + + + + + + + + + + + + + Models/Core/UnitCube.mesh + + + + + + + + + + + + + + Models/Core/UnitPlane.mesh + + true + + + + + + + + + + + + + Models/Core/UnitPlane.mesh + + true + + + + + + + + + + + + + + Models/Core/UnitCube.mesh + + + + + + + + + + + + + Models/Core/UnitCube.mesh + + + + + + + + + + + + + + + + Models/Props/Pillars/SciFiBridgePillar1.mesh + + + + + + + + + + + + + + Models/Props/Pillars/SciFiBridgePillar1.mesh + + + + + + + + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + + + Models/Props/Flora/TreeLog.mesh + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + + Models/Props/Flora/SpecialRoot.mesh + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + + Models/Props/Flora/SpecialRoot.mesh + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + + Models/Props/Flora/SpecialRoot.mesh + + + + + + + + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + + + + + + + + Models/Props/SciFiHolder1.mesh + + + + + + + + + + + + + Models/Props/SciFiHolder1.mesh + + + + + + + + + + + + + Models/Props/SciFiHolder1.mesh + + + + + + + + + + + + + Models/Props/SciFiHolder1.mesh + + + + + + + + + + + + + Models/Props/SciFiHolder1.mesh + + + + + + + + + + + + + Models/Props/SciFiHolder1.mesh + + + + + + + + + + + + + Models/Props/SciFiHolder1.mesh + + + + + + + + + + + + + Models/Props/SciFiHolder1.mesh + + + + + + + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + - + - - 2 - - - Models/DirectionalLightWidget.mesh - false - - - - - - + - + + + + + + Models/Props/CapturePoint/CapturePointBlue.mesh + + + + + + + + + + + + + 4 + + + Models/Core/UnitCylinder.mesh + + true + + + + + + + + + + + + + + + + + + + + + Models/Props/CapturePoint/CapturePointNeutral.mesh + + + + + + + + + + 3 + + + Models/Core/UnitCylinder.mesh + + true + + + + + + + + + + + + + + + + + Models/Props/CapturePoint/CapturePointNeutral.mesh + + + + + + + + + + 2 + + + Models/Core/UnitCylinder.mesh + + true + + + + + + + + + + + + + + + + + Models/Props/CapturePoint/CapturePointNeutral.mesh + + + + + + + + + + 1.5498908015879351 + 1 + + + Models/Core/UnitCylinder.mesh + + true + + + + + + + + + + + + + + + + + Models/Props/CapturePoint/CapturePointRed.mesh + + + + + + + + + + + + + + + Models/Core/UnitCylinder.mesh + + true + + + + + + + + + + + + + + + + + - + - - 8 - 2.7999999523162842 - - - - + - + + + + + 1 + + + + + + + + + 10 + + + + + + + + + + 10 + + + + + + + + + + + + + 10 + + + + + + + + + + + 10 + + + + + + + + + + + 10 + + + + + + + + + + + 1 + + + + + + + + - - - - 8 - 2.7999999523162842 - - - - - - - - - - - - - Models/Core/UnitCube.mesh - - - - - - - - - - - - - Models/Core/UnitCube.mesh - - - - - - - - - - - - - Models/Core/UnitCube.mesh - - - - - - - - - - - - - - Models/Core/UnitCube.mesh - - - - - - - - - - - - - Models/Core/UnitCube.mesh - - - - - - - - - + + + + + Schema/Entities/PlayerRed.xml + + + + + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + + - - Models/Core/UnitCube.mesh - false - Schema/Entities/Player.xml @@ -139,100 +5089,218 @@ - + - + - + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + - + + + Models/Characters/Assault/AssaultTPose.mesh + false + - + - + + + + Models/Characters/Assault/AssaultTPose.mesh + false + - + - + + + + Models/Characters/Assault/AssaultTPose.mesh + false + - - - - - - - - - + - + - - - Models/Core/UnitCube.mesh - false - - - Schema/Entities/Player.xml - - - - - - - - - + - - + + + Models/Props/PickUps/HealthPickUp.mesh + + + 0.10000000149011612 + + + + + + + + + + + Models/Props/PickUps/AmmoPickUp.mesh + + + 0.10000000149011612 + + - + + + + + + + Models/Props/PickUps/HealthPickUp.mesh + + + 0.10000000149011612 + + - + + + + + + + Models/Props/PickUps/HealthPickUp.mesh + + + 0.10000000149011612 + + - + + + + + + + + + + + + Models/Props/PickUps/AmmoPickUp.mesh + + + 0.10000000149011612 + + + + + + + + + + + + + + + + Models/Props/PickUps/HealthPickUp.mesh + + + 0.10000000149011612 + + + + + + + + + + + + + + + + Models/Props/PickUps/AmmoPickUp.mesh + + + 0.10000000149011612 + + + + + + + + + + + + + + + + Models/Props/PickUps/AmmoPickUp.mesh + + + 0.10000000149011612 + + + + + + + + diff --git a/src/Game/Game.cpp b/src/Game/Game.cpp index 49b1a963..2cc5d715 100644 --- a/src/Game/Game.cpp +++ b/src/Game/Game.cpp @@ -26,6 +26,7 @@ #include "Network/MultiplayerSnapshotFilter.h" #include "Game/Systems/AmmunitionHUDSystem.h" #include "Game/Systems/KillFeedSystem.h" +#include "Game/Systems/BoostSystem.h" Game::Game(int argc, char* argv[]) @@ -132,6 +133,7 @@ Game::Game(int argc, char* argv[]) m_SystemPipeline->AddSystem(updateOrderLevel); m_SystemPipeline->AddSystem(updateOrderLevel); m_SystemPipeline->AddSystem(updateOrderLevel); + m_SystemPipeline->AddSystem(updateOrderLevel); // Populate Octree with collidables ++updateOrderLevel; m_SystemPipeline->AddSystem(updateOrderLevel, m_OctreeCollision, "Collidable"); diff --git a/src/Game/Systems/BoostSystem.cpp b/src/Game/Systems/BoostSystem.cpp new file mode 100644 index 00000000..bdd36d6a --- /dev/null +++ b/src/Game/Systems/BoostSystem.cpp @@ -0,0 +1,60 @@ +#include "Systems/BoostSystem.h" + +BoostSystem::BoostSystem(SystemParams params) + : System(params) +{ + EVENT_SUBSCRIBE_MEMBER(m_EPlayerDamage, &BoostSystem::OnPlayerDamage); +} + +bool BoostSystem::OnPlayerDamage(Events::PlayerDamage& e) +{ + if (e.Victim.ID == e.Inflictor.ID) { + return false; + } + if (!e.Victim.Valid() && e.Victim != LocalPlayer && !e.Victim.IsChildOf(LocalPlayer)) { + return false; + } + + if (!e.Inflictor.Valid() || !e.Victim.Valid()) { + return false; + } + + auto teamInflictor = m_World->GetComponent(e.Inflictor.ID, "Team"); + auto teamVictim = m_World->GetComponent(e.Victim.ID, "Team"); + if ((int)teamInflictor["Team"] != (int)teamVictim["Team"]) { + return false; + } + + //friendly fire + + auto className = determineClass(e.Inflictor); + if (className == "") { + return false; + } + //"Schema/Entities/BoostAssault.xml" + std::string classXML = "Schema/Entities/" + className + ".xml"; + + //class + + //load & set the BoostAssault Component + auto entityFile = ResourceManager::Load(classXML); + EntityFileParser parser(entityFile); + EntityID boostAssaultEntity = parser.MergeEntities(m_World); + m_World->SetParent(boostAssaultEntity, e.Victim.ID); + + return true; +} + +std::string BoostSystem::determineClass(EntityWrapper player) +{ + if (m_World->HasComponent(player.ID, "DashAbility")) { + return "BoostAssault"; + } + if (m_World->HasComponent(player.ID, "DefenderShield")) { + return "BoostDefender"; + } + if (m_World->HasComponent(player.ID, "SniperSprint")) { + return "BoostSniper"; + } + return ""; +} diff --git a/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp b/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp index 84d3ccd4..4a56ec8c 100644 --- a/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp +++ b/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp @@ -384,10 +384,12 @@ bool AssaultWeaponBehaviour::shoot(double damage) return false; } - // Check for friendly fire - if ((ComponentInfo::EnumType)victim["Team"]["Team"] == (ComponentInfo::EnumType)m_Player["Team"]["Team"]) { - return false; - } + + // Do Not Check for friendly fire + //// Check for friendly fire + //if ((ComponentInfo::EnumType)victim["Team"]["Team"] == (ComponentInfo::EnumType)m_Player["Team"]["Team"]) { + // return false; + //} // Deal damage! Events::PlayerDamage ePlayerDamage; From 7f489b3569996ff5c6c369bce6ffb387dd900107 Mon Sep 17 00:00:00 2001 From: verysecrethero Date: Thu, 18 Feb 2016 10:40:09 +0100 Subject: [PATCH 05/51] Added Assault,Defender,Sniper Components,Entities. Added ShieldAbility,Sprintability-Component (not implemented). Changed BoostSystem to use a childed Boost to the player. All friendly fire is 0 damage. --- include/Game/Systems/BoostSystem.h | 2 +- resources/Schema/Components.xsd | 3 +++ resources/Schema/Components/BoostAssault.xml | 1 - resources/Schema/Components/BoostAssault.xsd | 3 --- resources/Schema/Components/BoostDefender.xml | 1 - resources/Schema/Components/BoostDefender.xsd | 3 --- resources/Schema/Components/BoostSniper.xml | 4 ++++ resources/Schema/Components/BoostSniper.xsd | 18 +++++++++++++++ resources/Schema/Components/ShieldAbility.xml | 4 ++++ resources/Schema/Components/ShieldAbility.xsd | 18 +++++++++++++++ resources/Schema/Components/SprintAbility.xml | 4 ++++ resources/Schema/Components/SprintAbility.xsd | 18 +++++++++++++++ resources/Schema/Entities/BoostAssault.xml | 2 +- resources/Schema/Entities/BoostDefender.xml | 14 +++++++++++ resources/Schema/Entities/BoostSniper.xml | 14 +++++++++++ src/Game/Systems/BoostSystem.cpp | 23 +++++++++++-------- src/Game/Systems/HealthSystem.cpp | 5 ++-- src/Game/Systems/PlayerMovementSystem.cpp | 11 +++++---- .../Systems/Weapon/AssaultWeaponBehaviour.cpp | 9 ++++---- 19 files changed, 125 insertions(+), 32 deletions(-) create mode 100644 resources/Schema/Components/BoostSniper.xml create mode 100644 resources/Schema/Components/BoostSniper.xsd create mode 100644 resources/Schema/Components/ShieldAbility.xml create mode 100644 resources/Schema/Components/ShieldAbility.xsd create mode 100644 resources/Schema/Components/SprintAbility.xml create mode 100644 resources/Schema/Components/SprintAbility.xsd create mode 100644 resources/Schema/Entities/BoostDefender.xml create mode 100644 resources/Schema/Entities/BoostSniper.xml diff --git a/include/Game/Systems/BoostSystem.h b/include/Game/Systems/BoostSystem.h index 8d87f065..5e9c47da 100644 --- a/include/Game/Systems/BoostSystem.h +++ b/include/Game/Systems/BoostSystem.h @@ -20,6 +20,6 @@ private: EventRelay m_EPlayerDamage; bool OnPlayerDamage(Events::PlayerDamage& e); - std::string determineClass(EntityWrapper player); + std::string DetermineClass(EntityWrapper player); }; #endif \ No newline at end of file diff --git a/resources/Schema/Components.xsd b/resources/Schema/Components.xsd index f5c65719..c9d8a70e 100644 --- a/resources/Schema/Components.xsd +++ b/resources/Schema/Components.xsd @@ -35,9 +35,12 @@ + + + diff --git a/resources/Schema/Components/BoostAssault.xml b/resources/Schema/Components/BoostAssault.xml index 20ec953c..c76fe21e 100644 --- a/resources/Schema/Components/BoostAssault.xml +++ b/resources/Schema/Components/BoostAssault.xml @@ -1,5 +1,4 @@ 2 - 5 diff --git a/resources/Schema/Components/BoostAssault.xsd b/resources/Schema/Components/BoostAssault.xsd index b965b1fa..f7d348b7 100644 --- a/resources/Schema/Components/BoostAssault.xsd +++ b/resources/Schema/Components/BoostAssault.xsd @@ -12,9 +12,6 @@ This is the strength of the boost effect - - How long the effect lasts - diff --git a/resources/Schema/Components/BoostDefender.xml b/resources/Schema/Components/BoostDefender.xml index c1810544..fad0d2b7 100644 --- a/resources/Schema/Components/BoostDefender.xml +++ b/resources/Schema/Components/BoostDefender.xml @@ -1,5 +1,4 @@ 10 - 5 diff --git a/resources/Schema/Components/BoostDefender.xsd b/resources/Schema/Components/BoostDefender.xsd index ed59f89c..167b41dd 100644 --- a/resources/Schema/Components/BoostDefender.xsd +++ b/resources/Schema/Components/BoostDefender.xsd @@ -12,9 +12,6 @@ This is the strength of the boost effect - - How long the effect lasts - diff --git a/resources/Schema/Components/BoostSniper.xml b/resources/Schema/Components/BoostSniper.xml new file mode 100644 index 00000000..844b7c59 --- /dev/null +++ b/resources/Schema/Components/BoostSniper.xml @@ -0,0 +1,4 @@ + + + 10 + diff --git a/resources/Schema/Components/BoostSniper.xsd b/resources/Schema/Components/BoostSniper.xsd new file mode 100644 index 00000000..89778482 --- /dev/null +++ b/resources/Schema/Components/BoostSniper.xsd @@ -0,0 +1,18 @@ + + + + + + + + This is the defender's class boost component + + + + + This is the strength of the boost effect + + + + + diff --git a/resources/Schema/Components/ShieldAbility.xml b/resources/Schema/Components/ShieldAbility.xml new file mode 100644 index 00000000..49fcf0c0 --- /dev/null +++ b/resources/Schema/Components/ShieldAbility.xml @@ -0,0 +1,4 @@ + + + 2.0 + \ No newline at end of file diff --git a/resources/Schema/Components/ShieldAbility.xsd b/resources/Schema/Components/ShieldAbility.xsd new file mode 100644 index 00000000..49c0bae3 --- /dev/null +++ b/resources/Schema/Components/ShieldAbility.xsd @@ -0,0 +1,18 @@ + + + + + + + + A dash component for one of the classes + + + + + This is the cooldown on dash + + + + + \ No newline at end of file diff --git a/resources/Schema/Components/SprintAbility.xml b/resources/Schema/Components/SprintAbility.xml new file mode 100644 index 00000000..2aac99d6 --- /dev/null +++ b/resources/Schema/Components/SprintAbility.xml @@ -0,0 +1,4 @@ + + + 2.0 + \ No newline at end of file diff --git a/resources/Schema/Components/SprintAbility.xsd b/resources/Schema/Components/SprintAbility.xsd new file mode 100644 index 00000000..d8dc5383 --- /dev/null +++ b/resources/Schema/Components/SprintAbility.xsd @@ -0,0 +1,18 @@ + + + + + + + + A dash component for one of the classes + + + + + This is the cooldown on dash + + + + + \ No newline at end of file diff --git a/resources/Schema/Entities/BoostAssault.xml b/resources/Schema/Entities/BoostAssault.xml index 727e5363..9c8e54fd 100644 --- a/resources/Schema/Entities/BoostAssault.xml +++ b/resources/Schema/Entities/BoostAssault.xml @@ -4,7 +4,7 @@ - 55 + 10 diff --git a/resources/Schema/Entities/BoostDefender.xml b/resources/Schema/Entities/BoostDefender.xml new file mode 100644 index 00000000..f22b404e --- /dev/null +++ b/resources/Schema/Entities/BoostDefender.xml @@ -0,0 +1,14 @@ + + + + + + + 10 + + + + + + + diff --git a/resources/Schema/Entities/BoostSniper.xml b/resources/Schema/Entities/BoostSniper.xml new file mode 100644 index 00000000..a82a7a5d --- /dev/null +++ b/resources/Schema/Entities/BoostSniper.xml @@ -0,0 +1,14 @@ + + + + + + + 10 + + + + + + + diff --git a/src/Game/Systems/BoostSystem.cpp b/src/Game/Systems/BoostSystem.cpp index bdd36d6a..fdd5b6dc 100644 --- a/src/Game/Systems/BoostSystem.cpp +++ b/src/Game/Systems/BoostSystem.cpp @@ -25,35 +25,38 @@ bool BoostSystem::OnPlayerDamage(Events::PlayerDamage& e) return false; } - //friendly fire - - auto className = determineClass(e.Inflictor); + auto className = DetermineClass(e.Inflictor); if (className == "") { return false; } - //"Schema/Entities/BoostAssault.xml" + //"Schema/Entities/Boost-.xml" std::string classXML = "Schema/Entities/" + className + ".xml"; - //class - + //check if player already has the component + auto playerBoostAssaultEntity = e.Victim.FirstChildByName(className); + if (playerBoostAssaultEntity.Valid()) { + m_World->DeleteEntity(playerBoostAssaultEntity.ID); + } //load & set the BoostAssault Component auto entityFile = ResourceManager::Load(classXML); EntityFileParser parser(entityFile); EntityID boostAssaultEntity = parser.MergeEntities(m_World); + m_World->SetName(boostAssaultEntity, className); m_World->SetParent(boostAssaultEntity, e.Victim.ID); return true; } -std::string BoostSystem::determineClass(EntityWrapper player) +std::string BoostSystem::DetermineClass(EntityWrapper inflictorPlayer) { - if (m_World->HasComponent(player.ID, "DashAbility")) { + //determine the class based on what component the inflictor-player has + if (m_World->HasComponent(inflictorPlayer.ID, "DashAbility")) { return "BoostAssault"; } - if (m_World->HasComponent(player.ID, "DefenderShield")) { + if (m_World->HasComponent(inflictorPlayer.ID, "ShieldAbility")) { return "BoostDefender"; } - if (m_World->HasComponent(player.ID, "SniperSprint")) { + if (m_World->HasComponent(inflictorPlayer.ID, "SprintAbility")) { return "BoostSniper"; } return ""; diff --git a/src/Game/Systems/HealthSystem.cpp b/src/Game/Systems/HealthSystem.cpp index b4ea210c..82836d2c 100644 --- a/src/Game/Systems/HealthSystem.cpp +++ b/src/Game/Systems/HealthSystem.cpp @@ -30,8 +30,9 @@ bool HealthSystem::OnPlayerDamaged(Events::PlayerDamage& e) ComponentWrapper cHealth = e.Victim["Health"]; double& health = cHealth["Health"]; - if (e.Victim.HasComponent("BoostDefender")) { - e.Damage -= (double)e.Victim["BoostDefender"]["StrengthOfEffect"]; + auto playerBoostDefenderEntity = e.Victim.FirstChildByName("BoostDefender"); + if (playerBoostDefenderEntity.Valid()) { + e.Damage -= (double)playerBoostDefenderEntity["BoostDefender"]["StrengthOfEffect"]; } health -= e.Damage; diff --git a/src/Game/Systems/PlayerMovementSystem.cpp b/src/Game/Systems/PlayerMovementSystem.cpp index a0289f3d..cb28c7e6 100644 --- a/src/Game/Systems/PlayerMovementSystem.cpp +++ b/src/Game/Systems/PlayerMovementSystem.cpp @@ -53,9 +53,10 @@ void PlayerMovementSystem::updateMovementControllers(double dt) float playerMovementSpeed = player["Player"]["MovementSpeed"]; float playerCrouchSpeed = player["Player"]["CrouchSpeed"]; glm::vec3& wishDirection = player["Player"]["CurrentWishDirection"]; - if (player.HasComponent("BoostAssault")) { - playerMovementSpeed *= (double)player["BoostAssault"]["StrengthOfEffect"]; - playerCrouchSpeed *= (double)player["BoostAssault"]["StrengthOfEffect"]; + auto playerBoostAssaultEntity = player.FirstChildByName("BoostAssault"); + if (playerBoostAssaultEntity.Valid()) { + playerMovementSpeed *= (double)playerBoostAssaultEntity["BoostAssault"]["StrengthOfEffect"]; + playerCrouchSpeed *= (double)playerBoostAssaultEntity["BoostAssault"]["StrengthOfEffect"]; } @@ -110,8 +111,8 @@ void PlayerMovementSystem::updateMovementControllers(double dt) float doubleTapDashBoost = controller->AssaultDashDoubleTapped() ? 40.0f : 1.0f; accelerationSpeed = glm::min(doubleTapDashBoost*glm::min(accelerationSpeed, addSpeed), 50.0f); //if player has Boost from an Assault class, accelerate the player faster - if (player.HasComponent("BoostAssault")) { - accelerationSpeed *= (double)player["BoostAssault"]["StrengthOfEffect"]; + if (playerBoostAssaultEntity.Valid()) { + accelerationSpeed *= (double)playerBoostAssaultEntity["BoostAssault"]["StrengthOfEffect"]; } velocity += accelerationSpeed * wishDirection; ImGui::Text("velocity: (%f, %f, %f) |%f|", velocity.x, velocity.y, velocity.z, glm::length(velocity)); diff --git a/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp b/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp index 4a56ec8c..0b981169 100644 --- a/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp +++ b/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp @@ -385,11 +385,10 @@ bool AssaultWeaponBehaviour::shoot(double damage) } - // Do Not Check for friendly fire - //// Check for friendly fire - //if ((ComponentInfo::EnumType)victim["Team"]["Team"] == (ComponentInfo::EnumType)m_Player["Team"]["Team"]) { - // return false; - //} + // BoostUpdate: If friendly fire - reduce damage to 0 + if ((ComponentInfo::EnumType)victim["Team"]["Team"] == (ComponentInfo::EnumType)m_Player["Team"]["Team"]) { + damage = 0; + } // Deal damage! Events::PlayerDamage ePlayerDamage; From 8c92b7ceb6c389456260f9b6e0767149d10d8a71 Mon Sep 17 00:00:00 2001 From: verysecrethero Date: Thu, 18 Feb 2016 13:40:17 +0100 Subject: [PATCH 06/51] Small cleanup. Clarified a few comments --- include/Game/Systems/BoostSystem.h | 4 ---- src/Game/Systems/BoostSystem.cpp | 14 +++++++------- src/Game/Systems/HealthSystem.cpp | 1 + 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/include/Game/Systems/BoostSystem.h b/include/Game/Systems/BoostSystem.h index 5e9c47da..f82707ab 100644 --- a/include/Game/Systems/BoostSystem.h +++ b/include/Game/Systems/BoostSystem.h @@ -2,14 +2,10 @@ #define BoostSystem_h__ #include "Core/System.h" -#include "Core/Transform.h" #include "Core/ResourceManager.h" #include "Core/EntityFileParser.h" #include "Core/EPlayerDamage.h" #include "Common.h" -#include - -#include "Rendering/Util/CommonFunctions.h" class BoostSystem : public System { diff --git a/src/Game/Systems/BoostSystem.cpp b/src/Game/Systems/BoostSystem.cpp index fdd5b6dc..9e4d6968 100644 --- a/src/Game/Systems/BoostSystem.cpp +++ b/src/Game/Systems/BoostSystem.cpp @@ -14,30 +14,30 @@ bool BoostSystem::OnPlayerDamage(Events::PlayerDamage& e) if (!e.Victim.Valid() && e.Victim != LocalPlayer && !e.Victim.IsChildOf(LocalPlayer)) { return false; } - if (!e.Inflictor.Valid() || !e.Victim.Valid()) { return false; } - auto teamInflictor = m_World->GetComponent(e.Inflictor.ID, "Team"); - auto teamVictim = m_World->GetComponent(e.Victim.ID, "Team"); - if ((int)teamInflictor["Team"] != (int)teamVictim["Team"]) { + //if its not friendly fire, return + if ((int)m_World->GetComponent(e.Inflictor.ID, "Team")["Team"] != (int)m_World->GetComponent(e.Victim.ID, "Team")["Team"]) { return false; } + //determine the inflictors class auto className = DetermineClass(e.Inflictor); if (className == "") { return false; } - //"Schema/Entities/Boost-.xml" + + //get the XML file, example: "Schema/Entities/BoostclassName.xml" std::string classXML = "Schema/Entities/" + className + ".xml"; - //check if player already has the component + //check if player already has a child with the component, if so delete that child auto playerBoostAssaultEntity = e.Victim.FirstChildByName(className); if (playerBoostAssaultEntity.Valid()) { m_World->DeleteEntity(playerBoostAssaultEntity.ID); } - //load & set the BoostAssault Component + //load boost XML file, set it entity parented with the victim player auto entityFile = ResourceManager::Load(classXML); EntityFileParser parser(entityFile); EntityID boostAssaultEntity = parser.MergeEntities(m_World); diff --git a/src/Game/Systems/HealthSystem.cpp b/src/Game/Systems/HealthSystem.cpp index 82836d2c..6e1e276f 100644 --- a/src/Game/Systems/HealthSystem.cpp +++ b/src/Game/Systems/HealthSystem.cpp @@ -30,6 +30,7 @@ bool HealthSystem::OnPlayerDamaged(Events::PlayerDamage& e) ComponentWrapper cHealth = e.Victim["Health"]; double& health = cHealth["Health"]; + //if player has the boost from a defender, subtract the damage taken by StrengthOfEffect amount auto playerBoostDefenderEntity = e.Victim.FirstChildByName("BoostDefender"); if (playerBoostDefenderEntity.Valid()) { e.Damage -= (double)playerBoostDefenderEntity["BoostDefender"]["StrengthOfEffect"]; From b2304a95f8e9146feb666629e605039973071a48 Mon Sep 17 00:00:00 2001 From: verysecrethero Date: Thu, 18 Feb 2016 13:49:22 +0100 Subject: [PATCH 07/51] Fixed some XML documentation --- resources/Schema/Components/BoostSniper.xsd | 2 +- resources/Schema/Components/ShieldAbility.xsd | 4 ++-- resources/Schema/Components/SprintAbility.xsd | 4 ++-- src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/resources/Schema/Components/BoostSniper.xsd b/resources/Schema/Components/BoostSniper.xsd index 89778482..2d62a9da 100644 --- a/resources/Schema/Components/BoostSniper.xsd +++ b/resources/Schema/Components/BoostSniper.xsd @@ -5,7 +5,7 @@ - This is the defender's class boost component + This is the sniper's class boost component diff --git a/resources/Schema/Components/ShieldAbility.xsd b/resources/Schema/Components/ShieldAbility.xsd index 49c0bae3..5cf2145c 100644 --- a/resources/Schema/Components/ShieldAbility.xsd +++ b/resources/Schema/Components/ShieldAbility.xsd @@ -5,12 +5,12 @@ - A dash component for one of the classes + A shield component for one of the classes - This is the cooldown on dash + This is the cooldown on shield diff --git a/resources/Schema/Components/SprintAbility.xsd b/resources/Schema/Components/SprintAbility.xsd index d8dc5383..4207dee2 100644 --- a/resources/Schema/Components/SprintAbility.xsd +++ b/resources/Schema/Components/SprintAbility.xsd @@ -5,12 +5,12 @@ - A dash component for one of the classes + A sprint component for one of the classes - This is the cooldown on dash + This is the cooldown on sprint diff --git a/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp b/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp index 0b981169..7ea6f4f1 100644 --- a/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp +++ b/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp @@ -385,7 +385,7 @@ bool AssaultWeaponBehaviour::shoot(double damage) } - // BoostUpdate: If friendly fire - reduce damage to 0 + // If friendly fire - reduce damage to 0 (needed to make Boosts, Ammosharing work) if ((ComponentInfo::EnumType)victim["Team"]["Team"] == (ComponentInfo::EnumType)m_Player["Team"]["Team"]) { damage = 0; } From 144e548b7a660ff1e58d2f881692efbc3fe6b91f Mon Sep 17 00:00:00 2001 From: Tleety Date: Sun, 28 Feb 2016 17:17:24 +0100 Subject: [PATCH 08/51] Added AbilityCooldownHUD component and system to track the cooldown on the dashability, this needs to be extended for other abilities when they are implemented. However current dash time needs to be included into the component, since we can currently just see the max cooldown time. --- .../Game/Systems/AbilityCooldownHUDSystem.h | 17 + resources/Schema/Components.xsd | 1 + .../Schema/Components/AbilityCooldownHUD.xml | 3 + .../Schema/Components/AbilityCooldownHUD.xsd | 9 + resources/Schema/Entities/PlayerRed.xml | 91 ++- .../Schema/Entities/QualityAssurance.xml | 730 +++++++++++++++++- resources/Schema/Types/Entity.xsd | 1 + src/Game/Game.cpp | 2 + src/Game/Systems/AbilityCooldownHUDSystem.cpp | 28 + 9 files changed, 835 insertions(+), 47 deletions(-) create mode 100644 include/Game/Systems/AbilityCooldownHUDSystem.h create mode 100644 resources/Schema/Components/AbilityCooldownHUD.xml create mode 100644 resources/Schema/Components/AbilityCooldownHUD.xsd create mode 100644 src/Game/Systems/AbilityCooldownHUDSystem.cpp diff --git a/include/Game/Systems/AbilityCooldownHUDSystem.h b/include/Game/Systems/AbilityCooldownHUDSystem.h new file mode 100644 index 00000000..610b4dc2 --- /dev/null +++ b/include/Game/Systems/AbilityCooldownHUDSystem.h @@ -0,0 +1,17 @@ +#ifndef AbilityCooldownHUDSystem_h__ +#define AbilityCooldownHUDSystem_h__ + +#include "../../Engine/Core/System.h" +#include "../../Engine/GLM.h" + +class AbilityCooldownHUDSystem : public ImpureSystem +{ +public: + AbilityCooldownHUDSystem(SystemParams params) + : System(params) + { } + + virtual void Update(double dt) override; +}; + +#endif \ No newline at end of file diff --git a/resources/Schema/Components.xsd b/resources/Schema/Components.xsd index 42abed82..b90a445d 100644 --- a/resources/Schema/Components.xsd +++ b/resources/Schema/Components.xsd @@ -46,4 +46,5 @@ + \ No newline at end of file diff --git a/resources/Schema/Components/AbilityCooldownHUD.xml b/resources/Schema/Components/AbilityCooldownHUD.xml new file mode 100644 index 00000000..8f91bbc3 --- /dev/null +++ b/resources/Schema/Components/AbilityCooldownHUD.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/resources/Schema/Components/AbilityCooldownHUD.xsd b/resources/Schema/Components/AbilityCooldownHUD.xsd new file mode 100644 index 00000000..066a9442 --- /dev/null +++ b/resources/Schema/Components/AbilityCooldownHUD.xsd @@ -0,0 +1,9 @@ + + + + + + HUD element for tracking ability cooldown + + + \ No newline at end of file diff --git a/resources/Schema/Entities/PlayerRed.xml b/resources/Schema/Entities/PlayerRed.xml index d56fa3c1..1e419b4d 100644 --- a/resources/Schema/Entities/PlayerRed.xml +++ b/resources/Schema/Entities/PlayerRed.xml @@ -23,7 +23,9 @@ - + + + @@ -111,6 +113,7 @@ Textures/HealthHUD3.png + false @@ -121,7 +124,55 @@ - + + + + + + 1 + + + + Textures/Core/White.png + false + + + + + + + + + + + + + + 2.0 + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + + Textures/Props/FoliageDiff.png + false + + + + + + + + + @@ -137,6 +188,7 @@ Textures/Core/UnitHexagon.png + false @@ -155,6 +207,7 @@ Textures/Core/UnitHexagon_Rotated.png + false @@ -171,6 +224,7 @@ Textures/Core/UnitHexagon.png + false @@ -185,11 +239,11 @@ 3 - 0.80222018197612788 Textures/Core/UnitHexagon_Rotated.png + false @@ -206,6 +260,7 @@ Textures/Core/UnitHexagon.png + false @@ -220,10 +275,12 @@ 4 + 1 Textures/Core/UnitHexagon_Rotated.png + false @@ -240,6 +297,7 @@ Textures/Core/UnitHexagon.png + false @@ -258,6 +316,7 @@ Textures/Core/UnitHexagon_Rotated.png + false @@ -274,8 +333,9 @@ Textures/Core/UnitHexagon.png + false - + @@ -286,16 +346,18 @@ - + 1 + Textures/Core/UnitHexagon_Rotated.png + false - + @@ -364,7 +426,7 @@ Idle - 1.2667383999985162 + 1.2417589624457968 1 @@ -385,8 +447,8 @@ Models/Weapons/Red/AssaultWeaponRed.mesh - - + + @@ -492,10 +554,13 @@ - Idle - 0.26532318661337229 + Run + 0.012377234178668317 1 + 1 + 0.5 + 1.8342275085993549 @@ -519,8 +584,8 @@ Models/Weapons/Red/AssaultWeaponRed.mesh - - + + diff --git a/resources/Schema/Entities/QualityAssurance.xml b/resources/Schema/Entities/QualityAssurance.xml index 0aa2fbe7..3f880c91 100644 --- a/resources/Schema/Entities/QualityAssurance.xml +++ b/resources/Schema/Entities/QualityAssurance.xml @@ -40,7 +40,7 @@ - + @@ -93,7 +93,7 @@ - + @@ -108,7 +108,11 @@ - + + + + + Models/Characters/Assault/AssaultAnimated.mesh @@ -120,7 +124,11 @@ - + + + + + Models/Characters/Assault/AssaultAnimated.mesh @@ -168,21 +176,643 @@ - + - + - - - Models/Characters/Assault/AssaultAnimated.mesh - + + + + + + 600 + + + + + + + + + 5 + + + + + + - + + + + + + + + + + + + + Models/Widgets/Camera.mesh + false + + + + + + + + + + + + + + + + + + + Textures/Weapons/Crosshair/SmallThickHoleDot.png + false + + + + + + + + + + + + + Schema/Entities/HitMarker.xml + + + + + + + + + + + + + + 1 + + + + + 100/100 + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + + + 1 + + + + Textures/HealthHUD3.png + + + + + + + + + + + + + + + Textures/Test/SmallDiff.png + false + + + + + + + + + + + + + + + + + + + + + + + + + + + Textures/Core/UnitHexagon.png + + + + + + + + + + + + 2 + + + + + + Textures/Core/UnitHexagon_Rotated.png + + + + + + + + + + + + + + + + Textures/Core/UnitHexagon.png + + + + + + + + + + + + 3 + + + + + + Textures/Core/UnitHexagon_Rotated.png + + + + + + + + + + + + + + + + Textures/Core/UnitHexagon.png + + + + + + + + + + + + 4 + + + 1 + + + + Textures/Core/UnitHexagon_Rotated.png + + + + + + + + + + + + + + + + Textures/Core/UnitHexagon.png + + + + + + + + + + + + 1 + + + + + + Textures/Core/UnitHexagon_Rotated.png + + + + + + + + + + + + + + + + Textures/Core/UnitHexagon.png + + + + + + + + + + + + + 1 + + + + Textures/Core/UnitHexagon_Rotated.png + + + + + + + + + + + + + + + + + + + + + + + + + + + + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + + + + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + + + + + + + Idle + 1.0970008697500191 + 1 + + + + + Models/Characters/Assault/FirstPerson.mesh + + + + + + + + + R_Arm_Weapon_Joint + + + Models/Weapons/Red/AssaultWeaponRed.mesh + + + + + + + + + + + Schema/Entities/RayRed.xml + + + + + + + + + + + Schema/Entities/ReloadEffectViewRed.xml + + + + + + + + + + + + + + + + + + Textures/Core/UnitHexagon.png + + + + + + + + + + + + + + + + + + + 32 + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + 360 + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + + + + + + + + + + + + + Models/Widgets/Camera.mesh + false + + + + + + + + + + + + Run + 0.86761914148289065 + 1 + 1 + + 0.5 + 1.8342275085993549 + + + + AimRifle + + + + + Models/Characters/Assault/AssaultAnimations.mesh + + + + + + + + + R_Arm_Weapon_Joint + + + Models/Weapons/Red/AssaultWeaponRed.mesh + + + + + + + + + + + Schema/Entities/RayRed.xml + + + + + + + + + + + Schema/Entities/ReloadEffectWorldRed.xml + + + + + + + + + + + + + Models/Core/UnitCube.mesh + + false + + + + + + + + + + + + Models/Core/UnitCube.mesh + + false + + + + + + + + + + + Insert name here + Fonts/DroidSans.ttf,100 + + + + + + + + + + + + + + Textures/Icons/Arrow.png + false + + + + + + 50 + true + + + + + + + + + @@ -213,7 +843,7 @@ - + @@ -277,7 +907,7 @@ - + @@ -309,7 +939,7 @@ - + @@ -659,7 +1289,7 @@ - + @@ -706,7 +1336,7 @@ - + @@ -766,7 +1396,7 @@ - + @@ -813,7 +1443,7 @@ - + @@ -859,7 +1489,7 @@ - + @@ -906,7 +1536,7 @@ - + @@ -953,7 +1583,7 @@ - + @@ -1367,7 +1997,7 @@ - + @@ -1376,7 +2006,7 @@ true - 0.8256214817261025 + 2.8360836966480178 3.7999999523162842 true @@ -1423,7 +2053,7 @@ - + @@ -1432,7 +2062,7 @@ - 1.8641349174045843 + 1.47485045667446 Models/Characters/Assault/AssaultTPose.mesh @@ -1475,18 +2105,22 @@ - + - + + + + + true - 1.8641349174045843 + 1.47485045667446 true @@ -1531,7 +2165,7 @@ - + @@ -1541,7 +2175,7 @@ true - 1.2301962937648341 + 8.7351898541697892 10 3 @@ -1589,7 +2223,7 @@ - + @@ -1599,7 +2233,7 @@ true - 3.4214855659573402 + 4.5370673150397351 true 5 true @@ -1712,6 +2346,7 @@ + Fonts/DroidSans.ttf,100 @@ -1780,7 +2415,7 @@ true - 0.8256214817261025 + 2.8360836966480178 3.7999999523162842 true @@ -1823,7 +2458,11 @@ - + + + + + @@ -1925,6 +2564,7 @@ Textures/Props/FoliageDiff.png + @@ -1934,6 +2574,7 @@ Textures/Props/FoliageDiff.png + @@ -1954,6 +2595,7 @@ Textures/Core/UnitHexagon.png + @@ -1971,6 +2613,7 @@ Textures/Core/UnitHexagon_Rotated.png + @@ -1986,6 +2629,7 @@ Textures/Core/UnitHexagon.png + @@ -2003,6 +2647,7 @@ Textures/Core/UnitHexagon_Rotated.png + @@ -2018,6 +2663,7 @@ Textures/Core/UnitHexagon.png + @@ -2036,6 +2682,7 @@ Textures/Core/UnitHexagon_Rotated.png + @@ -2051,6 +2698,7 @@ Textures/Core/UnitHexagon.png + @@ -2068,6 +2716,7 @@ Textures/Core/UnitHexagon_Rotated.png + @@ -2083,6 +2732,7 @@ Textures/Core/UnitHexagon.png + @@ -2099,6 +2749,7 @@ Textures/Core/UnitHexagon_Rotated.png + @@ -2167,6 +2818,7 @@ Textures/Core/ErrorTexture.png + @@ -2178,6 +2830,7 @@ Textures/Core/White.png + @@ -2206,6 +2859,7 @@ Textures/Core/White.png + @@ -2234,6 +2888,7 @@ Textures/Core/White.png + @@ -2262,6 +2917,7 @@ Textures/Core/White.png + @@ -2290,6 +2946,7 @@ Textures/Core/White.png + @@ -2331,6 +2988,7 @@ Textures/Core/ErrorTexture.png + @@ -2342,6 +3000,7 @@ Textures/Core/White.png + @@ -2370,6 +3029,7 @@ Textures/Core/White.png + @@ -2398,6 +3058,7 @@ Textures/Core/White.png + @@ -2426,6 +3087,7 @@ Textures/Core/White.png + diff --git a/resources/Schema/Types/Entity.xsd b/resources/Schema/Types/Entity.xsd index a9c5f641..d2887e95 100644 --- a/resources/Schema/Types/Entity.xsd +++ b/resources/Schema/Types/Entity.xsd @@ -50,6 +50,7 @@ + diff --git a/src/Game/Game.cpp b/src/Game/Game.cpp index 24b7cd1e..f98bcb4c 100644 --- a/src/Game/Game.cpp +++ b/src/Game/Game.cpp @@ -25,6 +25,7 @@ #include "Rendering/AnimationSystem.h" #include "Network/MultiplayerSnapshotFilter.h" #include "Game/Systems/AmmunitionHUDSystem.h" +#include "Game/Systems/AbilityCooldownHUDSystem.h" #include "Game/Systems/KillFeedSystem.h" #include "GUI/ButtonSystem.h" #include "GUI/MainMenuSystem.h" @@ -128,6 +129,7 @@ Game::Game(int argc, char* argv[]) m_SystemPipeline->AddSystem(updateOrderLevel); m_SystemPipeline->AddSystem(updateOrderLevel); m_SystemPipeline->AddSystem(updateOrderLevel); + m_SystemPipeline->AddSystem(updateOrderLevel); m_SystemPipeline->AddSystem(updateOrderLevel); m_SystemPipeline->AddSystem(updateOrderLevel, m_Renderer); m_SystemPipeline->AddSystem(updateOrderLevel, m_Renderer); diff --git a/src/Game/Systems/AbilityCooldownHUDSystem.cpp b/src/Game/Systems/AbilityCooldownHUDSystem.cpp new file mode 100644 index 00000000..12d268c7 --- /dev/null +++ b/src/Game/Systems/AbilityCooldownHUDSystem.cpp @@ -0,0 +1,28 @@ +#include "Game/Systems/AbilityCooldownHUDSystem.h" + +void AbilityCooldownHUDSystem::Update(double dt) +{ + //HUD element for tracking cooldown on the parent entity with Dashability TODO: Make sure it support other abilities when they are made. + + auto abilityHUDs = m_World->GetComponents("AbilityCooldownHUD"); + if (abilityHUDs == nullptr) + return; + + for (auto& abilityHUDC : *abilityHUDs) { + EntityWrapper entity = EntityWrapper(m_World, abilityHUDC.EntityID); + EntityWrapper abilityEntity = entity.FirstParentWithComponent("DashAbility"); + if (!abilityEntity.Valid()) + return; + EntityWrapper cooldownTextEntity = entity.FirstChildByName("Cooldown"); + if(cooldownTextEntity.Valid()) { + if(cooldownTextEntity.HasComponent("Text")) + { + double abilityCD = (double)abilityEntity["DashAbility"]["CoolDownMaxTimer"]; + std::string t = (std::string&)cooldownTextEntity["Text"]["Content"] = std::to_string(abilityCD).substr(0, 3); + if(entity.HasComponent("Fill")) { + entity["Fill"]["Percentage"] = abilityCD/abilityCD; //TODO: current time needs to be in the component. + } + } + } + } +} From 7ba5e01560dbb86ff0d258476d5ed6541d2487e9 Mon Sep 17 00:00:00 2001 From: Tleety Date: Tue, 1 Mar 2016 15:37:28 +0100 Subject: [PATCH 09/51] CapturePointArrow component files --- .../Schema/Components/CapturePointArrow.xml | 5 ++++ .../Schema/Components/CapturePointArrow.xsd | 24 +++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 resources/Schema/Components/CapturePointArrow.xml create mode 100644 resources/Schema/Components/CapturePointArrow.xsd diff --git a/resources/Schema/Components/CapturePointArrow.xml b/resources/Schema/Components/CapturePointArrow.xml new file mode 100644 index 00000000..2943d57b --- /dev/null +++ b/resources/Schema/Components/CapturePointArrow.xml @@ -0,0 +1,5 @@ + + + 0 + + \ No newline at end of file diff --git a/resources/Schema/Components/CapturePointArrow.xsd b/resources/Schema/Components/CapturePointArrow.xsd new file mode 100644 index 00000000..7984fc50 --- /dev/null +++ b/resources/Schema/Components/CapturePointArrow.xsd @@ -0,0 +1,24 @@ + + + + + + + Hud element for tracking capture points. + + + + + + Corresponds to the number on the capture point it should track. + + + + + Specify the team that own this capturePoint. + + + + + + \ No newline at end of file From 5c6a652316bd875acad548965ddf23a681363596 Mon Sep 17 00:00:00 2001 From: William Moberg Date: Tue, 1 Mar 2016 15:53:59 +0100 Subject: [PATCH 10/51] Fixed so unregistered components are ignored instead of crashing the game. --- resources/Schema/Types/Entity.xsd | 2 ++ src/Engine/Core/EntityFileParser.cpp | 16 +++++++++++++--- src/Engine/Core/Util/Logging.cpp | 4 ++-- src/Engine/Editor/EditorSystem.cpp | 7 ++++--- 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/resources/Schema/Types/Entity.xsd b/resources/Schema/Types/Entity.xsd index 0965ef89..1c9456ad 100644 --- a/resources/Schema/Types/Entity.xsd +++ b/resources/Schema/Types/Entity.xsd @@ -52,6 +52,8 @@ + + diff --git a/src/Engine/Core/EntityFileParser.cpp b/src/Engine/Core/EntityFileParser.cpp index 23c0c4c4..2beaac14 100644 --- a/src/Engine/Core/EntityFileParser.cpp +++ b/src/Engine/Core/EntityFileParser.cpp @@ -1,6 +1,6 @@ #include "Core/EntityFileParser.h" -EntityFileParser::EntityFileParser(const EntityFile* entityFile) +EntityFileParser::EntityFileParser(const EntityFile* entityFile) : m_EntityFile(entityFile) { m_Handler.SetStartEntityCallback(std::bind(&EntityFileParser::onStartEntity, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); @@ -33,13 +33,20 @@ void EntityFileParser::onStartEntity(EntityID entity, EntityID parent, const std void EntityFileParser::onStartComponent(EntityID entity, const std::string& component) { - EntityID realEntity = m_EntityIDMapper.at(entity); - m_World->AttachComponent(realEntity, component); + if (m_World->GetComponentPools().count(component) != 0) { + EntityID realEntity = m_EntityIDMapper.at(entity); + m_World->AttachComponent(realEntity, component); + } else { + LOG_ERROR("Tried to attach unregistered component \"%s\"! to entity #%i. Ignoring.", component.c_str(), entity); + } //LOG_DEBUG("Attached component of type \"%s\" to entity #%i (%i)", component.c_str(), entity, realEntity); } void EntityFileParser::onStartComponentField(EntityID entity, const std::string& componentType, const std::string& fieldName, const std::map& attributes) { + if (m_World->GetComponentPools().count(componentType) == 0) { + return; + } EntityID realEntity = m_EntityIDMapper.at(entity); ComponentWrapper component = m_World->GetComponent(realEntity, componentType); auto fieldIt = component.Info.Fields.find(fieldName); @@ -61,6 +68,9 @@ void EntityFileParser::onStartComponentField(EntityID entity, const std::string& void EntityFileParser::onFieldData(EntityID entity, const std::string& componentType, const std::string& fieldName, const char* fieldData) { + if (m_World->GetComponentPools().count(componentType) == 0) { + return; + } EntityID realEntity = m_EntityIDMapper.at(entity); ComponentWrapper component = m_World->GetComponent(realEntity, componentType); auto fieldIt = component.Info.Fields.find(fieldName); diff --git a/src/Engine/Core/Util/Logging.cpp b/src/Engine/Core/Util/Logging.cpp index c7612fd8..63a6f380 100644 --- a/src/Engine/Core/Util/Logging.cpp +++ b/src/Engine/Core/Util/Logging.cpp @@ -33,8 +33,8 @@ void _LOG(_LOG_LEVEL logLevel, const char* file, const char* func, unsigned int va_end(args); if (logLevel == LOG_LEVEL_ERROR) { - //std::cerr << file << ":" << line << " " << func << std::endl; - //std::cerr << _LOG_LEVEL_PREFIX[logLevel] << message << std::endl; + std::cerr << file << ":" << line << " " << func << std::endl; + std::cerr << _LOG_LEVEL_PREFIX[logLevel] << message << std::endl; } else { std::cout << _LOG_LEVEL_PREFIX[logLevel] << message << std::endl; } diff --git a/src/Engine/Editor/EditorSystem.cpp b/src/Engine/Editor/EditorSystem.cpp index 4bee1427..47547b8f 100644 --- a/src/Engine/Editor/EditorSystem.cpp +++ b/src/Engine/Editor/EditorSystem.cpp @@ -258,16 +258,17 @@ EntityWrapper EditorSystem::importEntity(EntityWrapper parent, boost::filesystem return EntityWrapper::Invalid; } - try { + //try { auto entityFile = ResourceManager::Load(filePath.string()); EntityFilePreprocessor fpp(entityFile); fpp.RegisterComponents(parent.World); EntityFileParser fp(entityFile); EntityID newEntity = fp.MergeEntities(parent.World, parent.ID); return EntityWrapper(parent.World, newEntity); - } catch (const std::exception&) { + /*} catch (const std::exception& e) { + LOG_ERROR("Failed to import entity \"%s\": \"%s\"", filePath.string().c_str(), e.what()); return EntityWrapper::Invalid; - } + }*/ } void EditorSystem::setWidgetMode(EditorGUI::WidgetMode mode) From b0a66f9e8369801db3b2c322052b29bdb84c2141 Mon Sep 17 00:00:00 2001 From: Tleety Date: Tue, 1 Mar 2016 16:19:59 +0100 Subject: [PATCH 11/51] Components for CapturePoint arrow HUD element and a system skeleton --- .../Game/Systems/CapturePointArrowHUDSystem.h | 20 ++++++++++++++++ resources/Schema/Components.xsd | 1 + .../Schema/Components/CapturePointArrow.xml | 5 ---- .../Schema/Components/CapturePointArrow.xsd | 24 ------------------- .../Components/CapturePointArrowHUD.xml | 4 ++++ .../Components/CapturePointArrowHUD.xsd | 18 ++++++++++++++ resources/Schema/Types/Entity.xsd | 1 + src/Game/Game.cpp | 2 ++ .../Systems/CapturePointArrowHUDSystem.cpp | 13 ++++++++++ 9 files changed, 59 insertions(+), 29 deletions(-) create mode 100644 include/Game/Systems/CapturePointArrowHUDSystem.h delete mode 100644 resources/Schema/Components/CapturePointArrow.xml delete mode 100644 resources/Schema/Components/CapturePointArrow.xsd create mode 100644 resources/Schema/Components/CapturePointArrowHUD.xml create mode 100644 resources/Schema/Components/CapturePointArrowHUD.xsd create mode 100644 src/Game/Systems/CapturePointArrowHUDSystem.cpp diff --git a/include/Game/Systems/CapturePointArrowHUDSystem.h b/include/Game/Systems/CapturePointArrowHUDSystem.h new file mode 100644 index 00000000..30406c3c --- /dev/null +++ b/include/Game/Systems/CapturePointArrowHUDSystem.h @@ -0,0 +1,20 @@ +#ifndef CapturePointArrowHUDSystem_h__ +#define CapturePointArrowHUDSystem_h__ + +#include +#include + +#include "Common.h" +#include "Core/System.h" + +class CapturePointArrowHUDSystem : public ImpureSystem +{ +public: + CapturePointArrowHUDSystem(SystemParams params); + + virtual void Update(double dt) override; + +private: +}; + +#endif \ No newline at end of file diff --git a/resources/Schema/Components.xsd b/resources/Schema/Components.xsd index eb41ed6a..d8ace908 100644 --- a/resources/Schema/Components.xsd +++ b/resources/Schema/Components.xsd @@ -50,4 +50,5 @@ + \ No newline at end of file diff --git a/resources/Schema/Components/CapturePointArrow.xml b/resources/Schema/Components/CapturePointArrow.xml deleted file mode 100644 index 2943d57b..00000000 --- a/resources/Schema/Components/CapturePointArrow.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 0 - - \ No newline at end of file diff --git a/resources/Schema/Components/CapturePointArrow.xsd b/resources/Schema/Components/CapturePointArrow.xsd deleted file mode 100644 index 7984fc50..00000000 --- a/resources/Schema/Components/CapturePointArrow.xsd +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - Hud element for tracking capture points. - - - - - - Corresponds to the number on the capture point it should track. - - - - - Specify the team that own this capturePoint. - - - - - - \ No newline at end of file diff --git a/resources/Schema/Components/CapturePointArrowHUD.xml b/resources/Schema/Components/CapturePointArrowHUD.xml new file mode 100644 index 00000000..ebe8727a --- /dev/null +++ b/resources/Schema/Components/CapturePointArrowHUD.xml @@ -0,0 +1,4 @@ + + + 0 + \ No newline at end of file diff --git a/resources/Schema/Components/CapturePointArrowHUD.xsd b/resources/Schema/Components/CapturePointArrowHUD.xsd new file mode 100644 index 00000000..d1c035f6 --- /dev/null +++ b/resources/Schema/Components/CapturePointArrowHUD.xsd @@ -0,0 +1,18 @@ + + + + + + HUD element for tracking next capturable Capture Point. + + + + + + Corresponds to the current capturepoint the arrow points Towards + + + + + + \ No newline at end of file diff --git a/resources/Schema/Types/Entity.xsd b/resources/Schema/Types/Entity.xsd index 0965ef89..61d8e520 100644 --- a/resources/Schema/Types/Entity.xsd +++ b/resources/Schema/Types/Entity.xsd @@ -52,6 +52,7 @@ + diff --git a/src/Game/Game.cpp b/src/Game/Game.cpp index 8be665e0..e16d1841 100644 --- a/src/Game/Game.cpp +++ b/src/Game/Game.cpp @@ -25,6 +25,7 @@ #include "Rendering/AnimationSystem.h" #include "Network/MultiplayerSnapshotFilter.h" #include "Game/Systems/AmmunitionHUDSystem.h" +#include "Game/Systems/CapturePointArrowHUDSystem.h" #include "Game/Systems/KillFeedSystem.h" #include "GUI/ButtonSystem.h" #include "GUI/MainMenuSystem.h" @@ -131,6 +132,7 @@ Game::Game(int argc, char* argv[]) m_SystemPipeline->AddSystem(updateOrderLevel); m_SystemPipeline->AddSystem(updateOrderLevel); m_SystemPipeline->AddSystem(updateOrderLevel); + m_SystemPipeline->AddSystem(updateOrderLevel); m_SystemPipeline->AddSystem(updateOrderLevel); m_SystemPipeline->AddSystem(updateOrderLevel, m_Renderer); m_SystemPipeline->AddSystem(updateOrderLevel, m_Renderer); diff --git a/src/Game/Systems/CapturePointArrowHUDSystem.cpp b/src/Game/Systems/CapturePointArrowHUDSystem.cpp new file mode 100644 index 00000000..e621d90d --- /dev/null +++ b/src/Game/Systems/CapturePointArrowHUDSystem.cpp @@ -0,0 +1,13 @@ +#include "Systems/CapturePointArrowHUDSystem.h" + +CapturePointArrowHUDSystem::CapturePointArrowHUDSystem(SystemParams params) + : System(params) + , ImpureSystem() +{ +} + + +void CapturePointArrowHUDSystem::Update(double dt) +{ + //Logic here +} \ No newline at end of file From 3d4427dd20d0c8ef62aa24d1c1deaaf18c693ea2 Mon Sep 17 00:00:00 2001 From: William Moberg Date: Tue, 1 Mar 2016 17:32:14 +0100 Subject: [PATCH 12/51] Added entity SpectatorCamera that shows respawntime, will activate when explosion effect is deleted. --- include/Game/Systems/PlayerDeathSystem.h | 5 + .../Schema/Entities/NewMapWSpectatorCam.xml | 5356 +++++++++++++++++ resources/Schema/Entities/SpectatorCamera.xml | 40 + resources/Schema/Types/Entity.xsd | 1 + src/Game/Systems/PlayerDeathSystem.cpp | 24 + src/Game/Systems/PlayerSpawnSystem.cpp | 12 + 6 files changed, 5438 insertions(+) create mode 100644 resources/Schema/Entities/NewMapWSpectatorCam.xml create mode 100644 resources/Schema/Entities/SpectatorCamera.xml diff --git a/include/Game/Systems/PlayerDeathSystem.h b/include/Game/Systems/PlayerDeathSystem.h index 112c202e..f32e32df 100644 --- a/include/Game/Systems/PlayerDeathSystem.h +++ b/include/Game/Systems/PlayerDeathSystem.h @@ -11,6 +11,7 @@ #include "Core/EntityFileParser.h" #include "Core/EPlayerDeath.h" +#include "Core/EEntityDeleted.h" class PlayerDeathSystem : public ImpureSystem { @@ -20,8 +21,12 @@ public: virtual void Update(double dt) override; private: + EntityWrapper m_LocalPlayerDeathEffect; + EventRelay m_OnPlayerDeath; bool OnPlayerDeath(Events::PlayerDeath& e); + EventRelay m_EEntityDeleted; + bool OnEntityDeleted(Events::EntityDeleted& e); void createDeathEffect(EntityWrapper player); diff --git a/resources/Schema/Entities/NewMapWSpectatorCam.xml b/resources/Schema/Entities/NewMapWSpectatorCam.xml new file mode 100644 index 00000000..f74a4857 --- /dev/null +++ b/resources/Schema/Entities/NewMapWSpectatorCam.xml @@ -0,0 +1,5356 @@ + + + + + + 3.6027407165331624 + 15 + + + + + + + + + + + + + + + Models/Props/Ground.mesh + + + + + + + + + Models/Props/Highground1.mesh + + + + + + + + + + Models/Props/Highground2.mesh + + + + + + + + + + Models/Props/Highground1.mesh + + + + + + + + + + + + Models/Props/Highground2.mesh + + + + + + + + + + + + Models/Props/Highground3.mesh + + + + + + + + + + Models/Props/Highground4.mesh + + + + + + + + + + Models/Props/Highground5.mesh + + + + + + + + + + + Models/Props/Highground6.mesh + + + + + + + + + + Models/Props/Walls/SciFiWallTop.mesh + + + + + + + + + Models/Props/Walls/SciFiWallBig.mesh + + + + + + + + + + Models/Props/Walls/SciFiWallMedium.mesh + + + + + + + + + + Models/Props/Walls/SciFiWallSmall1.mesh + + + + + + + + + + Models/Props/Walls/SciFiWallSmall2.mesh + + + + + + + + + + Models/Props/Walls/SciFiWallBig.mesh + + + + + + + + + + + + Models/Props/Walls/SciFiWallMedium.mesh + + + + + + + + + + + + Models/Props/Walls/SciFiWallSmall3.mesh + + + + + + + + + + Models/Props/Walls/SciFiWallSmall4.mesh + + + + + + + + + + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar1Blue.mesh + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar1Red.mesh + + + + + + + + + + + + + Models/Props/Pillars/StonePillar.mesh + + + + + + + + + + + + Models/Props/Pillars/StonePillar.mesh + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar2Red.mesh + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar3Blue.mesh + + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar1Blue.mesh + + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar1Red.mesh + + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar3Red.mesh + + + + + + + + + + + + + + Models/Props/Pillars/StonePillar.mesh + + + + + + + + + + + + Models/Props/Pillars/StonePillar.mesh + + + + + + + + + + + + + Models/Props/Pillars/StonePillar.mesh + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar2Blue.mesh + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar2Red.mesh + + + + + + + + + + + + + Models/Props/Pillars/StonePillar.mesh + + + + + + + + + + + Models/Props/Pillars/StonePillar.mesh + + + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar2Blue.mesh + + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar2Blue.mesh + + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar2Blue.mesh + + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar2Blue.mesh + + + + + + + + + + + + + Models/Props/Pillars/StonePillar.mesh + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar2Red.mesh + + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar2Red.mesh + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar2Red.mesh + + + + + + + + + + + + + + Models/Props/Pillars/StonePillar.mesh + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar2Red.mesh + + + + + + + + + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + + + + Models/Props/Walls/MediumWall3.mesh + + + + + + + + + + + + Models/Props/Walls/MediumWall3.mesh + + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + + Models/Props/Walls/SmallWall2.mesh + + + + + + + + + + + + + Models/Props/Walls/SmallWall4.mesh + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + Models/Props/Walls/SmallWall2.mesh + + + + + + + + + + + + + Models/Props/Walls/SmallWall2.mesh + + + + + + + + + + + + + Models/Props/Walls/SmallWall2.mesh + + + + + + + + + + + + + Models/Props/Walls/MediumWall2.mesh + + + + + + + + + + + + Models/Props/Walls/MediumWall2.mesh + + + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + Models/Props/Walls/SmallWall4.mesh + + + + + + + + + + + + + + Models/Props/Walls/SmallWall4.mesh + + + + + + + + + + + + Models/Props/Walls/SmallWall2.mesh + + + + + + + + + + + + + + Models/Props/Walls/SmallWall2.mesh + + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + + + + Models/Props/Walls/SmallWall2.mesh + + + + + + + + + + + + + + Models/Props/Walls/SmallWall2.mesh + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + + + + Models/Props/Walls/MediumWall3.mesh + + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + Models/Props/Walls/SmallWall2.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + Models/Props/Walls/SpecialWall1.mesh + + + + + + + + + + + + + + Models/Props/Flora/SpecialRoot.mesh + + + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + Models/Props/Walls/MediumWall3.mesh + + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + + + Models/Props/Walls/SmallWall2.mesh + + + + + + + + + + + + + Models/Props/Walls/SmallWall2.mesh + + + + + + + + + + + + Models/Props/Walls/SmallWall2.mesh + + + + + + + + + + + + Models/Props/Walls/MediumWall3.mesh + + + + + + + + + + + + Models/Props/Walls/MediumWall2.mesh + + + + + + + + + + + Models/Props/Walls/MediumWall2.mesh + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + Models/Props/Walls/SmallWall4.mesh + + + + + + + + + + + + + + + + Models/Props/Walls/MediumWall3.mesh + + + + + + + + + + + + + Models/Props/Walls/MediumWall2.mesh + + + + + + + + + + + + + Models/Props/Walls/SpecialWall1.mesh + + + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + + Models/Props/Walls/SpecialWall1.mesh + + + + + + + + + + + + Models/Props/Walls/SpecialWall1.mesh + + + + + + + + + + + + + Models/Props/Walls/SpecialWall1.mesh + + + + + + + + + + + + + Models/Props/Walls/SpecialWall1.mesh + + + + + + + + + + + + + Models/Props/Walls/SpecialWall1.mesh + + + + + + + + + + + + + + Models/Props/Walls/SpecialWall1.mesh + + + + + + + + + + + + + + + + + + + + + Models/Props/Bridges/WoodenBridge.mesh + + + + + + + + + + + + + + Models/Props/Bridges/WoodenBridge.mesh + + + + + + + + + + + + + + Models/Props/Bridges/WoodenBridge.mesh + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridge1Red.mesh + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridge1Blue.mesh + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + + + + + + + + + + Models/Props/Pillars/SciFiBridgePillar1.mesh + + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridge1Blue.mesh + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridge1Blue.mesh + + + + + + + + + + + + + Models/Props/Pillars/SciFiBridgePillar1.mesh + + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridge1Red.mesh + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridge1Red.mesh + + + + + + + + + + + + + Models/Props/Bridges/WoodenBridge.mesh + + + + + + + + + + + + + + + + + + + + + Models/Props/Pillars/SciFiBridgePillar1.mesh + + + + + + + + + + + + + + Models/Props/Pillars/SciFiBridgePillar1.mesh + + + + + + + + + + + + + + Models/Props/Walls/MediumWall2.mesh + + + + + + + + + + + Models/Props/Walls/MediumWall2.mesh + + + + + + + + + + + + + + + Models/Props/Walls/MediumWall3.mesh + + + + + + + + + + + Models/Props/Walls/MediumWall3.mesh + + + + + + + + + + + + + + Models/Props/Pillars/SciFiBridgePillar1.mesh + + + + + + + + + + + + Models/Core/UnitCube.mesh + + + + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + + + Models/Core/UnitCube.mesh + + + + + + + + + + + + + Models/Core/UnitCube.mesh + + + + + + + + + + + + + + Models/Core/UnitPlane.mesh + + true + + + + + + + + + + + + + Models/Core/UnitPlane.mesh + + true + + + + + + + + + + + + + + Models/Core/UnitCube.mesh + + + + + + + + + + + + + Models/Core/UnitCube.mesh + + + + + + + + + + + + + + + + Models/Props/Pillars/SciFiBridgePillar1.mesh + + + + + + + + + + + + + + Models/Props/Pillars/SciFiBridgePillar1.mesh + + + + + + + + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + + + Models/Props/Flora/TreeLog.mesh + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + + Models/Props/Flora/SpecialRoot.mesh + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + + Models/Props/Flora/SpecialRoot.mesh + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + + Models/Props/Flora/SpecialRoot.mesh + + + + + + + + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + + + + + + + + Models/Props/SciFiHolder1.mesh + + + + + + + + + + + + + Models/Props/SciFiHolder1.mesh + + + + + + + + + + + + + Models/Props/SciFiHolder1.mesh + + + + + + + + + + + + + Models/Props/SciFiHolder1.mesh + + + + + + + + + + + + + Models/Props/SciFiHolder1.mesh + + + + + + + + + + + + + Models/Props/SciFiHolder1.mesh + + + + + + + + + + + + + Models/Props/SciFiHolder1.mesh + + + + + + + + + + + + + Models/Props/SciFiHolder1.mesh + + + + + + + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + + + + + + + + + + + Models/Props/CapturePoint/CapturePointBlue.mesh + + + + + + + + + + + + + 4 + + + Models/Core/UnitCylinder.mesh + + true + + + + + + + + + + + + + + + + + + + + + Models/Props/CapturePoint/CapturePointNeutral.mesh + + + + + + + + + + 3 + + + Models/Core/UnitCylinder.mesh + + true + + + + + + + + + + + + + + + + + Models/Props/CapturePoint/CapturePointNeutral.mesh + + + + + + + + + + 2 + + + Models/Core/UnitCylinder.mesh + + true + + + + + + + + + + + + + + + + + Models/Props/CapturePoint/CapturePointNeutral.mesh + + + + + + + + + + 1.5498908015879351 + 1 + + + Models/Core/UnitCylinder.mesh + + true + + + + + + + + + + + + + + + + + Models/Props/CapturePoint/CapturePointRed.mesh + + + + + + + + + + + + + + + Models/Core/UnitCylinder.mesh + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + 10 + + + + + + + + + + 10 + + + + + + + + + + + + + 10 + + + + + + + + + + + 10 + + + + + + + + + + + 10 + + + + + + + + + + + 1 + + + + + + + + + + + + + + Schema/Entities/PlayerRed.xml + + + + + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + + + + + + Schema/Entities/Player.xml + + + + + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + + + + + + + + + + + 0.10000000149011612 + + + + Models/Props/PickUps/HealthPickUp.mesh + + + + + + + + + + + + + + + 0.10000000149011612 + + + + Models/Props/PickUps/AmmoPickUp.mesh + + + + + + + + + + + + + + + 0.10000000149011612 + + + + Models/Props/PickUps/HealthPickUp.mesh + + + + + + + + + + + + + + + 0.10000000149011612 + + + + Models/Props/PickUps/HealthPickUp.mesh + + + + + + + + + + + + + + + 0.10000000149011612 + + + + Models/Props/PickUps/AmmoPickUp.mesh + + + + + + + + + + + + + + + 0.10000000149011612 + + + + Models/Props/PickUps/HealthPickUp.mesh + + + + + + + + + + + + + + + 0.10000000149011612 + + + + Models/Props/PickUps/AmmoPickUp.mesh + + + + + + + + + + + + + + + 0.10000000149011612 + + + + Models/Props/PickUps/AmmoPickUp.mesh + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + + + + + + + + diff --git a/resources/Schema/Entities/SpectatorCamera.xml b/resources/Schema/Entities/SpectatorCamera.xml new file mode 100644 index 00000000..dbfdecf0 --- /dev/null +++ b/resources/Schema/Entities/SpectatorCamera.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + + + + + + diff --git a/resources/Schema/Types/Entity.xsd b/resources/Schema/Types/Entity.xsd index 1c9456ad..21605953 100644 --- a/resources/Schema/Types/Entity.xsd +++ b/resources/Schema/Types/Entity.xsd @@ -54,6 +54,7 @@ + diff --git a/src/Game/Systems/PlayerDeathSystem.cpp b/src/Game/Systems/PlayerDeathSystem.cpp index 844d2ed1..f645abe7 100644 --- a/src/Game/Systems/PlayerDeathSystem.cpp +++ b/src/Game/Systems/PlayerDeathSystem.cpp @@ -4,6 +4,7 @@ PlayerDeathSystem::PlayerDeathSystem(SystemParams params) : System(params) { EVENT_SUBSCRIBE_MEMBER(m_OnPlayerDeath, &PlayerDeathSystem::OnPlayerDeath); + EVENT_SUBSCRIBE_MEMBER(m_EEntityDeleted, &PlayerDeathSystem::OnEntityDeleted); } void PlayerDeathSystem::Update(double dt) @@ -59,9 +60,32 @@ void PlayerDeathSystem::createDeathEffect(EntityWrapper player) //camera (with lifetime) behind the player if (player == LocalPlayer) { + m_LocalPlayerDeathEffect = deathEffectEW; auto cam = deathEffectEW.FirstChildByName("Camera"); Events::SetCamera eSetCamera; eSetCamera.CameraEntity = cam; m_EventBroker->Publish(eSetCamera); } } + +bool PlayerDeathSystem::OnEntityDeleted(Events::EntityDeleted& e) +{ + // We only care about when the local players death effect is removed. + if (m_LocalPlayerDeathEffect.ID != e.DeletedEntity) { + return false; + } + // Set the spectator camera as active, if it exists. + auto pool = m_World->GetComponents("CapturePointGameMode"); + if (pool == nullptr || pool->size() == 0) { + return false; + } + ComponentWrapper modeComponent = *pool->begin(); + EntityWrapper theLevel = EntityWrapper(m_LocalPlayerDeathEffect.World, modeComponent.EntityID); + EntityWrapper spectatorCam = theLevel.FirstChildByName("SpectatorCamera"); + if (!spectatorCam.Valid() && spectatorCam.HasComponent("Camera")) { + return false; + } + Events::SetCamera eSetCamera; + eSetCamera.CameraEntity = spectatorCam; + m_EventBroker->Publish(eSetCamera); +} diff --git a/src/Game/Systems/PlayerSpawnSystem.cpp b/src/Game/Systems/PlayerSpawnSystem.cpp index e03a1778..2f6928af 100644 --- a/src/Game/Systems/PlayerSpawnSystem.cpp +++ b/src/Game/Systems/PlayerSpawnSystem.cpp @@ -27,6 +27,18 @@ void PlayerSpawnSystem::Update(double dt) double& timer = (double&)modeComponent["RespawnTime"]; timer += dt; double maxRespawnTime = m_DbgConfigForceRespawn ? m_ForcedRespawnTime : (double)modeComponent["MaxRespawnTime"]; + EntityWrapper theLevel = EntityWrapper(m_World, modeComponent.EntityID); + EntityWrapper spectatorCam = theLevel.FirstChildByName("SpectatorCamera"); + if (spectatorCam.Valid()) { + EntityWrapper HUD = spectatorCam.FirstChildByName("SpectatorHUD"); + if (HUD.Valid()) { + EntityWrapper respawnTimer = spectatorCam.FirstChildByName("RespawnTimer"); + if (respawnTimer.Valid()) { + //Update respawn time in the HUD element. + respawnTimer["Text"]["Content"] = "Time to respawn: " + std::to_string(1 + (int)(maxRespawnTime - timer)); + } + } + } if (timer < maxRespawnTime) { return; } From 5a8261453e33dbec1917f300d66d7a9fcc3f9701 Mon Sep 17 00:00:00 2001 From: William Moberg Date: Tue, 1 Mar 2016 17:40:42 +0100 Subject: [PATCH 13/51] Eliminated some SAXParsing errors from our console output. --- resources/Schema/Types/Entity.xsd | 3 +++ 1 file changed, 3 insertions(+) diff --git a/resources/Schema/Types/Entity.xsd b/resources/Schema/Types/Entity.xsd index 21605953..79ac0f1b 100644 --- a/resources/Schema/Types/Entity.xsd +++ b/resources/Schema/Types/Entity.xsd @@ -55,6 +55,9 @@ + + + From 6281e200005fb311687a517d19c14cc8e5b6bee1 Mon Sep 17 00:00:00 2001 From: Tleety Date: Tue, 1 Mar 2016 20:31:09 +0100 Subject: [PATCH 14/51] Arrow should now track the CapturePoint specified in the Component. --- .../Game/Systems/CapturePointArrowHUDSystem.h | 3 + include/Game/Systems/CapturePointHUDSystem.h | 2 +- resources/Schema/Entities/PlayerRed.xml | 58 ++++--- .../Schema/Entities/QualityAssurance.xml | 154 +++++++++++++----- .../Systems/CapturePointArrowHUDSystem.cpp | 105 +++++++++++- 5 files changed, 261 insertions(+), 61 deletions(-) diff --git a/include/Game/Systems/CapturePointArrowHUDSystem.h b/include/Game/Systems/CapturePointArrowHUDSystem.h index 30406c3c..4c197f02 100644 --- a/include/Game/Systems/CapturePointArrowHUDSystem.h +++ b/include/Game/Systems/CapturePointArrowHUDSystem.h @@ -3,9 +3,12 @@ #include #include +#include #include "Common.h" #include "Core/System.h" +#include "Core/Transform.h" + class CapturePointArrowHUDSystem : public ImpureSystem { diff --git a/include/Game/Systems/CapturePointHUDSystem.h b/include/Game/Systems/CapturePointHUDSystem.h index 41db0c12..53ca9b73 100644 --- a/include/Game/Systems/CapturePointHUDSystem.h +++ b/include/Game/Systems/CapturePointHUDSystem.h @@ -7,7 +7,7 @@ #include "Common.h" #include "Core/System.h" -#include "Engine/Collision/ETrigger.h" +#include "Collision/ETrigger.h" class CapturePointHUDSystem : public ImpureSystem { diff --git a/resources/Schema/Entities/PlayerRed.xml b/resources/Schema/Entities/PlayerRed.xml index 3cf17558..8982f58d 100644 --- a/resources/Schema/Entities/PlayerRed.xml +++ b/resources/Schema/Entities/PlayerRed.xml @@ -13,7 +13,7 @@ - 1.6944730461160304 + 326.69883589440087 @@ -30,7 +30,7 @@ - + @@ -193,7 +193,6 @@ 3 - 0.80222018197612788 @@ -228,6 +227,7 @@ 4 + 1 @@ -283,7 +283,7 @@ Textures/Core/UnitHexagon.png - + @@ -294,7 +294,8 @@ - + 1 + Textures/Core/UnitHexagon_Rotated.png @@ -303,7 +304,7 @@ - + @@ -372,7 +373,7 @@ Idle - 0.67172915251515519 + 0.20909021680133577 1 @@ -386,30 +387,44 @@ + + DefenderWeapon + Schema/Entities/DefenderWeaponViewRed.xml - - DefenderWeapon - + + AssaultWeapon + Schema/Entities/AssaultWeaponView.xml - - AssaultWeapon - + + + + + Models/Weapons/Blue/AssaultWeaponBlue.mesh + + + + + + + + + @@ -430,6 +445,7 @@ Idle + 0.22069183859343156 1 @@ -449,31 +465,31 @@ - - Schema/Entities/DefenderWeaponWorldRed.xml - - DefenderWeapon + + Schema/Entities/DefenderWeaponWorldRed.xml + + - - Schema/Entities/AssaultWeaponWorld.xml - - AssaultWeapon + + Schema/Entities/AssaultWeaponWorld.xml + + diff --git a/resources/Schema/Entities/QualityAssurance.xml b/resources/Schema/Entities/QualityAssurance.xml index 0aa2fbe7..04cc288a 100644 --- a/resources/Schema/Entities/QualityAssurance.xml +++ b/resources/Schema/Entities/QualityAssurance.xml @@ -2,6 +2,9 @@ + + 4.7473226580121377 + @@ -40,7 +43,7 @@ - + @@ -81,19 +84,19 @@ + + 1 + + 0.80000001192092896 Models/Widgets/Lights/DirectionalLightWidget.mesh - - 1 - - - + @@ -108,7 +111,11 @@ - + + + + + Models/Characters/Assault/AssaultAnimated.mesh @@ -120,7 +127,11 @@ - + + + + + Models/Characters/Assault/AssaultAnimated.mesh @@ -168,13 +179,17 @@ - + - + + + + + Models/Characters/Assault/AssaultAnimated.mesh @@ -213,7 +228,7 @@ - + @@ -277,7 +292,7 @@ - + @@ -309,7 +324,7 @@ - + @@ -659,7 +674,7 @@ - + @@ -706,7 +721,7 @@ - + @@ -766,7 +781,7 @@ - + @@ -813,7 +828,7 @@ - + @@ -859,7 +874,7 @@ - + @@ -906,7 +921,7 @@ - + @@ -953,7 +968,7 @@ - + @@ -1013,6 +1028,7 @@ 15 + Models/Core/UnitCube.mesh @@ -1027,7 +1043,6 @@ - @@ -1063,6 +1078,7 @@ 1 + Models/Core/UnitCube.mesh @@ -1073,7 +1089,6 @@ - @@ -1107,6 +1122,7 @@ 2 + Models/Core/UnitCube.mesh @@ -1117,7 +1133,6 @@ - @@ -1153,6 +1168,7 @@ 3 + Models/Core/UnitCube.mesh @@ -1163,7 +1179,6 @@ - @@ -1203,6 +1218,7 @@ -15 4 + Models/Core/UnitCube.mesh @@ -1217,7 +1233,6 @@ - @@ -1367,7 +1382,7 @@ - + @@ -1376,7 +1391,7 @@ true - 0.8256214817261025 + 2.5396116058983438 3.7999999523162842 true @@ -1423,7 +1438,7 @@ - + @@ -1432,7 +1447,7 @@ - 1.8641349174045843 + 1.5396208215609732 Models/Characters/Assault/AssaultTPose.mesh @@ -1475,18 +1490,22 @@ - + - + + + + + true - 1.8641349174045843 + 1.5396208215609732 true @@ -1531,7 +1550,7 @@ - + @@ -1541,7 +1560,7 @@ true - 1.2301962937648341 + 4.4522528839264339 10 3 @@ -1589,7 +1608,7 @@ - + @@ -1599,7 +1618,7 @@ true - 3.4214855659573402 + 3.2362842141074992 true 5 true @@ -1690,6 +1709,7 @@ 5 + @@ -1712,6 +1732,7 @@ + Fonts/DroidSans.ttf,100 @@ -1780,7 +1801,7 @@ true - 0.8256214817261025 + 2.5396116058983438 3.7999999523162842 true @@ -1823,7 +1844,11 @@ - + + + + + @@ -1925,6 +1950,7 @@ Textures/Props/FoliageDiff.png + @@ -1934,6 +1960,7 @@ Textures/Props/FoliageDiff.png + @@ -1954,6 +1981,7 @@ Textures/Core/UnitHexagon.png + @@ -1971,6 +1999,7 @@ Textures/Core/UnitHexagon_Rotated.png + @@ -1986,6 +2015,7 @@ Textures/Core/UnitHexagon.png + @@ -2003,6 +2033,7 @@ Textures/Core/UnitHexagon_Rotated.png + @@ -2018,6 +2049,7 @@ Textures/Core/UnitHexagon.png + @@ -2036,6 +2068,7 @@ Textures/Core/UnitHexagon_Rotated.png + @@ -2051,6 +2084,7 @@ Textures/Core/UnitHexagon.png + @@ -2068,6 +2102,7 @@ Textures/Core/UnitHexagon_Rotated.png + @@ -2083,6 +2118,7 @@ Textures/Core/UnitHexagon.png + @@ -2099,6 +2135,7 @@ Textures/Core/UnitHexagon_Rotated.png + @@ -2167,6 +2204,7 @@ Textures/Core/ErrorTexture.png + @@ -2178,6 +2216,7 @@ Textures/Core/White.png + @@ -2206,6 +2245,7 @@ Textures/Core/White.png + @@ -2234,6 +2274,7 @@ Textures/Core/White.png + @@ -2262,6 +2303,7 @@ Textures/Core/White.png + @@ -2290,6 +2332,7 @@ Textures/Core/White.png + @@ -2331,6 +2374,7 @@ Textures/Core/ErrorTexture.png + @@ -2342,6 +2386,7 @@ Textures/Core/White.png + @@ -2370,6 +2415,7 @@ Textures/Core/White.png + @@ -2398,6 +2444,7 @@ Textures/Core/White.png + @@ -2426,6 +2473,7 @@ Textures/Core/White.png + @@ -2482,6 +2530,36 @@ + + + + + + + + + + + + 2 + + + Models/Weapons/Blue/AssaultWeaponBlue.mesh + + + + + + + + + + + + + + + diff --git a/src/Game/Systems/CapturePointArrowHUDSystem.cpp b/src/Game/Systems/CapturePointArrowHUDSystem.cpp index e621d90d..92c6ec0a 100644 --- a/src/Game/Systems/CapturePointArrowHUDSystem.cpp +++ b/src/Game/Systems/CapturePointArrowHUDSystem.cpp @@ -9,5 +9,108 @@ CapturePointArrowHUDSystem::CapturePointArrowHUDSystem(SystemParams params) void CapturePointArrowHUDSystem::Update(double dt) { - //Logic here + + bool LoadCheck = true; + int redTeam; + int blueTeam; + int spectatorTeam; + + //Get list for all CapturePointArrowHUDComponents + auto ArrowHUDs = m_World->GetComponents("CapturePointArrowHUD"); + auto CapturePoints = m_World->GetComponents("CapturePoint"); + if(ArrowHUDs == nullptr) { + return; + } + + for(auto& cArrowHUD : *ArrowHUDs) { + //Get what team the current arrow corresponds to + EntityWrapper ArrowEntity = EntityWrapper(m_World, cArrowHUD.EntityID); + EntityWrapper teamEntity = ArrowEntity.FirstParentWithComponent("Team"); + if (!teamEntity.Valid()) { + continue; + } + auto cTeam = teamEntity["Team"]; + int currentTeam = (int)cTeam["Team"]; + + if (LoadCheck) { + redTeam = (int)cTeam["Team"].Enum("Red"); + blueTeam = (int)cTeam["Team"].Enum("Blue"); + spectatorTeam = (int)cTeam["Team"].Enum("Spectator"); + LoadCheck = false; + } + + //if red team, get red team next point, otherwise blue team next point. + //Untill this is awailable we will just use the hardcoded value in the component. + //This will also give us a position, so we wont need to loop through all capturePoints. + glm::vec3 pos; + int target = cArrowHUD["CurrentTarget"]; + for(auto& cCP : *CapturePoints) { + if((int)cCP["CapturePointNumber"] == target) { + EntityWrapper CPEntity = EntityWrapper(m_World, cCP.EntityID); + pos = Transform::AbsolutePosition(CPEntity); + break; + } + } + glm::vec3& arrowOri = ArrowEntity["Transform"]["Orientation"]; + glm::vec3 lookVector = glm::normalize(Transform::AbsolutePosition(ArrowEntity) - pos); //Maybe should be player instead + float pitch = std::asin(-lookVector.y); + float yaw = std::atan2(lookVector.x, lookVector.z); + arrowOri.x = pitch; + arrowOri.y = yaw; + arrowOri.z = 0.f; + EntityWrapper parent = ArrowEntity.Parent(); + if (parent.Valid()) { + arrowOri -= Transform::AbsoluteOrientationEuler(parent); + } + } + + /* + bool LoadCheck = true; + int redTeam; + int blueTeam; + int spectatorTeam; + + auto CapturePointHUDElements = m_World->GetComponents("CapturePointHUD"); + auto CapturePoints = m_World->GetComponents("CapturePoint"); + if (CapturePointHUDElements == nullptr) { + return; + } + + if (!CapturePointHUDElements) { + return; + } + + for (auto& cCapturePointHUD : *CapturePointHUDElements) { + int HUD_ID = cCapturePointHUD["CapturePointNumber"]; + EntityWrapper entityHUD = EntityWrapper(m_World, cCapturePointHUD.EntityID); + EntityWrapper entityHUDparent = entityHUD.Parent(); + + for (auto& cCapturePoint : *CapturePoints) { + EntityWrapper entityCP = EntityWrapper(m_World, cCapturePoint.EntityID); + + //Check if the HUD corresponds to the Capture Point Number + if (HUD_ID == (int)entityCP["CapturePoint"]["CapturePointNumber"]) { + ComponentWrapper& teamComponent = entityCP["Team"]; + if (LoadCheck) { + redTeam = (int)teamComponent["Team"].Enum("Red"); + blueTeam = (int)teamComponent["Team"].Enum("Blue"); + spectatorTeam = (int)teamComponent["Team"].Enum("Spectator"); + LoadCheck = false; + } + //Color hud with team color + auto capturePointTeam = (int)teamComponent["Team"]; + entityHUDparent["Sprite"]["Color"] = capturePointTeam == blueTeam ? glm::vec4(0, 0.2f, 1, 0.7f) : capturePointTeam == redTeam ? glm::vec4(1, 0.0f, 0, 0.7f) : glm::vec4(1, 1, 1, 0.3f); + + //Progress is scaled with time + double currentCaptureTime = (double)entityCP["CapturePoint"]["CaptureTimer"]; + double progress = glm::abs(currentCaptureTime)/15.0; + int currentCapturingTeam = currentCaptureTime > 0 ? redTeam : currentCaptureTime < 0 ? blueTeam : spectatorTeam; + ((glm::vec3&)entityHUD["Transform"]["Orientation"]).z = currentCapturingTeam == redTeam ? glm::half_pi()+glm::pi() : glm::half_pi(); + glm::vec4 fillColor = currentCapturingTeam == redTeam ? glm::vec4(1, 0.f, 0, 0.7f) : glm::vec4(0, 0.2f, 1, 0.7f); + entityHUD["Fill"]["Color"] = fillColor; + entityHUD["Fill"]["Percentage"] = progress; + } + } + } + */ } \ No newline at end of file From ab40fa715b8d47681ab58561c95b4aa02bf94391 Mon Sep 17 00:00:00 2001 From: Tleety Date: Tue, 1 Mar 2016 21:57:30 +0100 Subject: [PATCH 15/51] The arrow should now track CapturePoints correctly at start and when they are captured. --- .../Game/Systems/CapturePointArrowHUDSystem.h | 7 + .../Systems/CapturePointArrowHUDSystem.cpp | 131 ++++++++++-------- 2 files changed, 82 insertions(+), 56 deletions(-) diff --git a/include/Game/Systems/CapturePointArrowHUDSystem.h b/include/Game/Systems/CapturePointArrowHUDSystem.h index 4c197f02..26462879 100644 --- a/include/Game/Systems/CapturePointArrowHUDSystem.h +++ b/include/Game/Systems/CapturePointArrowHUDSystem.h @@ -8,6 +8,7 @@ #include "Common.h" #include "Core/System.h" #include "Core/Transform.h" +#include "Core/ECaptured.h" class CapturePointArrowHUDSystem : public ImpureSystem @@ -18,6 +19,12 @@ public: virtual void Update(double dt) override; private: + EventRelay m_ECapturedEvent; + bool OnCapturePointCaptured(Events::Captured& e); + + bool m_InitialtargetsSet = false; + glm::vec3 m_RedTeamCurrentTarget; + glm::vec3 m_BlueTeamCurrentTarget; }; #endif \ No newline at end of file diff --git a/src/Game/Systems/CapturePointArrowHUDSystem.cpp b/src/Game/Systems/CapturePointArrowHUDSystem.cpp index 92c6ec0a..ee2254c7 100644 --- a/src/Game/Systems/CapturePointArrowHUDSystem.cpp +++ b/src/Game/Systems/CapturePointArrowHUDSystem.cpp @@ -4,12 +4,12 @@ CapturePointArrowHUDSystem::CapturePointArrowHUDSystem(SystemParams params) : System(params) , ImpureSystem() { + EVENT_SUBSCRIBE_MEMBER(m_ECapturedEvent, &CapturePointArrowHUDSystem::OnCapturePointCaptured); } void CapturePointArrowHUDSystem::Update(double dt) { - bool LoadCheck = true; int redTeam; int blueTeam; @@ -25,11 +25,13 @@ void CapturePointArrowHUDSystem::Update(double dt) for(auto& cArrowHUD : *ArrowHUDs) { //Get what team the current arrow corresponds to EntityWrapper ArrowEntity = EntityWrapper(m_World, cArrowHUD.EntityID); - EntityWrapper teamEntity = ArrowEntity.FirstParentWithComponent("Team"); - if (!teamEntity.Valid()) { + if (!ArrowEntity.Valid()) { continue; } - auto cTeam = teamEntity["Team"]; + if(!ArrowEntity.HasComponent("Team")) { + continue; + } + auto cTeam = ArrowEntity["Team"]; int currentTeam = (int)cTeam["Team"]; if (LoadCheck) { @@ -37,20 +39,60 @@ void CapturePointArrowHUDSystem::Update(double dt) blueTeam = (int)cTeam["Team"].Enum("Blue"); spectatorTeam = (int)cTeam["Team"].Enum("Spectator"); LoadCheck = false; + + + if (!m_InitialtargetsSet) { + glm::vec3 target1, target2; + EntityWrapper home1, home2; + + for (auto& cCP : *CapturePoints) { + auto homePointTeam = (int)cCP["HomePointForTeam"]; + auto CPID = (int)cCP["CapturePointNumber"]; + + if(CPID == 0) { + //Home point for one team + home1 = EntityWrapper(m_World, cCP.EntityID); + } else if (CPID == 1) { + //First target for one team, so save it for later use. + target1 = Transform::AbsolutePosition(EntityWrapper(m_World, cCP.EntityID)); + } else if (CPID == 3) { + //First target for one team, so save it for later use. + target2 = Transform::AbsolutePosition(EntityWrapper(m_World, cCP.EntityID)); + } else if (CPID == 4) { + //Home point for one team + home2 = EntityWrapper(m_World, cCP.EntityID); + } + } + //Check what team is the owner of Home1 and set their target to the next capturepoint + if((int)home1["CapturePoint"]["HomePointForTeam"] == redTeam) { + m_RedTeamCurrentTarget = target1; + } else if ((int)home1["CapturePoint"]["HomePointForTeam"] == blueTeam) { + m_BlueTeamCurrentTarget = target1; + } + + //Check what team is the owner of Home2 and set their target to the next capturepoint + if ((int)home2["CapturePoint"]["HomePointForTeam"] == redTeam) { + m_RedTeamCurrentTarget = target2; + } else if ((int)home2["CapturePoint"]["HomePointForTeam"] == blueTeam) { + m_BlueTeamCurrentTarget = target2; + } + } + + } //if red team, get red team next point, otherwise blue team next point. //Untill this is awailable we will just use the hardcoded value in the component. //This will also give us a position, so we wont need to loop through all capturePoints. glm::vec3 pos; - int target = cArrowHUD["CurrentTarget"]; - for(auto& cCP : *CapturePoints) { - if((int)cCP["CapturePointNumber"] == target) { - EntityWrapper CPEntity = EntityWrapper(m_World, cCP.EntityID); - pos = Transform::AbsolutePosition(CPEntity); - break; - } + if(currentTeam == redTeam) { + pos = m_RedTeamCurrentTarget; + } else if (currentTeam == blueTeam) { + pos = m_BlueTeamCurrentTarget; } + + pos = currentTeam == redTeam ? m_RedTeamCurrentTarget : currentTeam == blueTeam ? m_BlueTeamCurrentTarget : glm::vec3(0.f); + glm::vec3& arrowOri = ArrowEntity["Transform"]["Orientation"]; glm::vec3 lookVector = glm::normalize(Transform::AbsolutePosition(ArrowEntity) - pos); //Maybe should be player instead float pitch = std::asin(-lookVector.y); @@ -63,54 +105,31 @@ void CapturePointArrowHUDSystem::Update(double dt) arrowOri -= Transform::AbsoluteOrientationEuler(parent); } } +} - /* - bool LoadCheck = true; - int redTeam; - int blueTeam; - int spectatorTeam; - - auto CapturePointHUDElements = m_World->GetComponents("CapturePointHUD"); - auto CapturePoints = m_World->GetComponents("CapturePoint"); - if (CapturePointHUDElements == nullptr) { - return; +bool CapturePointArrowHUDSystem::OnCapturePointCaptured(Events::Captured& e) +{ + if (!e.NextCapturePoint.HasComponent("Team")) + { + return 0; } - if (!CapturePointHUDElements) { - return; + auto cTeam = e.NextCapturePoint["Team"]; + + int redTeam = (int)cTeam["Team"].Enum("Red"); + int blueTeam = (int)cTeam["Team"].Enum("Blue"); + int spectatorTeam = (int)cTeam["Team"].Enum("Spectator"); + int target = -1; + + if (e.NextCapturePoint.HasComponent("CapturePoint")) { + target = (int)e.NextCapturePoint["CapturePoint"]["CapturePointNumber"]; + } else { + return 0; } - for (auto& cCapturePointHUD : *CapturePointHUDElements) { - int HUD_ID = cCapturePointHUD["CapturePointNumber"]; - EntityWrapper entityHUD = EntityWrapper(m_World, cCapturePointHUD.EntityID); - EntityWrapper entityHUDparent = entityHUD.Parent(); - - for (auto& cCapturePoint : *CapturePoints) { - EntityWrapper entityCP = EntityWrapper(m_World, cCapturePoint.EntityID); - - //Check if the HUD corresponds to the Capture Point Number - if (HUD_ID == (int)entityCP["CapturePoint"]["CapturePointNumber"]) { - ComponentWrapper& teamComponent = entityCP["Team"]; - if (LoadCheck) { - redTeam = (int)teamComponent["Team"].Enum("Red"); - blueTeam = (int)teamComponent["Team"].Enum("Blue"); - spectatorTeam = (int)teamComponent["Team"].Enum("Spectator"); - LoadCheck = false; - } - //Color hud with team color - auto capturePointTeam = (int)teamComponent["Team"]; - entityHUDparent["Sprite"]["Color"] = capturePointTeam == blueTeam ? glm::vec4(0, 0.2f, 1, 0.7f) : capturePointTeam == redTeam ? glm::vec4(1, 0.0f, 0, 0.7f) : glm::vec4(1, 1, 1, 0.3f); - - //Progress is scaled with time - double currentCaptureTime = (double)entityCP["CapturePoint"]["CaptureTimer"]; - double progress = glm::abs(currentCaptureTime)/15.0; - int currentCapturingTeam = currentCaptureTime > 0 ? redTeam : currentCaptureTime < 0 ? blueTeam : spectatorTeam; - ((glm::vec3&)entityHUD["Transform"]["Orientation"]).z = currentCapturingTeam == redTeam ? glm::half_pi()+glm::pi() : glm::half_pi(); - glm::vec4 fillColor = currentCapturingTeam == redTeam ? glm::vec4(1, 0.f, 0, 0.7f) : glm::vec4(0, 0.2f, 1, 0.7f); - entityHUD["Fill"]["Color"] = fillColor; - entityHUD["Fill"]["Percentage"] = progress; - } - } + if(e.TeamNumberThatCapturedCapturePoint == redTeam) { + m_RedTeamCurrentTarget = Transform::AbsolutePosition(e.NextCapturePoint); + } else if (e.TeamNumberThatCapturedCapturePoint == blueTeam) { + m_BlueTeamCurrentTarget = Transform::AbsolutePosition(e.NextCapturePoint);; } - */ -} \ No newline at end of file +} From 799990f44dbfd50b04a074d54d9c078efa49fb9a Mon Sep 17 00:00:00 2001 From: Tleety Date: Tue, 1 Mar 2016 22:54:13 +0100 Subject: [PATCH 16/51] Next CP indicator should now be fully working. --- assets | 2 +- resources/Schema/Entities/NewMap2version2.xml | 4690 +++++++++++++++++ .../Schema/Entities/NewMap2version3NEW.xml | 4612 ++++++++++++++++ resources/Schema/Entities/Player.xml | 61 +- resources/Schema/Entities/PlayerRed.xml | 9 +- .../Systems/CapturePointArrowHUDSystem.cpp | 8 +- 6 files changed, 9354 insertions(+), 28 deletions(-) create mode 100644 resources/Schema/Entities/NewMap2version2.xml create mode 100644 resources/Schema/Entities/NewMap2version3NEW.xml diff --git a/assets b/assets index 10a61165..72530423 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 10a611659ddaadfea6a560e707d395834855a979 +Subproject commit 72530423ad3744341f42cbfdcba18295a2cfac90 diff --git a/resources/Schema/Entities/NewMap2version2.xml b/resources/Schema/Entities/NewMap2version2.xml new file mode 100644 index 00000000..fcb81666 --- /dev/null +++ b/resources/Schema/Entities/NewMap2version2.xml @@ -0,0 +1,4690 @@ + + + + + + + + + + + + + + + + + + Models/Props/GroundTest.mesh + + + + + + + + + Models/Props/Walls/SciFiWallTop.mesh + + + + + + + + + Models/Props/Walls/SciFiWallBig.mesh + true + + + + + + + + + + Models/Props/Walls/SciFiWallMedium.mesh + + + + + + + + + + Models/Props/Walls/SciFiWallSmall1.mesh + + + + + + + + + + Models/Props/Walls/SciFiWallSmall2.mesh + + + + + + + + + + Models/Props/Walls/SciFiWallBig.mesh + + + + + + + + + + + + Models/Props/Walls/SciFiWallMedium.mesh + + + + + + + + + + + + Models/Props/Walls/SciFiWallSmall3.mesh + + + + + + + + + + Models/Props/Walls/SciFiWallSmall4.mesh + + + + + + + + + + + + Models/Props/Highground1.mesh + + + + + + + + + + Models/Props/Highground2.mesh + + + + + + + + + + + Models/Props/Highground3.mesh + + + + + + + + + + + Models/Props/Highground4.mesh + + + + + + + + + + + Models/Props/Highground5.mesh + + + + + + + + + + Models/Props/Highground6.mesh + + + + + + + + + + + Models/Props/Highground7.mesh + + + + + + + + + + + + + Models/Props/Highground8.mesh + + + + + + + + + + + + + Models/Props/Highground9.mesh + + + + + + + + + + + + + Models/Props/Highground10.mesh + + + + + + + + + + + + + Models/Props/Highground6.mesh + + + + + + + + + + + + + Models/Props/Highground1.mesh + + + + + + + + + + + + Models/Props/Highground2.mesh + + + + + + + + + + + + + Models/Props/Highground3.mesh + + + + + + + + + + + + + Models/Props/Highground4.mesh + + + + + + + + + + + + + Models/Props/Highground5.mesh + + + + + + + + + + + + + + + + + + + + + + 6 + Models/Props/Pillars/SciFiPillar1Blue.mesh + + + + + + + + + + + + + 6 + Models/Props/Pillars/SciFiPillar1Red.mesh + + + + + + + + + + + + + 4 + Models/Props/Pillars/SciFiPillar2Red.mesh + + + + + + + + + + + + + 6 + Models/Props/Pillars/SciFiPillar3Blue.mesh + + + + + + + + + + + + + + 6 + Models/Props/Pillars/SciFiPillar1Blue.mesh + + + + + + + + + + + + + + 4 + Models/Props/Pillars/SciFiPillar1Red.mesh + + + + + + + + + + + + + + 4 + Models/Props/Pillars/SciFiPillar3Red.mesh + + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar2Blue.mesh + + + + + + + + + + + + + 6 + Models/Props/Pillars/SciFiPillar2Red.mesh + + + + + + + + + + + + + 6 + Models/Props/Pillars/SciFiPillar2Blue.mesh + + + + + + + + + + + + + + 6 + Models/Props/Pillars/SciFiPillar2Blue.mesh + + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar2Blue.mesh + + + + + + + + + + + + + + 6 + Models/Props/Pillars/SciFiPillar2Blue.mesh + + + + + + + + + + + + + 4 + Models/Props/Pillars/SciFiPillar2Red.mesh + + + + + + + + + + + + + + 6 + Models/Props/Pillars/SciFiPillar2Red.mesh + + + + + + + + + + + + + 6 + Models/Props/Pillars/SciFiPillar2Red.mesh + + + + + + + + + + + + + + 6 + Models/Props/Pillars/SciFiPillar2Red.mesh + + + + + + + + + + + + + + + + + + + + + + + + + 6 + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 2 + + + + + + + + + + + + + + 5 + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + + 6 + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + + 6 + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + 2 + + + + + + + + + + + + + + 6 + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + 4 + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + + 2 + + + + + + + + + + + + 3 + + + + + + + + + + + + 2 + 1 + + + + + + + + + + + + + + 6 + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + + 6 + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + 2 + + + + + + + + + + + Models/Props/PickUps/HealthPickUp.mesh + + + 8 + + + + + + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + 2 + + + + + + + + + + + Models/Props/PickUps/HealthPickUp.mesh + + + 8 + + + + + + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + 2 + + + + + + + + + + + Models/Props/PickUps/AmmoPickUp.mesh + + + 8 + + + + + + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + 2 + + + + + + + + + + + Models/Props/PickUps/AmmoPickUp.mesh + + + 8 + + + + + + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + 2 + + + + + + + + + + + Models/Props/PickUps/HealthPickUp.mesh + + + 8 + + + + + + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + 2 + + + + + + + + + + + Models/Props/PickUps/HealthPickUp.mesh + + + 8 + + + + + + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + 2 + + + + + + + + + + + Models/Props/PickUps/AmmoPickUp.mesh + + + 8 + + + + + + + + + + + + + + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridge1Red.mesh + + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridge1Red.mesh + + + + + + + + + + + + Models/Props/Pillars/SciFiBridgePillar1.mesh + + + + + + + + + + + + + + + Models/Props/Pillars/SciFiBridgePillar1.mesh + + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridge1Red.mesh + + + + + + + + + + + + + + + + + + + + + Models/Props/SciFiHolder1.mesh + + + + + + + + + + + + + Models/Props/SciFiHolder1.mesh + + + + + + + + + + + + + + + + + + + + Models/Props/Flora/SpecialRoot.mesh + + + + + + + + + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + + Models/Props/Walls/MediumWall2.mesh + + + + + + + + + + + + + Models/Props/Walls/MediumWall2.mesh + + + + + + + + + + + + + Models/Props/Walls/MediumWall2.mesh + + + + + + + + + + + + + Models/Props/Walls/MediumWall2.mesh + + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + + Models/Core/UnitPlane.mesh + + true + + + + + + + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + + + + + + + + + + 6 + Models/Props/Pillars/SciFiPillar1Red.mesh + + + + + + + + + + + + + + Models/Props/Pillars/StonePillar.mesh + + + + + + + + + + + + + + Models/Props/Pillars/StonePillar.mesh + + + + + + + + + + + + + + Models/Props/Pillars/StonePillar.mesh + + + + + + + + + + + + + + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + 2 + + + + + + + + + + + Models/Props/PickUps/HealthPickUp.mesh + + + 8 + + + + + + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + 2 + + + + + + + + + + + Models/Props/PickUps/AmmoPickUp.mesh + + + 8 + + + + + + + + + + + + + + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + + + + + + + + + + 6 + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + + 6 + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + + + + + + + + Models/Props/Walls/SmallWall2.mesh + + + + + + + + + + + + + Models/Props/Walls/SmallWall2.mesh + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 6 + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 2 + + + + + + + + + + + + + + 5 + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + 6 + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + 6 + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + 2 + + + + + + + + + + + + + + 6 + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + 4 + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + 2 + + + + + + + + + + + + 3 + + + + + + + + + + + + 2 + 1 + + + + + + + + + + + + + + 6 + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + 6 + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + 2 + + + + + + + + + + + Models/Props/PickUps/HealthPickUp.mesh + + + 8 + + + + + + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + 2 + + + + + + + + + + + Models/Props/PickUps/HealthPickUp.mesh + + + 8 + + + + + + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + 2 + + + + + + + + + + + Models/Props/PickUps/AmmoPickUp.mesh + + + 8 + + + + + + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + 2 + + + + + + + + + + + Models/Props/PickUps/AmmoPickUp.mesh + + + 8 + + + + + + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + 2 + + + + + + + + + + + Models/Props/PickUps/HealthPickUp.mesh + + + 8 + + + + + + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + 2 + + + + + + + + + + + Models/Props/PickUps/HealthPickUp.mesh + + + 8 + + + + + + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + 2 + + + + + + + + + + + Models/Props/PickUps/AmmoPickUp.mesh + + + 8 + + + + + + + + + + + + + + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridge1Blue.mesh + + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridge1Blue.mesh + + + + + + + + + + + + Models/Props/Pillars/SciFiBridgePillar1.mesh + + + + + + + + + + + + + + + Models/Props/Pillars/SciFiBridgePillar1.mesh + + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridge1Blue.mesh + + + + + + + + + + + + + + + + + + + + + Models/Props/SciFiHolder1.mesh + + + + + + + + + + + + + Models/Props/SciFiHolder1.mesh + + + + + + + + + + + + + + + + + + + + Models/Props/Flora/SpecialRoot.mesh + + + + + + + + + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + + Models/Props/Walls/MediumWall2.mesh + + + + + + + + + + + + + Models/Props/Walls/MediumWall2.mesh + + + + + + + + + + + + + Models/Props/Walls/MediumWall2.mesh + + + + + + + + + + + + + Models/Props/Walls/MediumWall2.mesh + + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + + Models/Core/UnitPlane.mesh + + true + + + + + + + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + + + + + + + + + + 6 + Models/Props/Pillars/SciFiPillar1Blue.mesh + + + + + + + + + + + + + + Models/Props/Pillars/StonePillar.mesh + + + + + + + + + + + + + + Models/Props/Pillars/StonePillar.mesh + + + + + + + + + + + + + + Models/Props/Pillars/StonePillar.mesh + + + + + + + + + + + + + + + + + + + + + + + Models/Props/CapturePoint/CapturePointBlue.mesh + + + + + + + + + + + + + 4 + + + Models/Core/UnitCylinder.mesh + + true + + + + + + + + + + + + + + + + + + + + + Models/Props/CapturePoint/CapturePointNeutral.mesh + + + + + + + + + + 3 + + + Models/Core/UnitCylinder.mesh + + true + + + + + + + + + + + + + + + + + Models/Props/CapturePoint/CapturePointNeutral.mesh + + + + + + + + + + 2 + + + Models/Core/UnitCylinder.mesh + + true + + + + + + + + + + + + + + + + + Models/Props/CapturePoint/CapturePointNeutral.mesh + + + + + + + + + + 1 + + + Models/Core/UnitCylinder.mesh + + true + + + + + + + + + + + + + + + + + Models/Props/CapturePoint/CapturePointRed.mesh + + + + + + + + + + + + + + + Models/Core/UnitCylinder.mesh + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + 10 + + + + + + + + + + + 10 + + + + + + + + + + + 10 + + + + + + + + + + + + 10 + + + + + + + + + + + 1 + false + + + + + + + + + + + + 10 + + + + + + + + + + + + + + Schema/Entities/PlayerRed.xml + + + + + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + + + + + + Schema/Entities/Player.xml + + + + + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + + + + diff --git a/resources/Schema/Entities/NewMap2version3NEW.xml b/resources/Schema/Entities/NewMap2version3NEW.xml new file mode 100644 index 00000000..d24675cd --- /dev/null +++ b/resources/Schema/Entities/NewMap2version3NEW.xml @@ -0,0 +1,4612 @@ + + + + + + + + + + + + + + + + + + Models/Props/GroundTest.mesh + + + + + + + + + Models/Props/Walls/SciFiWallTop.mesh + + + + + + + + + Models/Props/Walls/SciFiWallBig.mesh + true + + + + + + + + + + Models/Props/Walls/SciFiWallMedium.mesh + + + + + + + + + + Models/Props/Walls/SciFiWallSmall1.mesh + + + + + + + + + + Models/Props/Walls/SciFiWallSmall2.mesh + + + + + + + + + + Models/Props/Walls/SciFiWallBig.mesh + + + + + + + + + + + + Models/Props/Walls/SciFiWallMedium.mesh + + + + + + + + + + + + Models/Props/Walls/SciFiWallSmall3.mesh + + + + + + + + + + Models/Props/Walls/SciFiWallSmall4.mesh + + + + + + + + + + + + Models/Props/Highground1.mesh + + + + + + + + + + Models/Props/Highground2.mesh + + + + + + + + + + + Models/Props/Highground3.mesh + + + + + + + + + + + Models/Props/Highground4.mesh + + + + + + + + + + + Models/Props/Highground5.mesh + + + + + + + + + + Models/Props/Highground6.mesh + + + + + + + + + + + Models/Props/Highground7.mesh + + + + + + + + + + + + + Models/Props/Highground8.mesh + + + + + + + + + + + + + Models/Props/Highground9.mesh + + + + + + + + + + + + + Models/Props/Highground10.mesh + + + + + + + + + + + + + Models/Props/Highground6.mesh + + + + + + + + + + + + + Models/Props/Highground1.mesh + + + + + + + + + + + + Models/Props/Highground2.mesh + + + + + + + + + + + + + Models/Props/Highground3.mesh + + + + + + + + + + + + + Models/Props/Highground4.mesh + + + + + + + + + + + + + Models/Props/Highground5.mesh + + + + + + + + + + + + + + + + + + + + + + 6 + Models/Props/Pillars/SciFiPillar1Blue.mesh + + + + + + + + + + + + + 6 + Models/Props/Pillars/SciFiPillar1Red.mesh + + + + + + + + + + + + + 4 + Models/Props/Pillars/SciFiPillar2Red.mesh + + + + + + + + + + + + + 6 + Models/Props/Pillars/SciFiPillar3Blue.mesh + + + + + + + + + + + + + + 6 + Models/Props/Pillars/SciFiPillar1Blue.mesh + + + + + + + + + + + + + + 4 + Models/Props/Pillars/SciFiPillar1Red.mesh + + + + + + + + + + + + + + 4 + Models/Props/Pillars/SciFiPillar3Red.mesh + + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar2Blue.mesh + + + + + + + + + + + + + 6 + Models/Props/Pillars/SciFiPillar2Red.mesh + + + + + + + + + + + + + 6 + Models/Props/Pillars/SciFiPillar2Blue.mesh + + + + + + + + + + + + + + 6 + Models/Props/Pillars/SciFiPillar2Blue.mesh + + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar2Blue.mesh + + + + + + + + + + + + + + 6 + Models/Props/Pillars/SciFiPillar2Blue.mesh + + + + + + + + + + + + + 4 + Models/Props/Pillars/SciFiPillar2Red.mesh + + + + + + + + + + + + + + 6 + Models/Props/Pillars/SciFiPillar2Red.mesh + + + + + + + + + + + + + 6 + Models/Props/Pillars/SciFiPillar2Red.mesh + + + + + + + + + + + + + + 6 + Models/Props/Pillars/SciFiPillar2Red.mesh + + + + + + + + + + + + + + + + + + + + + + + + + 6 + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 2 + + + + + + + + + + + + + + 5 + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + + 6 + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + + 6 + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + 2 + + + + + + + + + + + + + + 6 + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + 4 + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + + 2 + + + + + + + + + + + + 3 + + + + + + + + + + + + 2 + 1 + + + + + + + + + + + + + + 6 + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + + 6 + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + + + + + + + 8 + + + + Models/Props/PickUps/HealthPickUp.mesh + + + + + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + + + + + + + 8 + + + + Models/Props/PickUps/HealthPickUp.mesh + + + + + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + + + + + + + 8 + + + + Models/Props/PickUps/AmmoPickUp.mesh + + + + + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + + + + + + + 8 + + + + Models/Props/PickUps/AmmoPickUp.mesh + + + + + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + + + + + + + 8 + + + + Models/Props/PickUps/HealthPickUp.mesh + + + + + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + + + + + + + 8 + + + + Models/Props/PickUps/HealthPickUp.mesh + + + + + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + + + + + + + 8 + + + + Models/Props/PickUps/AmmoPickUp.mesh + + + + + + + + + + + + + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridge1Red.mesh + + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridge1Red.mesh + + + + + + + + + + + + Models/Props/Pillars/SciFiBridgePillar1.mesh + + + + + + + + + + + + + + + Models/Props/Pillars/SciFiBridgePillar1.mesh + + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridge1Red.mesh + + + + + + + + + + + + + + + + + + + + + Models/Props/SciFiHolder1.mesh + + + + + + + + + + + + + Models/Props/SciFiHolder1.mesh + + + + + + + + + + + + + + + + + + + + Models/Props/Flora/SpecialRoot.mesh + + + + + + + + + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + + Models/Props/Walls/MediumWall2.mesh + + + + + + + + + + + + + Models/Props/Walls/MediumWall2.mesh + + + + + + + + + + + + + Models/Props/Walls/MediumWall2.mesh + + + + + + + + + + + + + Models/Props/Walls/MediumWall2.mesh + + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + + Models/Core/UnitPlane.mesh + + true + + + + + + + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + + + + + + + + + + 6 + Models/Props/Pillars/SciFiPillar1Red.mesh + + + + + + + + + + + + + + Models/Props/Pillars/StonePillar.mesh + + + + + + + + + + + + + + Models/Props/Pillars/StonePillar.mesh + + + + + + + + + + + + + + Models/Props/Pillars/StonePillar.mesh + + + + + + + + + + + + + + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + + + + + + + 8 + + + + Models/Props/PickUps/HealthPickUp.mesh + + + + + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + + + + + + + 8 + + + + Models/Props/PickUps/AmmoPickUp.mesh + + + + + + + + + + + + + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + + + + + + + + + + 6 + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + + 6 + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + + + + + + + + Models/Props/Walls/SmallWall2.mesh + + + + + + + + + + + + + Models/Props/Walls/SmallWall2.mesh + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 6 + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 2 + + + + + + + + + + + + + + 5 + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + 6 + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + 6 + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + 2 + + + + + + + + + + + + + + 6 + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + 4 + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + 2 + + + + + + + + + + + + 3 + + + + + + + + + + + + 2 + 1 + + + + + + + + + + + + + + 6 + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + 6 + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + + + + + + + 8 + + + + Models/Props/PickUps/HealthPickUp.mesh + + + + + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + + + + + + + 8 + + + + Models/Props/PickUps/HealthPickUp.mesh + + + + + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + + + + + + + 8 + + + + Models/Props/PickUps/AmmoPickUp.mesh + + + + + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + + + + + + + 8 + + + + Models/Props/PickUps/AmmoPickUp.mesh + + + + + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + + + + + + + 8 + + + + Models/Props/PickUps/HealthPickUp.mesh + + + + + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + + + + + + + 8 + + + + Models/Props/PickUps/HealthPickUp.mesh + + + + + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + + + + + + + 8 + + + + Models/Props/PickUps/AmmoPickUp.mesh + + + + + + + + + + + + + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridge1Blue.mesh + + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridge1Blue.mesh + + + + + + + + + + + + Models/Props/Pillars/SciFiBridgePillar1.mesh + + + + + + + + + + + + + + + Models/Props/Pillars/SciFiBridgePillar1.mesh + + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridge1Blue.mesh + + + + + + + + + + + + + + + + + + + + + Models/Props/SciFiHolder1.mesh + + + + + + + + + + + + + Models/Props/SciFiHolder1.mesh + + + + + + + + + + + + + + + + + + + + Models/Props/Flora/SpecialRoot.mesh + + + + + + + + + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + + Models/Props/Walls/MediumWall2.mesh + + + + + + + + + + + + + Models/Props/Walls/MediumWall2.mesh + + + + + + + + + + + + + Models/Props/Walls/MediumWall2.mesh + + + + + + + + + + + + + Models/Props/Walls/MediumWall2.mesh + + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + + Models/Core/UnitPlane.mesh + + true + + + + + + + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + + + + + + + + + + 6 + Models/Props/Pillars/SciFiPillar1Blue.mesh + + + + + + + + + + + + + + Models/Props/Pillars/StonePillar.mesh + + + + + + + + + + + + + + Models/Props/Pillars/StonePillar.mesh + + + + + + + + + + + + + + Models/Props/Pillars/StonePillar.mesh + + + + + + + + + + + + + + + + + + + + + + + Models/Props/CapturePoint/CapturePointBlue.mesh + + + + + + + + + + + + + -15 + 4 + + + Models/Core/UnitCylinder.mesh + + true + + + + + + + + + + + + + + + + + + + + + Models/Props/CapturePoint/CapturePointNeutral.mesh + + + + + + + + + + 3 + + + Models/Core/UnitCylinder.mesh + + true + + + + + + + + + + + + + + + + + Models/Props/CapturePoint/CapturePointNeutral.mesh + + + + + + + + + + 2 + + + Models/Core/UnitCylinder.mesh + + true + + + + + + + + + + + + + + + + + Models/Props/CapturePoint/CapturePointNeutral.mesh + + + + + + + + + + 1 + + + Models/Core/UnitCylinder.mesh + + true + + + + + + + + + + + + + + + + + Models/Props/CapturePoint/CapturePointRed.mesh + + + + + + + + + + + + + 15 + + + Models/Core/UnitCylinder.mesh + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + 10 + + + + + + + + + + + 10 + + + + + + + + + + + 10 + + + + + + + + + + + + 10 + + + + + + + + + + + 1 + false + + + + + + + + + + + + 10 + + + + + + + + + + + + + + Schema/Entities/PlayerRed.xml + + + + + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + + + + + + Schema/Entities/Player.xml + + + + + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + + + + diff --git a/resources/Schema/Entities/Player.xml b/resources/Schema/Entities/Player.xml index 88f153ae..2edbd4a5 100644 --- a/resources/Schema/Entities/Player.xml +++ b/resources/Schema/Entities/Player.xml @@ -13,7 +13,7 @@ - 1.6944730461160304 + 23.911064541134579 @@ -193,7 +193,6 @@ 3 - 0.80222018197612788 @@ -228,6 +227,7 @@ 4 + 1 @@ -283,7 +283,7 @@ Textures/Core/UnitHexagon.png - + @@ -294,7 +294,8 @@ - + 1 + Textures/Core/UnitHexagon_Rotated.png @@ -303,7 +304,7 @@ - + @@ -372,7 +373,7 @@ Idle - 0.67172915251515519 + 0.22110820884665827 1 @@ -386,30 +387,49 @@ + + DefenderWeapon + Schema/Entities/DefenderWeaponView.xml - - DefenderWeapon - + + AssaultWeapon + Schema/Entities/AssaultWeaponView.xml - - AssaultWeapon - + + + + + Models/Widgets/Arrows/Arrow10.mesh + + + + + + + + + + + + + + @@ -430,6 +450,7 @@ Idle + 1.6993789132803556 1 @@ -449,31 +470,31 @@ - - Schema/Entities/DefenderWeaponWorld.xml - - DefenderWeapon + + Schema/Entities/DefenderWeaponWorld.xml + + - - Schema/Entities/AssaultWeaponWorld.xml - - AssaultWeapon + + Schema/Entities/AssaultWeaponWorld.xml + + diff --git a/resources/Schema/Entities/PlayerRed.xml b/resources/Schema/Entities/PlayerRed.xml index 8982f58d..7f81ab05 100644 --- a/resources/Schema/Entities/PlayerRed.xml +++ b/resources/Schema/Entities/PlayerRed.xml @@ -13,7 +13,7 @@ - 326.69883589440087 + 361.81593010381596 @@ -373,7 +373,7 @@ Idle - 0.20909021680133577 + 1.6231050125476969 1 @@ -417,10 +417,11 @@ Models/Weapons/Blue/AssaultWeaponBlue.mesh + - + @@ -445,7 +446,7 @@ Idle - 0.22069183859343156 + 1.8847063959212136 1 diff --git a/src/Game/Systems/CapturePointArrowHUDSystem.cpp b/src/Game/Systems/CapturePointArrowHUDSystem.cpp index ee2254c7..e86a6844 100644 --- a/src/Game/Systems/CapturePointArrowHUDSystem.cpp +++ b/src/Game/Systems/CapturePointArrowHUDSystem.cpp @@ -64,6 +64,9 @@ void CapturePointArrowHUDSystem::Update(double dt) } } //Check what team is the owner of Home1 and set their target to the next capturepoint + if(!home1.Valid() || !home2.Valid()) { + return; + } if((int)home1["CapturePoint"]["HomePointForTeam"] == redTeam) { m_RedTeamCurrentTarget = target1; } else if ((int)home1["CapturePoint"]["HomePointForTeam"] == blueTeam) { @@ -77,10 +80,7 @@ void CapturePointArrowHUDSystem::Update(double dt) m_BlueTeamCurrentTarget = target2; } } - - } - //if red team, get red team next point, otherwise blue team next point. //Untill this is awailable we will just use the hardcoded value in the component. //This will also give us a position, so we wont need to loop through all capturePoints. @@ -132,4 +132,6 @@ bool CapturePointArrowHUDSystem::OnCapturePointCaptured(Events::Captured& e) } else if (e.TeamNumberThatCapturedCapturePoint == blueTeam) { m_BlueTeamCurrentTarget = Transform::AbsolutePosition(e.NextCapturePoint);; } + + m_InitialtargetsSet = true; } From 96768e66de68b699ad802933ec70afefc84581ee Mon Sep 17 00:00:00 2001 From: Tleety Date: Wed, 2 Mar 2016 09:57:41 +0100 Subject: [PATCH 17/51] Redplayer arrow fix --- resources/Schema/Entities/PlayerRed.xml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/resources/Schema/Entities/PlayerRed.xml b/resources/Schema/Entities/PlayerRed.xml index 7f81ab05..fab8e21e 100644 --- a/resources/Schema/Entities/PlayerRed.xml +++ b/resources/Schema/Entities/PlayerRed.xml @@ -13,7 +13,7 @@ - 361.81593010381596 + 384.13256760035051 @@ -373,7 +373,7 @@ Idle - 1.6231050125476969 + 0.75626404186195373 1 @@ -417,11 +417,15 @@ Models/Weapons/Blue/AssaultWeaponBlue.mesh - + + + + + - + @@ -446,7 +450,7 @@ Idle - 1.8847063959212136 + 1.1511986314122282 1 From 4652cd786110419a7d6e42321e7ae3c64483d0cb Mon Sep 17 00:00:00 2001 From: verysecrethero Date: Wed, 2 Mar 2016 11:53:04 +0100 Subject: [PATCH 18/51] Added the already-at-maxammo/health-save-trigger for the PickupSystems --- include/Game/Systems/AmmoPickupSystem.h | 9 ++ include/Game/Systems/PickupSpawnSystem.h | 9 +- src/Game/Systems/AmmoPickupSystem.cpp | 101 ++++++++++++++--------- src/Game/Systems/PickupSpawnSystem.cpp | 70 +++++++++++----- 4 files changed, 129 insertions(+), 60 deletions(-) diff --git a/include/Game/Systems/AmmoPickupSystem.h b/include/Game/Systems/AmmoPickupSystem.h index e4a6df59..7917e765 100644 --- a/include/Game/Systems/AmmoPickupSystem.h +++ b/include/Game/Systems/AmmoPickupSystem.h @@ -20,6 +20,9 @@ public: private: EventRelay m_ETriggerTouch; bool OnTriggerTouch(Events::TriggerTouch& e); + EventRelay m_ETriggerLeave; + bool OnTriggerLeave(Events::TriggerLeave& e); + EventRelay m_EAmmoPickup; bool OnAmmoPickup(Events::AmmoPickup& e); @@ -31,5 +34,11 @@ private: EntityID parentID; }; std::vector m_ETriggerTouchVector; + struct EntityAtMaxValuePickupStruct { + EntityWrapper player; + EntityWrapper trigger; + }; + std::vector m_PickupAtMaximum; + void DoPickup(EntityWrapper &player, EntityWrapper &trigger); }; #endif diff --git a/include/Game/Systems/PickupSpawnSystem.h b/include/Game/Systems/PickupSpawnSystem.h index 66c5f630..be99141c 100644 --- a/include/Game/Systems/PickupSpawnSystem.h +++ b/include/Game/Systems/PickupSpawnSystem.h @@ -9,7 +9,6 @@ #include "Core/EPlayerHealthPickup.h" #include "Engine/Collision/ETrigger.h" #include "Common.h" -#include class PickupSpawnSystem : public ImpureSystem { @@ -21,6 +20,8 @@ public: private: EventRelay m_ETriggerTouch; bool OnTriggerTouch(Events::TriggerTouch& e); + EventRelay m_ETriggerLeave; + bool OnTriggerLeave(Events::TriggerLeave& e); struct NewHealthPickup { glm::vec3 Pos; @@ -30,5 +31,11 @@ private: EntityID parentID; }; std::vector m_ETriggerTouchVector; + struct EntityAtMaxValuePickupStruct { + EntityWrapper player; + EntityWrapper trigger; + }; + std::vector m_PickupAtMaximum; + void DoPickup(EntityWrapper &player, EntityWrapper &trigger); }; #endif diff --git a/src/Game/Systems/AmmoPickupSystem.cpp b/src/Game/Systems/AmmoPickupSystem.cpp index 5927c495..6a24ee95 100644 --- a/src/Game/Systems/AmmoPickupSystem.cpp +++ b/src/Game/Systems/AmmoPickupSystem.cpp @@ -5,6 +5,7 @@ AmmoPickupSystem::AmmoPickupSystem(SystemParams params) { if (IsServer) { EVENT_SUBSCRIBE_MEMBER(m_ETriggerTouch, &AmmoPickupSystem::OnTriggerTouch); + EVENT_SUBSCRIBE_MEMBER(m_ETriggerLeave, &AmmoPickupSystem::OnTriggerLeave); } if (IsClient) { EVENT_SUBSCRIBE_MEMBER(m_EAmmoPickup, &AmmoPickupSystem::OnAmmoPickup); @@ -15,42 +16,47 @@ void AmmoPickupSystem::Update(double dt) { if (IsServer) { for (auto it = m_ETriggerTouchVector.begin(); it != m_ETriggerTouchVector.end(); ++it) { - auto& ammoPickupPosition = *it; - //set the double timer value (value 3) - ammoPickupPosition.DecreaseThisRespawnTimer -= dt; - if (ammoPickupPosition.DecreaseThisRespawnTimer < 0.0) { - //spawn and delete the vector item + auto& somePickup = *it; + somePickup.DecreaseThisRespawnTimer -= dt; + if (somePickup.DecreaseThisRespawnTimer < 0.0) { auto entityFile = ResourceManager::Load("Schema/Entities/AmmoPickup.xml"); EntityFileParser parser(entityFile); EntityID ammoPickupID = parser.MergeEntities(m_World); - //let the world know a pickup has spawned (graphics effects, etc) + //let the world know a pickup has spawned Events::PickupSpawned ePickupSpawned; ePickupSpawned.Pickup = EntityWrapper(m_World, ammoPickupID); m_EventBroker->Publish(ePickupSpawned); - //set values from the old entity to the new entity + //copy values from the old entity to the new entity auto& newAmmoPickupEntity = EntityWrapper(m_World, ammoPickupID); - newAmmoPickupEntity["Transform"]["Position"] = ammoPickupPosition.Pos; - newAmmoPickupEntity["AmmoPickup"]["AmmoGain"] = ammoPickupPosition.AmmoGain; - newAmmoPickupEntity["AmmoPickup"]["RespawnTimer"] = ammoPickupPosition.RespawnTimer; - m_World->SetParent(newAmmoPickupEntity.ID, ammoPickupPosition.parentID); + newAmmoPickupEntity["Transform"]["Position"] = somePickup.Pos; + newAmmoPickupEntity["AmmoPickup"]["AmmoGain"] = somePickup.AmmoGain; + newAmmoPickupEntity["AmmoPickup"]["RespawnTimer"] = somePickup.RespawnTimer; + m_World->SetParent(newAmmoPickupEntity.ID, somePickup.parentID); - //erase the current element (AmmoPickupPosition) + //erase the current element (somePickup) m_ETriggerTouchVector.erase(it); break; } } + //still touching m_PickupAtMaximum? + for (auto& it = m_PickupAtMaximum.begin(); it != m_PickupAtMaximum.end(); ++it) { + if (!it->player.Valid()) { + m_PickupAtMaximum.erase(it); + break; + } + if ((int)it->player["AssaultWeapon"]["Ammo"] < (int)it->player["AssaultWeapon"]["MaxAmmo"]) { + DoPickup(it->player, it->trigger); + m_PickupAtMaximum.erase(it); + break; + } + } } } - bool AmmoPickupSystem::OnTriggerTouch(Events::TriggerTouch& e) { - /*if (e.Entity != LocalPlayer) { - return false; - }*/ - if (!e.Entity.Valid()) { return false; } @@ -61,30 +67,13 @@ bool AmmoPickupSystem::OnTriggerTouch(Events::TriggerTouch& e) if (!e.Trigger.HasComponent("AmmoPickup")) { return false; } - int maxWeaponAmmo = (int)e.Entity["AssaultWeapon"]["MaxAmmo"]; - int& currentAmmo = (int)e.Entity["AssaultWeapon"]["Ammo"]; - int ammoGiven = 0.01*(double)e.Trigger["AmmoPickup"]["AmmoGain"] * maxWeaponAmmo; - //cant pick up ammopacks if you are already at MaxAmmo - if (currentAmmo >= maxWeaponAmmo) { + //if at maxammo, save the trigger-touch to a vector since standing inside it will not re-trigger the trigger + if ((int)e.Entity["AssaultWeapon"]["Ammo"] >= (int)e.Entity["AssaultWeapon"]["MaxAmmo"]) { + m_PickupAtMaximum.push_back({ e.Entity, e.Trigger }); return false; } - - //personEntered = e.Entity, thingEntered = e.Trigger - Events::AmmoPickup ePlayerAmmoPickup; - ePlayerAmmoPickup.AmmoGain = ammoGiven; - ePlayerAmmoPickup.Player = e.Entity; - m_EventBroker->Publish(ePlayerAmmoPickup); - //immediately give the player the ammo - //currentAmmo = std::min(currentAmmo + ammoGiven, maxWeaponAmmo); - - //copy position, ammogain, respawntimer (twice since one of the values will be counted down to 0, the other will be set in the new object) - //we need to copy all values since each value can be different for each ammoPickup - m_ETriggerTouchVector.push_back({ e.Trigger["Transform"]["Position"], e.Trigger["AmmoPickup"]["AmmoGain"], - e.Trigger["AmmoPickup"]["RespawnTimer"], e.Trigger["AmmoPickup"]["RespawnTimer"], m_World->GetParent(e.Trigger.ID) }); - - //delete the ammopickup - m_World->DeleteEntity(e.Trigger.ID); + DoPickup(e.Entity, e.Trigger); return true; } @@ -107,3 +96,39 @@ bool AmmoPickupSystem::OnAmmoPickup(Events::AmmoPickup & e) currentAmmo = std::min(currentAmmo + e.AmmoGain, maxWeaponAmmo); return false; } + +bool AmmoPickupSystem::OnTriggerLeave(Events::TriggerLeave& e) { + if (!e.Trigger.HasComponent("AmmoPickup")) { + return false; + } + //triggerleave erases possible m_PickupAtMaximum + for (auto& it = m_PickupAtMaximum.begin(); it != m_PickupAtMaximum.end(); ++it) { + if (it->trigger.ID == e.Trigger.ID && it->player.ID == e.Entity.ID) { + m_PickupAtMaximum.erase(it); + break; + } + } + return true; +} + +void AmmoPickupSystem::DoPickup(EntityWrapper &player, EntityWrapper &trigger) { + int maxWeaponAmmo = (int)player["AssaultWeapon"]["MaxAmmo"]; + int& currentAmmo = (int)player["AssaultWeapon"]["Ammo"]; + int ammoGiven = 0.01*(double)trigger["AmmoPickup"]["AmmoGain"] * maxWeaponAmmo; + + Events::AmmoPickup ePlayerAmmoPickup; + ePlayerAmmoPickup.AmmoGain = ammoGiven; + ePlayerAmmoPickup.Player = player; + m_EventBroker->Publish(ePlayerAmmoPickup); + + //immediately give the player the ammo (on server) + currentAmmo = std::min(currentAmmo + ammoGiven, maxWeaponAmmo); + + //copy position, ammogain, respawntimer (twice since one of the values will be counted down to 0, the other will be set in the new object) + //we need to copy all values since each value can be different for each ammoPickup + m_ETriggerTouchVector.push_back({ (glm::vec3)trigger["Transform"]["Position"], trigger["AmmoPickup"]["AmmoGain"], + trigger["AmmoPickup"]["RespawnTimer"], trigger["AmmoPickup"]["RespawnTimer"], m_World->GetParent(trigger.ID) }); + + //delete the ammopickup + m_World->DeleteEntity(trigger.ID); +} diff --git a/src/Game/Systems/PickupSpawnSystem.cpp b/src/Game/Systems/PickupSpawnSystem.cpp index 94fee4c6..6bfd2ee6 100644 --- a/src/Game/Systems/PickupSpawnSystem.cpp +++ b/src/Game/Systems/PickupSpawnSystem.cpp @@ -5,6 +5,7 @@ PickupSpawnSystem::PickupSpawnSystem(SystemParams params) { if (IsServer) { EVENT_SUBSCRIBE_MEMBER(m_ETriggerTouch, &PickupSpawnSystem::OnTriggerTouch); + EVENT_SUBSCRIBE_MEMBER(m_ETriggerLeave, &PickupSpawnSystem::OnTriggerLeave); } } @@ -12,11 +13,10 @@ void PickupSpawnSystem::Update(double dt) { if (IsServer) { for (auto it = m_ETriggerTouchVector.begin(); it != m_ETriggerTouchVector.end(); ++it) { - auto& healthPickupPosition = *it; - //set the double timer value (value 3) - healthPickupPosition.DecreaseThisRespawnTimer -= dt; - if (healthPickupPosition.DecreaseThisRespawnTimer < 0) { - //spawn and delete the vector item + auto& somePickup = *it; + somePickup.DecreaseThisRespawnTimer -= dt; + if (somePickup.DecreaseThisRespawnTimer < 0.0) { + //spawn the new healthPickup auto entityFile = ResourceManager::Load("Schema/Entities/HealthPickup.xml"); EntityFileParser parser(entityFile); EntityID healthPickupID = parser.MergeEntities(m_World); @@ -26,45 +26,73 @@ void PickupSpawnSystem::Update(double dt) ePickupSpawned.Pickup = EntityWrapper(m_World, healthPickupID); m_EventBroker->Publish(ePickupSpawned); - //set values from the old entity to the new entity + //copy values from the old entity to the new entity auto& newHealthPickupEntity = EntityWrapper(m_World, healthPickupID); - newHealthPickupEntity["Transform"]["Position"] = healthPickupPosition.Pos; - newHealthPickupEntity["HealthPickup"]["HealthGain"] = healthPickupPosition.HealthGain; - newHealthPickupEntity["HealthPickup"]["RespawnTimer"] = healthPickupPosition.RespawnTimer; - m_World->SetParent(newHealthPickupEntity.ID, healthPickupPosition.parentID); + newHealthPickupEntity["Transform"]["Position"] = somePickup.Pos; + newHealthPickupEntity["HealthPickup"]["HealthGain"] = somePickup.HealthGain; + newHealthPickupEntity["HealthPickup"]["RespawnTimer"] = somePickup.RespawnTimer; + m_World->SetParent(newHealthPickupEntity.ID, somePickup.parentID); - //erase the current element (healthPickupPosition) + //erase the current element (somePickup) m_ETriggerTouchVector.erase(it); break; } } + //still touching PickupAtMaximum? + for (auto& it = m_PickupAtMaximum.begin(); it != m_PickupAtMaximum.end(); ++it) { + if (!it->player.Valid()) { + m_PickupAtMaximum.erase(it); + break; + } + if ((double)it->player["Health"]["Health"] < (double)it->player["Health"]["MaxHealth"]) { + DoPickup(it->player, it->trigger); + m_PickupAtMaximum.erase(it); + break; + } + } } } - - bool PickupSpawnSystem::OnTriggerTouch(Events::TriggerTouch& e) { if (!e.Trigger.HasComponent("HealthPickup")) { return false; } - double healthGiven = 0.01*(double)e.Trigger["HealthPickup"]["HealthGain"] * (double)e.Entity["Health"]["MaxHealth"]; - //cant pick up healthpacks if you are already at MaxHealth + //if at maxhealth, save the trigger-touch to a vector since standing inside it will not re-trigger the trigger if ((double)e.Entity["Health"]["Health"] >= (double)e.Entity["Health"]["MaxHealth"]) { + m_PickupAtMaximum.push_back({ e.Entity, e.Trigger }); return false; } - //personEntered = e.Entity, thingEntered = e.Trigger + DoPickup(e.Entity, e.Trigger); + return true; +} +bool PickupSpawnSystem::OnTriggerLeave(Events::TriggerLeave& e) { + if (!e.Trigger.HasComponent("HealthPickup")) { + return false; + } + //triggerleave erases possible m_PickupAtMaximum + for (auto& it = m_PickupAtMaximum.begin(); it != m_PickupAtMaximum.end(); ++it) { + if (it->trigger.ID == e.Trigger.ID && it->player.ID == e.Entity.ID) { + m_PickupAtMaximum.erase(it); + break; + } + } + return true; +} +void PickupSpawnSystem::DoPickup(EntityWrapper &player, EntityWrapper &trigger) { + double healthGiven = 0.01*(double)trigger["HealthPickup"]["HealthGain"] * (double)player["Health"]["MaxHealth"]; + + //only the server will increase the players hp and set it in the next delta Events::PlayerHealthPickup ePlayerHealthPickup; ePlayerHealthPickup.HealthAmount = healthGiven; - ePlayerHealthPickup.Player = e.Entity; + ePlayerHealthPickup.Player = player; m_EventBroker->Publish(ePlayerHealthPickup); //copy position, healthgain, respawntimer (twice since one of the values will be counted down to 0, the other will be set in the new object) //we need to copy all values since each value can be different for each healthPickup - m_ETriggerTouchVector.push_back({ (glm::vec3)e.Trigger["Transform"]["Position"], e.Trigger["HealthPickup"]["HealthGain"], - e.Trigger["HealthPickup"]["RespawnTimer"], e.Trigger["HealthPickup"]["RespawnTimer"], m_World->GetParent(e.Trigger.ID) }); + m_ETriggerTouchVector.push_back({ (glm::vec3)trigger["Transform"]["Position"] ,trigger["HealthPickup"]["HealthGain"], + trigger["HealthPickup"]["RespawnTimer"],trigger["HealthPickup"]["RespawnTimer"], m_World->GetParent(trigger.ID) }); //delete the healthpickup - m_World->DeleteEntity(e.Trigger.ID); - return true; + m_World->DeleteEntity(trigger.ID); } From 654084839252b7c6c9dd63be197e17252a0f3001 Mon Sep 17 00:00:00 2001 From: Tleety Date: Wed, 2 Mar 2016 11:59:56 +0100 Subject: [PATCH 19/51] WIP --- .../Systems/CapturePointArrowHUDSystem.cpp | 154 ++++++++++++------ src/Game/Systems/CapturePointSystem.cpp | 1 + 2 files changed, 104 insertions(+), 51 deletions(-) diff --git a/src/Game/Systems/CapturePointArrowHUDSystem.cpp b/src/Game/Systems/CapturePointArrowHUDSystem.cpp index e86a6844..3488c0a8 100644 --- a/src/Game/Systems/CapturePointArrowHUDSystem.cpp +++ b/src/Game/Systems/CapturePointArrowHUDSystem.cpp @@ -10,74 +10,134 @@ CapturePointArrowHUDSystem::CapturePointArrowHUDSystem(SystemParams params) void CapturePointArrowHUDSystem::Update(double dt) { - bool LoadCheck = true; + bool loadCheck = true; int redTeam; int blueTeam; int spectatorTeam; //Get list for all CapturePointArrowHUDComponents - auto ArrowHUDs = m_World->GetComponents("CapturePointArrowHUD"); - auto CapturePoints = m_World->GetComponents("CapturePoint"); - if(ArrowHUDs == nullptr) { + auto arrowHUDs = m_World->GetComponents("CapturePointArrowHUD"); + auto capturePoints = m_World->GetComponents("CapturePoint"); + if(arrowHUDs == nullptr) { return; } - for(auto& cArrowHUD : *ArrowHUDs) { + for(auto& cArrowHUD : *arrowHUDs) { //Get what team the current arrow corresponds to - EntityWrapper ArrowEntity = EntityWrapper(m_World, cArrowHUD.EntityID); - if (!ArrowEntity.Valid()) { + EntityWrapper arrowEntity = EntityWrapper(m_World, cArrowHUD.EntityID); + if (!arrowEntity.Valid()) { continue; } - if(!ArrowEntity.HasComponent("Team")) { + if(!arrowEntity.HasComponent("Team")) { continue; } - auto cTeam = ArrowEntity["Team"]; + auto cTeam = arrowEntity["Team"]; int currentTeam = (int)cTeam["Team"]; - if (LoadCheck) { + if (loadCheck) { redTeam = (int)cTeam["Team"].Enum("Red"); blueTeam = (int)cTeam["Team"].Enum("Blue"); spectatorTeam = (int)cTeam["Team"].Enum("Spectator"); - LoadCheck = false; + loadCheck = false; if (!m_InitialtargetsSet) { - glm::vec3 target1, target2; - EntityWrapper home1, home2; + std::unordered_map blueTargets, redTargets; + EntityWrapper homeBlue, homeRed; + int lastCP = -INFINITY; + int firstCP = INFINITY; - for (auto& cCP : *CapturePoints) { + for (auto& cCP : *capturePoints) { auto homePointTeam = (int)cCP["HomePointForTeam"]; - auto CPID = (int)cCP["CapturePointNumber"]; + EntityWrapper capturePointEntity = EntityWrapper(m_World, cCP.EntityID); + int capturePointID = (int)capturePointEntity["CapturePoint"]["CapturePointNumber"]; - if(CPID == 0) { - //Home point for one team - home1 = EntityWrapper(m_World, cCP.EntityID); - } else if (CPID == 1) { - //First target for one team, so save it for later use. - target1 = Transform::AbsolutePosition(EntityWrapper(m_World, cCP.EntityID)); - } else if (CPID == 3) { - //First target for one team, so save it for later use. - target2 = Transform::AbsolutePosition(EntityWrapper(m_World, cCP.EntityID)); - } else if (CPID == 4) { - //Home point for one team - home2 = EntityWrapper(m_World, cCP.EntityID); + if(capturePointID < firstCP) { + firstCP = capturePointID; + } + + if(capturePointID > lastCP) { + lastCP = capturePointID; + } + + if (!capturePointEntity.HasComponent("Team")) { + continue; + } + + int currentOwner = (int)capturePointEntity["Team"]["Team"]; + + if(currentOwner != redTeam) { + //This capturePoint is not owned by the red team and is therefor an eligible target for red team + glm::vec3 targetPos = Transform::AbsolutePosition(capturePointEntity); + redTargets.insert(std::pair(capturePointID, targetPos)); + } + if(currentOwner != blueTeam) { + //This capturePoint is not owned by the blue team and is therefor an eligible target for blue team + glm::vec3 targetPos = Transform::AbsolutePosition(capturePointEntity); + blueTargets.insert(std::pair(capturePointID, targetPos)); + } + + if(homePointTeam == blueTeam) { + //CP is the home point for blue team. + homeBlue = capturePointEntity; + } else if (homePointTeam == redTeam) { + //CP is the home point for red team. + homeRed = capturePointEntity; } } - //Check what team is the owner of Home1 and set their target to the next capturepoint - if(!home1.Valid() || !home2.Valid()) { + + if(!homeRed.Valid() || !homeBlue.Valid()) { + //One or both teams have no home point, cant continue return; } - if((int)home1["CapturePoint"]["HomePointForTeam"] == redTeam) { - m_RedTeamCurrentTarget = target1; - } else if ((int)home1["CapturePoint"]["HomePointForTeam"] == blueTeam) { - m_BlueTeamCurrentTarget = target1; + + std::unordered_map::const_iterator got; + //Find next target for red team. + if((int)homeRed["CapturePoint"]["CapturePointNumber"] == lastCP) { + //Red home base is the last capture point, count back from lastCP and find next target + for (int i = lastCP; i >= firstCP; i--) { + got = redTargets.find(i); + if(got == redTargets.end()) { + continue; + } else { + m_RedTeamCurrentTarget = got->second; + } + } + } else if ((int)homeRed["CapturePoint"]["CapturePointNumber"] == firstCP) { + //Red home is the first capture point, count forward from firstCP and find next target. + for (int i = firstCP; i <= lastCP; i++) { + got = redTargets.find(i); + if(got == redTargets.end()) { + //Target was not found, try the next one after that. + continue; + } else { + m_RedTeamCurrentTarget = got->second; + } + } } - //Check what team is the owner of Home2 and set their target to the next capturepoint - if ((int)home2["CapturePoint"]["HomePointForTeam"] == redTeam) { - m_RedTeamCurrentTarget = target2; - } else if ((int)home2["CapturePoint"]["HomePointForTeam"] == blueTeam) { - m_BlueTeamCurrentTarget = target2; + //Find next target for blue team + if ((int)homeBlue["CapturePoint"]["CapturePointNumber"] == lastCP) { + //Red home base is the last capture point, count back from lastCP and find next target + for (int i = lastCP; i >= firstCP; i--) { + got = blueTargets.find(i); + if (got == blueTargets.end()) { + continue; + } else { + m_BlueTeamCurrentTarget = got->second; + } + } + } else if ((int)homeBlue["CapturePoint"]["CapturePointNumber"] == firstCP) { + //Red home is the first capture point, count forward from firstCP and find next target. + for (int i = firstCP; i <= lastCP; i++) { + got = blueTargets.find(i); + if (got == blueTargets.end()) { + //Target was not found, try the next one after that. + continue; + } else { + m_BlueTeamCurrentTarget = got->second; + } + } } } } @@ -93,14 +153,14 @@ void CapturePointArrowHUDSystem::Update(double dt) pos = currentTeam == redTeam ? m_RedTeamCurrentTarget : currentTeam == blueTeam ? m_BlueTeamCurrentTarget : glm::vec3(0.f); - glm::vec3& arrowOri = ArrowEntity["Transform"]["Orientation"]; - glm::vec3 lookVector = glm::normalize(Transform::AbsolutePosition(ArrowEntity) - pos); //Maybe should be player instead + glm::vec3& arrowOri = arrowEntity["Transform"]["Orientation"]; + glm::vec3 lookVector = glm::normalize(Transform::AbsolutePosition(arrowEntity) - pos); //Maybe should be player instead float pitch = std::asin(-lookVector.y); float yaw = std::atan2(lookVector.x, lookVector.z); arrowOri.x = pitch; arrowOri.y = yaw; arrowOri.z = 0.f; - EntityWrapper parent = ArrowEntity.Parent(); + EntityWrapper parent = arrowEntity.Parent(); if (parent.Valid()) { arrowOri -= Transform::AbsoluteOrientationEuler(parent); } @@ -109,8 +169,7 @@ void CapturePointArrowHUDSystem::Update(double dt) bool CapturePointArrowHUDSystem::OnCapturePointCaptured(Events::Captured& e) { - if (!e.NextCapturePoint.HasComponent("Team")) - { + if (!e.NextCapturePoint.HasComponent("Team")) { return 0; } @@ -119,18 +178,11 @@ bool CapturePointArrowHUDSystem::OnCapturePointCaptured(Events::Captured& e) int redTeam = (int)cTeam["Team"].Enum("Red"); int blueTeam = (int)cTeam["Team"].Enum("Blue"); int spectatorTeam = (int)cTeam["Team"].Enum("Spectator"); - int target = -1; - - if (e.NextCapturePoint.HasComponent("CapturePoint")) { - target = (int)e.NextCapturePoint["CapturePoint"]["CapturePointNumber"]; - } else { - return 0; - } if(e.TeamNumberThatCapturedCapturePoint == redTeam) { m_RedTeamCurrentTarget = Transform::AbsolutePosition(e.NextCapturePoint); } else if (e.TeamNumberThatCapturedCapturePoint == blueTeam) { - m_BlueTeamCurrentTarget = Transform::AbsolutePosition(e.NextCapturePoint);; + m_BlueTeamCurrentTarget = Transform::AbsolutePosition(e.NextCapturePoint); } m_InitialtargetsSet = true; diff --git a/src/Game/Systems/CapturePointSystem.cpp b/src/Game/Systems/CapturePointSystem.cpp index f748ff09..6cbb1b2f 100644 --- a/src/Game/Systems/CapturePointSystem.cpp +++ b/src/Game/Systems/CapturePointSystem.cpp @@ -103,6 +103,7 @@ void CapturePointSystem::UpdateComponent(EntityWrapper& capturePointEntity, Comp } } if (m_RecentlyCapturedNeedNextCapturePointNow) { + //TODO: Next capture point for both teams m_CapturedEvent.NextCapturePoint = m_CapturedEvent.TeamNumberThatCapturedCapturePoint == blueTeam ? m_CapturePointNumberToEntityMap[nextPossibleCapturePoint["Blue"]] : m_CapturePointNumberToEntityMap[nextPossibleCapturePoint["Red"]]; From 6968e71e0706a8adedbf8b135b7d25a6cf056107 Mon Sep 17 00:00:00 2001 From: Tleety Date: Wed, 2 Mar 2016 13:36:24 +0100 Subject: [PATCH 20/51] Arrow should now correctly track the next point no matter when you join the game --- src/Game/Systems/CapturePointArrowHUDSystem.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Game/Systems/CapturePointArrowHUDSystem.cpp b/src/Game/Systems/CapturePointArrowHUDSystem.cpp index 3488c0a8..bf6951a2 100644 --- a/src/Game/Systems/CapturePointArrowHUDSystem.cpp +++ b/src/Game/Systems/CapturePointArrowHUDSystem.cpp @@ -101,6 +101,7 @@ void CapturePointArrowHUDSystem::Update(double dt) continue; } else { m_RedTeamCurrentTarget = got->second; + break; } } } else if ((int)homeRed["CapturePoint"]["CapturePointNumber"] == firstCP) { @@ -112,6 +113,7 @@ void CapturePointArrowHUDSystem::Update(double dt) continue; } else { m_RedTeamCurrentTarget = got->second; + break; } } } @@ -125,6 +127,7 @@ void CapturePointArrowHUDSystem::Update(double dt) continue; } else { m_BlueTeamCurrentTarget = got->second; + break; } } } else if ((int)homeBlue["CapturePoint"]["CapturePointNumber"] == firstCP) { @@ -136,6 +139,7 @@ void CapturePointArrowHUDSystem::Update(double dt) continue; } else { m_BlueTeamCurrentTarget = got->second; + break; } } } @@ -151,7 +155,7 @@ void CapturePointArrowHUDSystem::Update(double dt) pos = m_BlueTeamCurrentTarget; } - pos = currentTeam == redTeam ? m_RedTeamCurrentTarget : currentTeam == blueTeam ? m_BlueTeamCurrentTarget : glm::vec3(0.f); + //pos = currentTeam == redTeam ? m_RedTeamCurrentTarget : currentTeam == blueTeam ? m_BlueTeamCurrentTarget : glm::vec3(0.f); glm::vec3& arrowOri = arrowEntity["Transform"]["Orientation"]; glm::vec3 lookVector = glm::normalize(Transform::AbsolutePosition(arrowEntity) - pos); //Maybe should be player instead From 629ebb871f9f6bb70484f3aa15f1a919b1415242 Mon Sep 17 00:00:00 2001 From: William Moberg Date: Wed, 2 Mar 2016 13:45:49 +0100 Subject: [PATCH 21/51] SpectatorCamera shows capturepoint HUD and respawntimer. It no longer requires CapturePointGameMode component to work. --- include/Engine/Core/World.h | 3 + .../Schema/Entities/NewMapWSpectatorCam.xml | 183 ++++++++++++++++- resources/Schema/Entities/SpectatorCamera.xml | 185 +++++++++++++++++- src/Engine/Core/World.cpp | 18 ++ src/Game/Systems/PlayerDeathSystem.cpp | 14 +- src/Game/Systems/PlayerSpawnSystem.cpp | 51 +++-- 6 files changed, 420 insertions(+), 34 deletions(-) diff --git a/include/Engine/Core/World.h b/include/Engine/Core/World.h index c9f738ce..d8e2c7ba 100644 --- a/include/Engine/Core/World.h +++ b/include/Engine/Core/World.h @@ -6,6 +6,7 @@ #include "ObjectPool.h" #include "ComponentPool.h" #include "EventBroker.h" +struct EntityWrapper; class World { @@ -49,6 +50,8 @@ public: void SetName(EntityID entity, const std::string& name); // Get the textual name of an entity std::string GetName(EntityID entity) const; + // Get the first entity in the world with the name. + EntityWrapper GetFirstEntityByName(const std::string& name); private: EventBroker* m_EventBroker = nullptr; diff --git a/resources/Schema/Entities/NewMapWSpectatorCam.xml b/resources/Schema/Entities/NewMapWSpectatorCam.xml index f74a4857..5e8b6bc2 100644 --- a/resources/Schema/Entities/NewMapWSpectatorCam.xml +++ b/resources/Schema/Entities/NewMapWSpectatorCam.xml @@ -5335,18 +5335,197 @@ Fonts/DroidSans.ttf,64 - + - + + + + + + + + + + + + + Textures/Core/UnitHexagon.png + + + + + + + + + + + + 2 + + + + + + Textures/Core/UnitHexagon_Rotated.png + + + + + + + + + + + + + + + + Textures/Core/UnitHexagon.png + + + + + + + + + + + + 3 + + + + + + Textures/Core/UnitHexagon_Rotated.png + + + + + + + + + + + + + + + + Textures/Core/UnitHexagon.png + + + + + + + + + + + + 4 + + + + + + Textures/Core/UnitHexagon_Rotated.png + + + + + + + + + + + + + + + + Textures/Core/UnitHexagon.png + + + + + + + + + + + + 1 + + + 0.59265931447347009 + + + + Textures/Core/UnitHexagon_Rotated.png + + + + + + + + + + + + + + + + Textures/Core/UnitHexagon.png + + + + + + + + + + + + + + + + Textures/Core/UnitHexagon_Rotated.png + + + + + + + + + + + + + + diff --git a/resources/Schema/Entities/SpectatorCamera.xml b/resources/Schema/Entities/SpectatorCamera.xml index dbfdecf0..5c3dc514 100644 --- a/resources/Schema/Entities/SpectatorCamera.xml +++ b/resources/Schema/Entities/SpectatorCamera.xml @@ -19,20 +19,199 @@ - + Time to respawn: 0 Fonts/DroidSans.ttf,64 - + - + + + + + + + + + + + + + Textures/Core/UnitHexagon.png + + + + + + + + + + + + 2 + + + + + + Textures/Core/UnitHexagon_Rotated.png + + + + + + + + + + + + + + + + Textures/Core/UnitHexagon.png + + + + + + + + + + + + 3 + + + + + + Textures/Core/UnitHexagon_Rotated.png + + + + + + + + + + + + + + + + Textures/Core/UnitHexagon.png + + + + + + + + + + + + 4 + + + + + + Textures/Core/UnitHexagon_Rotated.png + + + + + + + + + + + + + + + + Textures/Core/UnitHexagon.png + + + + + + + + + + + + 1 + + + 0.59265931447347009 + + + + Textures/Core/UnitHexagon_Rotated.png + + + + + + + + + + + + + + + + Textures/Core/UnitHexagon.png + + + + + + + + + + + + + + + + Textures/Core/UnitHexagon_Rotated.png + + + + + + + + + + + + + + diff --git a/src/Engine/Core/World.cpp b/src/Engine/Core/World.cpp index 9b323ff4..65bc60d2 100644 --- a/src/Engine/Core/World.cpp +++ b/src/Engine/Core/World.cpp @@ -1,6 +1,7 @@ #include "Core/World.h" #include "Core/EEntityDeleted.h" #include "Core/EComponentDeleted.h" +#include "Core/EntityWrapper.h" World::~World() { @@ -151,6 +152,23 @@ std::string World::GetName(EntityID entity) const } } +EntityWrapper World::GetFirstEntityByName(const std::string& name) +{ + auto itPair = GetDirectChildren(EntityID_Invalid); + for (auto it = itPair.first; it != itPair.second; it++) { + EntityID childEntityID = it->second; + EntityWrapper childEntity(this, childEntityID); + if (!childEntity.Valid()) { + continue; + } + EntityWrapper entityWithName = childEntity.Name() == name ? childEntity : childEntity.FirstChildByName(name); + if (entityWithName.Valid()) { + return entityWithName; + } + } + return EntityWrapper::Invalid; +} + EntityID World::generateEntityID() { // TODO: Make EntityID generation smarter diff --git a/src/Game/Systems/PlayerDeathSystem.cpp b/src/Game/Systems/PlayerDeathSystem.cpp index f645abe7..0f05da57 100644 --- a/src/Game/Systems/PlayerDeathSystem.cpp +++ b/src/Game/Systems/PlayerDeathSystem.cpp @@ -74,18 +74,14 @@ bool PlayerDeathSystem::OnEntityDeleted(Events::EntityDeleted& e) if (m_LocalPlayerDeathEffect.ID != e.DeletedEntity) { return false; } - // Set the spectator camera as active, if it exists. - auto pool = m_World->GetComponents("CapturePointGameMode"); - if (pool == nullptr || pool->size() == 0) { - return false; - } - ComponentWrapper modeComponent = *pool->begin(); - EntityWrapper theLevel = EntityWrapper(m_LocalPlayerDeathEffect.World, modeComponent.EntityID); - EntityWrapper spectatorCam = theLevel.FirstChildByName("SpectatorCamera"); - if (!spectatorCam.Valid() && spectatorCam.HasComponent("Camera")) { + + // Look for the spectator camera entity in the level. + EntityWrapper spectatorCam = m_World->GetFirstEntityByName("SpectatorCamera"); + if (!spectatorCam.Valid() || !spectatorCam.HasComponent("Camera") || LocalPlayer.Valid()) { return false; } Events::SetCamera eSetCamera; eSetCamera.CameraEntity = spectatorCam; m_EventBroker->Publish(eSetCamera); + return true; } diff --git a/src/Game/Systems/PlayerSpawnSystem.cpp b/src/Game/Systems/PlayerSpawnSystem.cpp index 2f6928af..b2bb1ecf 100644 --- a/src/Game/Systems/PlayerSpawnSystem.cpp +++ b/src/Game/Systems/PlayerSpawnSystem.cpp @@ -27,8 +27,7 @@ void PlayerSpawnSystem::Update(double dt) double& timer = (double&)modeComponent["RespawnTime"]; timer += dt; double maxRespawnTime = m_DbgConfigForceRespawn ? m_ForcedRespawnTime : (double)modeComponent["MaxRespawnTime"]; - EntityWrapper theLevel = EntityWrapper(m_World, modeComponent.EntityID); - EntityWrapper spectatorCam = theLevel.FirstChildByName("SpectatorCamera"); + EntityWrapper spectatorCam = m_World->GetFirstEntityByName("SpectatorCamera"); if (spectatorCam.Valid()) { EntityWrapper HUD = spectatorCam.FirstChildByName("SpectatorHUD"); if (HUD.Valid()) { @@ -66,7 +65,14 @@ void PlayerSpawnSystem::Update(double dt) // If the spawner has a team affiliation, check it if (spawner.HasComponent("Team")) { - if ((int)spawner["Team"]["Team"] != req.Team) { + auto cSpawnerTeam = spawner["Team"]; + if ((int)cSpawnerTeam["Team"] != req.Team) { + // Increase num spawned players if someone picks spectator, since it is valid to pick spectator + // but don't spawn anything, goto next spawnrequest. + if (req.Team == (int)cSpawnerTeam["Team"].Enum("Spectator")) { + ++numSpawnedPlayers; + break; + } continue; } } @@ -87,9 +93,9 @@ void PlayerSpawnSystem::Update(double dt) } } if (numSpawnedPlayers != (int)m_SpawnRequests.size()) { - LOG_DEBUG("%i players were supposed to be spawned, but %i was spawned.", (int)m_SpawnRequests.size(), numSpawnedPlayers); + LOG_DEBUG("%i players were supposed to be spawned or set as spectator, but only %i was handled.", (int)m_SpawnRequests.size(), numSpawnedPlayers); } else { - LOG_DEBUG("%i players were spawned.", numSpawnedPlayers); + LOG_DEBUG("%i players were spawned or set as spectator.", numSpawnedPlayers); } m_SpawnRequests.clear(); } @@ -100,24 +106,29 @@ bool PlayerSpawnSystem::OnInputCommand(Events::InputCommand& e) return false; } + if (e.Value == 0) { + return false; + } + + // A dead client should be able to swap to the spectator camera. + if (IsClient && !LocalPlayer.Valid()) { + // Set the spectator camera as active, if it exists. + // Find the camera. + EntityWrapper spectatorCam = m_World->GetFirstEntityByName("SpectatorCamera"); + if (spectatorCam.Valid() && spectatorCam.HasComponent("Camera")) { + Events::SetCamera eSetCamera; + eSetCamera.CameraEntity = spectatorCam; + m_EventBroker->Publish(eSetCamera); + } + } + // Team picks should be processed ONLY server-side! // Don't make a spawn request if we're the client. if (!IsServer && m_NetworkEnabled) { return false; } - if (e.Value == 0) { - return false; - } - - //TODO: Spectating? - //Right now, return if someone picks spectator. - //1 signifies spectator here, could not get Playerteam component since it may be invalid or without team comp. - if ((ComponentInfo::EnumType)e.Value == 1) { - return false; - } - - //Check if the player already requested spawn. + // Check if the player already requested spawn. auto iter = m_SpawnRequests.begin(); for (; iter != m_SpawnRequests.end(); ++iter) { if (iter->PlayerID == e.PlayerID) { @@ -126,11 +137,11 @@ bool PlayerSpawnSystem::OnInputCommand(Events::InputCommand& e) } if (iter != m_SpawnRequests.end()) { - //If player is in queue to spawn, then change their team affiliation in the request. + // If player is in queue to spawn, then change their team affiliation in the request. iter->Team = (ComponentInfo::EnumType)e.Value; } else if (m_PlayerEntities.count(e.PlayerID) == 0 || !m_PlayerEntities[e.PlayerID].Valid()) { - //If player is not in queue to spawn, then create a spawn request, - //but only if they are spectating and/or just connected. + // If player is not in queue to spawn, then create a spawn request, + // but only if they are spectating and/or just connected. SpawnRequest req; req.PlayerID = e.PlayerID; req.Team = (ComponentInfo::EnumType)e.Value; From ab7fd8954675185fc26ee176bf9ea0102c7b1d06 Mon Sep 17 00:00:00 2001 From: Tleety Date: Wed, 2 Mar 2016 13:56:35 +0100 Subject: [PATCH 22/51] Should now correctly track if another player takes your last capture point --- include/Engine/Core/ECaptured.h | 3 +- .../Schema/Entities/NewMap2version3NEW.xml | 75 +++++++++---------- .../Systems/CapturePointArrowHUDSystem.cpp | 42 ++++------- src/Game/Systems/CapturePointSystem.cpp | 5 +- 4 files changed, 57 insertions(+), 68 deletions(-) diff --git a/include/Engine/Core/ECaptured.h b/include/Engine/Core/ECaptured.h index 48771cd7..047c5d7d 100644 --- a/include/Engine/Core/ECaptured.h +++ b/include/Engine/Core/ECaptured.h @@ -13,7 +13,8 @@ struct Captured : Event { int TeamNumberThatCapturedCapturePoint; EntityID CapturePointTakenID; - EntityWrapper NextCapturePoint; + EntityWrapper BlueTeamNextCapturePoint; + EntityWrapper RedTeamNextCapturePoint; }; } diff --git a/resources/Schema/Entities/NewMap2version3NEW.xml b/resources/Schema/Entities/NewMap2version3NEW.xml index d24675cd..5b224de3 100644 --- a/resources/Schema/Entities/NewMap2version3NEW.xml +++ b/resources/Schema/Entities/NewMap2version3NEW.xml @@ -810,6 +810,7 @@ + 8 @@ -820,9 +821,8 @@ - + - @@ -852,6 +852,7 @@ + 8 @@ -862,9 +863,8 @@ - + - @@ -894,6 +894,7 @@ + 8 @@ -904,9 +905,8 @@ - + - @@ -936,6 +936,7 @@ + 8 @@ -946,9 +947,8 @@ - + - @@ -978,6 +978,7 @@ + 8 @@ -988,9 +989,8 @@ - + - @@ -1020,6 +1020,7 @@ + 8 @@ -1030,9 +1031,8 @@ - + - @@ -1062,6 +1062,7 @@ + 8 @@ -1072,9 +1073,8 @@ - + - @@ -2326,6 +2326,7 @@ + 8 @@ -2336,9 +2337,8 @@ - + - @@ -2368,6 +2368,7 @@ + 8 @@ -2378,9 +2379,8 @@ - + - @@ -2865,6 +2865,7 @@ + 8 @@ -2875,9 +2876,8 @@ - + - @@ -2907,6 +2907,7 @@ + 8 @@ -2917,9 +2918,8 @@ - + - @@ -2949,6 +2949,7 @@ + 8 @@ -2959,9 +2960,8 @@ - + - @@ -2991,6 +2991,7 @@ + 8 @@ -3001,9 +3002,8 @@ - + - @@ -3033,6 +3033,7 @@ + 8 @@ -3043,9 +3044,8 @@ - + - @@ -3075,6 +3075,7 @@ + 8 @@ -3085,9 +3086,8 @@ - + - @@ -3117,6 +3117,7 @@ + 8 @@ -3127,9 +3128,8 @@ - + - @@ -4225,6 +4225,7 @@ -15 4 + Models/Core/UnitCylinder.mesh @@ -4239,7 +4240,6 @@ - @@ -4261,6 +4261,7 @@ 3 + Models/Core/UnitCylinder.mesh @@ -4271,7 +4272,6 @@ - @@ -4293,6 +4293,7 @@ 2 + Models/Core/UnitCylinder.mesh @@ -4303,7 +4304,6 @@ - @@ -4325,6 +4325,7 @@ 1 + Models/Core/UnitCylinder.mesh @@ -4335,7 +4336,6 @@ - @@ -4360,6 +4360,7 @@ 15 + Models/Core/UnitCylinder.mesh @@ -4374,7 +4375,6 @@ - @@ -4445,7 +4445,6 @@ 1 - false diff --git a/src/Game/Systems/CapturePointArrowHUDSystem.cpp b/src/Game/Systems/CapturePointArrowHUDSystem.cpp index bf6951a2..9e327a43 100644 --- a/src/Game/Systems/CapturePointArrowHUDSystem.cpp +++ b/src/Game/Systems/CapturePointArrowHUDSystem.cpp @@ -11,9 +11,9 @@ CapturePointArrowHUDSystem::CapturePointArrowHUDSystem(SystemParams params) void CapturePointArrowHUDSystem::Update(double dt) { bool loadCheck = true; - int redTeam; - int blueTeam; - int spectatorTeam; + int redTeamEnum; + int blueTeamEnum; + int spectatorTeamEnum; //Get list for all CapturePointArrowHUDComponents auto arrowHUDs = m_World->GetComponents("CapturePointArrowHUD"); @@ -35,9 +35,9 @@ void CapturePointArrowHUDSystem::Update(double dt) int currentTeam = (int)cTeam["Team"]; if (loadCheck) { - redTeam = (int)cTeam["Team"].Enum("Red"); - blueTeam = (int)cTeam["Team"].Enum("Blue"); - spectatorTeam = (int)cTeam["Team"].Enum("Spectator"); + redTeamEnum = (int)cTeam["Team"].Enum("Red"); + blueTeamEnum = (int)cTeam["Team"].Enum("Blue"); + spectatorTeamEnum = (int)cTeam["Team"].Enum("Spectator"); loadCheck = false; @@ -66,21 +66,21 @@ void CapturePointArrowHUDSystem::Update(double dt) int currentOwner = (int)capturePointEntity["Team"]["Team"]; - if(currentOwner != redTeam) { + if(currentOwner != redTeamEnum) { //This capturePoint is not owned by the red team and is therefor an eligible target for red team glm::vec3 targetPos = Transform::AbsolutePosition(capturePointEntity); redTargets.insert(std::pair(capturePointID, targetPos)); } - if(currentOwner != blueTeam) { + if(currentOwner != blueTeamEnum) { //This capturePoint is not owned by the blue team and is therefor an eligible target for blue team glm::vec3 targetPos = Transform::AbsolutePosition(capturePointEntity); blueTargets.insert(std::pair(capturePointID, targetPos)); } - if(homePointTeam == blueTeam) { + if(homePointTeam == blueTeamEnum) { //CP is the home point for blue team. homeBlue = capturePointEntity; - } else if (homePointTeam == redTeam) { + } else if (homePointTeam == redTeamEnum) { //CP is the home point for red team. homeRed = capturePointEntity; } @@ -149,14 +149,12 @@ void CapturePointArrowHUDSystem::Update(double dt) //Untill this is awailable we will just use the hardcoded value in the component. //This will also give us a position, so we wont need to loop through all capturePoints. glm::vec3 pos; - if(currentTeam == redTeam) { + if(currentTeam == redTeamEnum) { pos = m_RedTeamCurrentTarget; - } else if (currentTeam == blueTeam) { + } else if (currentTeam == blueTeamEnum) { pos = m_BlueTeamCurrentTarget; } - //pos = currentTeam == redTeam ? m_RedTeamCurrentTarget : currentTeam == blueTeam ? m_BlueTeamCurrentTarget : glm::vec3(0.f); - glm::vec3& arrowOri = arrowEntity["Transform"]["Orientation"]; glm::vec3 lookVector = glm::normalize(Transform::AbsolutePosition(arrowEntity) - pos); //Maybe should be player instead float pitch = std::asin(-lookVector.y); @@ -173,21 +171,13 @@ void CapturePointArrowHUDSystem::Update(double dt) bool CapturePointArrowHUDSystem::OnCapturePointCaptured(Events::Captured& e) { - if (!e.NextCapturePoint.HasComponent("Team")) { + if(!e.BlueTeamNextCapturePoint.Valid() || !e.RedTeamNextCapturePoint.Valid()) { return 0; } - auto cTeam = e.NextCapturePoint["Team"]; - - int redTeam = (int)cTeam["Team"].Enum("Red"); - int blueTeam = (int)cTeam["Team"].Enum("Blue"); - int spectatorTeam = (int)cTeam["Team"].Enum("Spectator"); - - if(e.TeamNumberThatCapturedCapturePoint == redTeam) { - m_RedTeamCurrentTarget = Transform::AbsolutePosition(e.NextCapturePoint); - } else if (e.TeamNumberThatCapturedCapturePoint == blueTeam) { - m_BlueTeamCurrentTarget = Transform::AbsolutePosition(e.NextCapturePoint); - } + m_RedTeamCurrentTarget = Transform::AbsolutePosition(e.RedTeamNextCapturePoint); + m_BlueTeamCurrentTarget = Transform::AbsolutePosition(e.BlueTeamNextCapturePoint); m_InitialtargetsSet = true; + return 0; } diff --git a/src/Game/Systems/CapturePointSystem.cpp b/src/Game/Systems/CapturePointSystem.cpp index 6cbb1b2f..0ff294b9 100644 --- a/src/Game/Systems/CapturePointSystem.cpp +++ b/src/Game/Systems/CapturePointSystem.cpp @@ -104,9 +104,8 @@ void CapturePointSystem::UpdateComponent(EntityWrapper& capturePointEntity, Comp } if (m_RecentlyCapturedNeedNextCapturePointNow) { //TODO: Next capture point for both teams - m_CapturedEvent.NextCapturePoint = m_CapturedEvent.TeamNumberThatCapturedCapturePoint == blueTeam ? - m_CapturePointNumberToEntityMap[nextPossibleCapturePoint["Blue"]] : - m_CapturePointNumberToEntityMap[nextPossibleCapturePoint["Red"]]; + m_CapturedEvent.BlueTeamNextCapturePoint = m_CapturePointNumberToEntityMap[nextPossibleCapturePoint["Blue"]]; + m_CapturedEvent.RedTeamNextCapturePoint = m_CapturePointNumberToEntityMap[nextPossibleCapturePoint["Red"]]; m_EventBroker->Publish(m_CapturedEvent); m_RecentlyCapturedNeedNextCapturePointNow = false; } From 1217b25d023ea78571744d3371dd1b2f5ce8ad1c Mon Sep 17 00:00:00 2001 From: stiffly Date: Wed, 2 Mar 2016 14:15:20 +0100 Subject: [PATCH 23/51] DashEffect will now spawn a player model behind the player that will fade out . --- .../Engine/Input/FirstPersonInputController.h | 5 +++- include/Game/Systems/PlayerMovementSystem.h | 2 ++ resources/Schema/Entities/DashEffect.xml | 18 ++++++++++++++ src/Game/Systems/PlayerMovementSystem.cpp | 24 ++++++++++++++++++- 4 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 resources/Schema/Entities/DashEffect.xml diff --git a/include/Engine/Input/FirstPersonInputController.h b/include/Engine/Input/FirstPersonInputController.h index d86af088..f28e4112 100644 --- a/include/Engine/Input/FirstPersonInputController.h +++ b/include/Engine/Input/FirstPersonInputController.h @@ -51,10 +51,11 @@ protected: bool m_ShiftDashing = false; bool m_ValidDoubleTap = false; - //specialabilitys + //specialabilities bool m_MovementKeyDown = false; bool m_SpecialAbilityKeyDown = false; int m_NumberOfMovementKeysDown = 0; + void spawnDashEffect(); EventRelay m_ELockMouse; bool OnLockMouse(const Events::LockMouse& e); @@ -207,6 +208,8 @@ void FirstPersonInputController::AssaultDashCheck(double dt, bool assaultDashCoolDownTimer = assaultDashCoolDownMaxTimer; m_AssaultDashDoubleTapped = true; m_AssaultDashDoubleTapDeltaTime = 0.f; + Events::DashAbility e; + m_EventBroker->Publish(e); return; } diff --git a/include/Game/Systems/PlayerMovementSystem.h b/include/Game/Systems/PlayerMovementSystem.h index 92aa1915..cdf8ee22 100644 --- a/include/Game/Systems/PlayerMovementSystem.h +++ b/include/Game/Systems/PlayerMovementSystem.h @@ -41,6 +41,8 @@ private: bool OnPlayerSpawned(Events::PlayerSpawned& e); EventRelay m_EDoubleJump; bool PlayerMovementSystem::OnDoubleJump(Events::DoubleJump & e); + EventRelay m_EDashAbility; + bool PlayerMovementSystem::OnDashAbility(Events::DashAbility & e); void updateMovementControllers(double dt); void updateVelocity(EntityWrapper player, double dt); diff --git a/resources/Schema/Entities/DashEffect.xml b/resources/Schema/Entities/DashEffect.xml new file mode 100644 index 00000000..b6bd53f7 --- /dev/null +++ b/resources/Schema/Entities/DashEffect.xml @@ -0,0 +1,18 @@ + + + + + + + 1 + + + + 0 + 1 + + + + + + diff --git a/src/Game/Systems/PlayerMovementSystem.cpp b/src/Game/Systems/PlayerMovementSystem.cpp index 47612ca0..4925baa7 100644 --- a/src/Game/Systems/PlayerMovementSystem.cpp +++ b/src/Game/Systems/PlayerMovementSystem.cpp @@ -5,6 +5,7 @@ PlayerMovementSystem::PlayerMovementSystem(SystemParams params) { EVENT_SUBSCRIBE_MEMBER(m_EPlayerSpawned, &PlayerMovementSystem::OnPlayerSpawned); EVENT_SUBSCRIBE_MEMBER(m_EDoubleJump, &PlayerMovementSystem::OnDoubleJump); + EVENT_SUBSCRIBE_MEMBER(m_EDashAbility, &PlayerMovementSystem::OnDashAbility); } PlayerMovementSystem::~PlayerMovementSystem() @@ -322,4 +323,25 @@ void PlayerMovementSystem::spawnHexagon(EntityWrapper target) EntityID hexagonEffectID = parser.MergeEntities(m_World); EntityWrapper hexagonEW = EntityWrapper(m_World, hexagonEffectID); hexagonEW["Transform"]["Position"] = (glm::vec3)target["Transform"]["Position"]; -} \ No newline at end of file +} + +bool PlayerMovementSystem::OnDashAbility(Events::DashAbility & e) +{ + auto dashEffectResource = ResourceManager::Load("Schema/Entities/DashEffect.xml"); + EntityFileParser parser(dashEffectResource); + EntityID dashEffectID = parser.MergeEntities(m_World); + EntityWrapper dashEffect(m_World, dashEffectID); + auto playerModel = LocalPlayer.FirstChildByName("PlayerModel"); + auto playerEntityModel = playerModel["Model"]; + auto playerEntityAnimation = playerModel["Animation"]; + playerEntityModel.Copy(dashEffect["Model"]); + playerEntityAnimation.Copy(dashEffect["Animation"]); + dashEffect["ExplosionEffect"]["EndColor"] = (glm::vec4)playerEntityModel["Color"]; + ((glm::vec4&)dashEffect["ExplosionEffect"]["EndColor"]).w = 0.f; + dashEffect["Animation"]["Speed1"] = 0.0; + dashEffect["Animation"]["Speed2"] = 0.0; + dashEffect["Animation"]["Speed3"] = 0.0; + dashEffect["Transform"]["Position"] = (glm::vec3)LocalPlayer["Transform"]["Position"]; + dashEffect["Transform"]["Orientation"] = (glm::vec3)LocalPlayer["Transform"]["Orientation"]; + return true; +} From 95078b6a4b8e91ce381eb4b0b22b3d62a835dcce Mon Sep 17 00:00:00 2001 From: William Moberg Date: Wed, 2 Mar 2016 14:37:33 +0100 Subject: [PATCH 24/51] Fix so client doesn't override the servers respawn time with its config file. Server or single player client can still override the component with the config RespawnTime. --- resources/DefaultConfig.ini | 2 +- src/Game/Systems/PlayerSpawnSystem.cpp | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/resources/DefaultConfig.ini b/resources/DefaultConfig.ini index e99e3437..8917e3e1 100644 --- a/resources/DefaultConfig.ini +++ b/resources/DefaultConfig.ini @@ -4,7 +4,7 @@ LoadMap= ; if true -> Pool allocation is not used when calling Allocate/Free, just use regular dynamic allocation. ; if false -> Use pool allocation. DisableMemoryPool=false -RespawnTime = 8.0 +RespawnTime = -1.0 EditorEnabled=false OutOfBodyExperience=false diff --git a/src/Game/Systems/PlayerSpawnSystem.cpp b/src/Game/Systems/PlayerSpawnSystem.cpp index b2bb1ecf..6c41ddd4 100644 --- a/src/Game/Systems/PlayerSpawnSystem.cpp +++ b/src/Game/Systems/PlayerSpawnSystem.cpp @@ -10,7 +10,7 @@ PlayerSpawnSystem::PlayerSpawnSystem(SystemParams params) ConfigFile* config = ResourceManager::Load("Config.ini"); m_NetworkEnabled = config->Get("Networking.StartNetwork", false); m_ForcedRespawnTime = config->Get("Debug.RespawnTime", -1.0f); - m_DbgConfigForceRespawn = m_ForcedRespawnTime > 0; + m_DbgConfigForceRespawn = m_ForcedRespawnTime > 0 && IsServer; } void PlayerSpawnSystem::Update(double dt) @@ -26,7 +26,10 @@ void PlayerSpawnSystem::Update(double dt) // Increase timer. double& timer = (double&)modeComponent["RespawnTime"]; timer += dt; - double maxRespawnTime = m_DbgConfigForceRespawn ? m_ForcedRespawnTime : (double)modeComponent["MaxRespawnTime"]; + if (m_DbgConfigForceRespawn) { + (double&)modeComponent["MaxRespawnTime"] = m_ForcedRespawnTime; + } + double maxRespawnTime = (double)modeComponent["MaxRespawnTime"]; EntityWrapper spectatorCam = m_World->GetFirstEntityByName("SpectatorCamera"); if (spectatorCam.Valid()) { EntityWrapper HUD = spectatorCam.FirstChildByName("SpectatorHUD"); From cdbc348cfae65804caf5c4e5707423e7f23b3400 Mon Sep 17 00:00:00 2001 From: Tleety Date: Wed, 2 Mar 2016 14:46:37 +0100 Subject: [PATCH 25/51] AbilityCooldownHUD should now correctly track cooldown for dash ability. --- .../Schema/Components/AbilityCooldownHUD.xsd | 2 +- resources/Schema/Entities/Player.xml | 39 ++++++++++++++++++- src/Game/Systems/AbilityCooldownHUDSystem.cpp | 8 ++-- 3 files changed, 44 insertions(+), 5 deletions(-) diff --git a/resources/Schema/Components/AbilityCooldownHUD.xsd b/resources/Schema/Components/AbilityCooldownHUD.xsd index 066a9442..5bfb01a8 100644 --- a/resources/Schema/Components/AbilityCooldownHUD.xsd +++ b/resources/Schema/Components/AbilityCooldownHUD.xsd @@ -3,7 +3,7 @@ - HUD element for tracking ability cooldown + HUD element for tracking ability cooldown. If it has a sprite and fill component it will fill the sprite with chosen color depending on the cooldown.\n A child with text component named "Cooldown" \ No newline at end of file diff --git a/resources/Schema/Entities/Player.xml b/resources/Schema/Entities/Player.xml index 28ace561..91b25bcb 100644 --- a/resources/Schema/Entities/Player.xml +++ b/resources/Schema/Entities/Player.xml @@ -12,6 +12,7 @@ + 52.867678870419283 @@ -122,6 +123,7 @@ Textures/HealthHUD3.png + false @@ -132,7 +134,42 @@ - + + + + + + + + + Textures/Core/White.png + false + + + + + + + + + + + + + 0.0 + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + diff --git a/src/Game/Systems/AbilityCooldownHUDSystem.cpp b/src/Game/Systems/AbilityCooldownHUDSystem.cpp index 12d268c7..44180a62 100644 --- a/src/Game/Systems/AbilityCooldownHUDSystem.cpp +++ b/src/Game/Systems/AbilityCooldownHUDSystem.cpp @@ -17,10 +17,12 @@ void AbilityCooldownHUDSystem::Update(double dt) if(cooldownTextEntity.Valid()) { if(cooldownTextEntity.HasComponent("Text")) { - double abilityCD = (double)abilityEntity["DashAbility"]["CoolDownMaxTimer"]; - std::string t = (std::string&)cooldownTextEntity["Text"]["Content"] = std::to_string(abilityCD).substr(0, 3); + double maxAbilityCD = (double)abilityEntity["DashAbility"]["CoolDownMaxTimer"]; + double currentAbilityCD = (double)abilityEntity["DashAbility"]["CoolDownTimer"]; + currentAbilityCD = currentAbilityCD >= 0.0 ? currentAbilityCD : 0.0; + std::string t = (std::string&)cooldownTextEntity["Text"]["Content"] = std::to_string(currentAbilityCD).substr(0, 3); if(entity.HasComponent("Fill")) { - entity["Fill"]["Percentage"] = abilityCD/abilityCD; //TODO: current time needs to be in the component. + entity["Fill"]["Percentage"] = currentAbilityCD/maxAbilityCD; //TODO: current time needs to be in the component. } } } From 9161c11764bf0049e5f6adf27d3a10416c8f6d36 Mon Sep 17 00:00:00 2001 From: Jocke Date: Wed, 2 Mar 2016 15:31:42 +0100 Subject: [PATCH 26/51] Changed m_ETriggerTouchVector for-loop so it wont break when an item triggers the condition. This is done to update all somePickup.DecreaseThisRespawnTimer's. --- src/Game/Systems/AmmoPickupSystem.cpp | 9 ++++++--- src/Game/Systems/PickupSpawnSystem.cpp | 18 +++++++++++------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/src/Game/Systems/AmmoPickupSystem.cpp b/src/Game/Systems/AmmoPickupSystem.cpp index 6a24ee95..74d86f70 100644 --- a/src/Game/Systems/AmmoPickupSystem.cpp +++ b/src/Game/Systems/AmmoPickupSystem.cpp @@ -15,7 +15,8 @@ AmmoPickupSystem::AmmoPickupSystem(SystemParams params) void AmmoPickupSystem::Update(double dt) { if (IsServer) { - for (auto it = m_ETriggerTouchVector.begin(); it != m_ETriggerTouchVector.end(); ++it) { + auto it = m_ETriggerTouchVector.begin(); + while (it != m_ETriggerTouchVector.end()) { auto& somePickup = *it; somePickup.DecreaseThisRespawnTimer -= dt; if (somePickup.DecreaseThisRespawnTimer < 0.0) { @@ -36,8 +37,10 @@ void AmmoPickupSystem::Update(double dt) m_World->SetParent(newAmmoPickupEntity.ID, somePickup.parentID); //erase the current element (somePickup) - m_ETriggerTouchVector.erase(it); - break; + it = m_ETriggerTouchVector.erase(it); + } + else { + it++; } } //still touching m_PickupAtMaximum? diff --git a/src/Game/Systems/PickupSpawnSystem.cpp b/src/Game/Systems/PickupSpawnSystem.cpp index 6bfd2ee6..79e7d66b 100644 --- a/src/Game/Systems/PickupSpawnSystem.cpp +++ b/src/Game/Systems/PickupSpawnSystem.cpp @@ -12,7 +12,8 @@ PickupSpawnSystem::PickupSpawnSystem(SystemParams params) void PickupSpawnSystem::Update(double dt) { if (IsServer) { - for (auto it = m_ETriggerTouchVector.begin(); it != m_ETriggerTouchVector.end(); ++it) { + auto it = m_ETriggerTouchVector.begin(); + while (it != m_ETriggerTouchVector.end()) { auto& somePickup = *it; somePickup.DecreaseThisRespawnTimer -= dt; if (somePickup.DecreaseThisRespawnTimer < 0.0) { @@ -34,8 +35,9 @@ void PickupSpawnSystem::Update(double dt) m_World->SetParent(newHealthPickupEntity.ID, somePickup.parentID); //erase the current element (somePickup) - m_ETriggerTouchVector.erase(it); - break; + it = m_ETriggerTouchVector.erase(it); + } else { + it++; } } //still touching PickupAtMaximum? @@ -66,7 +68,8 @@ bool PickupSpawnSystem::OnTriggerTouch(Events::TriggerTouch& e) DoPickup(e.Entity, e.Trigger); return true; } -bool PickupSpawnSystem::OnTriggerLeave(Events::TriggerLeave& e) { +bool PickupSpawnSystem::OnTriggerLeave(Events::TriggerLeave& e) +{ if (!e.Trigger.HasComponent("HealthPickup")) { return false; } @@ -79,7 +82,8 @@ bool PickupSpawnSystem::OnTriggerLeave(Events::TriggerLeave& e) { } return true; } -void PickupSpawnSystem::DoPickup(EntityWrapper &player, EntityWrapper &trigger) { +void PickupSpawnSystem::DoPickup(EntityWrapper &player, EntityWrapper &trigger) +{ double healthGiven = 0.01*(double)trigger["HealthPickup"]["HealthGain"] * (double)player["Health"]["MaxHealth"]; //only the server will increase the players hp and set it in the next delta @@ -90,8 +94,8 @@ void PickupSpawnSystem::DoPickup(EntityWrapper &player, EntityWrapper &trigger) //copy position, healthgain, respawntimer (twice since one of the values will be counted down to 0, the other will be set in the new object) //we need to copy all values since each value can be different for each healthPickup - m_ETriggerTouchVector.push_back({ (glm::vec3)trigger["Transform"]["Position"] ,trigger["HealthPickup"]["HealthGain"], - trigger["HealthPickup"]["RespawnTimer"],trigger["HealthPickup"]["RespawnTimer"], m_World->GetParent(trigger.ID) }); + m_ETriggerTouchVector.push_back({ (glm::vec3)trigger["Transform"]["Position"], trigger["HealthPickup"]["HealthGain"], + trigger["HealthPickup"]["RespawnTimer"], trigger["HealthPickup"]["RespawnTimer"], m_World->GetParent(trigger.ID) }); //delete the healthpickup m_World->DeleteEntity(trigger.ID); From dc10661e6b8eb1ce0b69fceb5d80b9ced0d8b346 Mon Sep 17 00:00:00 2001 From: William Moberg Date: Wed, 2 Mar 2016 16:45:43 +0100 Subject: [PATCH 27/51] Respawn time now only displays numbers, centered below CPHUD. --- resources/Schema/Entities/NewMapWSpectatorCam.xml | 7 ++----- src/Game/Systems/PlayerSpawnSystem.cpp | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/resources/Schema/Entities/NewMapWSpectatorCam.xml b/resources/Schema/Entities/NewMapWSpectatorCam.xml index 5e8b6bc2..bf1b4c2b 100644 --- a/resources/Schema/Entities/NewMapWSpectatorCam.xml +++ b/resources/Schema/Entities/NewMapWSpectatorCam.xml @@ -3,7 +3,7 @@ - 3.6027407165331624 + 0.0 15 @@ -5336,12 +5336,9 @@ Fonts/DroidSans.ttf,64 - - - - + diff --git a/src/Game/Systems/PlayerSpawnSystem.cpp b/src/Game/Systems/PlayerSpawnSystem.cpp index 6c41ddd4..fbda849d 100644 --- a/src/Game/Systems/PlayerSpawnSystem.cpp +++ b/src/Game/Systems/PlayerSpawnSystem.cpp @@ -37,7 +37,7 @@ void PlayerSpawnSystem::Update(double dt) EntityWrapper respawnTimer = spectatorCam.FirstChildByName("RespawnTimer"); if (respawnTimer.Valid()) { //Update respawn time in the HUD element. - respawnTimer["Text"]["Content"] = "Time to respawn: " + std::to_string(1 + (int)(maxRespawnTime - timer)); + respawnTimer["Text"]["Content"] = std::to_string(1 + (int)(maxRespawnTime - timer)); } } } From 78835f95d8bcb57e1818491ebcf780adb1d29fc0 Mon Sep 17 00:00:00 2001 From: Tleety Date: Wed, 2 Mar 2016 16:47:30 +0100 Subject: [PATCH 28/51] Removed comment --- src/Game/Systems/CapturePointSystem.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Game/Systems/CapturePointSystem.cpp b/src/Game/Systems/CapturePointSystem.cpp index 0ff294b9..0d6089c5 100644 --- a/src/Game/Systems/CapturePointSystem.cpp +++ b/src/Game/Systems/CapturePointSystem.cpp @@ -103,7 +103,6 @@ void CapturePointSystem::UpdateComponent(EntityWrapper& capturePointEntity, Comp } } if (m_RecentlyCapturedNeedNextCapturePointNow) { - //TODO: Next capture point for both teams m_CapturedEvent.BlueTeamNextCapturePoint = m_CapturePointNumberToEntityMap[nextPossibleCapturePoint["Blue"]]; m_CapturedEvent.RedTeamNextCapturePoint = m_CapturePointNumberToEntityMap[nextPossibleCapturePoint["Red"]]; m_EventBroker->Publish(m_CapturedEvent); From a5c086e3899c6b54520408aa860f318470878296 Mon Sep 17 00:00:00 2001 From: stiffly Date: Wed, 2 Mar 2016 16:48:38 +0100 Subject: [PATCH 29/51] Dash effect now working over network, by sending events. Similar to jump effect. --- .../Engine/Input/FirstPersonInputController.h | 14 ++++++-- include/Engine/Network/Client.h | 5 +++ include/Engine/Network/MessageType.h | 1 + include/Engine/Network/Server.h | 1 + include/Game/Events/EDashAbility.h | 6 +++- resources/Schema/Entities/DashEffect.xml | 6 ++-- src/Engine/Network/Client.cpp | 36 +++++++++++++++++-- src/Engine/Network/Server.cpp | 10 +++++- src/Game/Systems/PlayerMovementSystem.cpp | 19 ++++++---- 9 files changed, 81 insertions(+), 17 deletions(-) diff --git a/include/Engine/Input/FirstPersonInputController.h b/include/Engine/Input/FirstPersonInputController.h index f28e4112..efa3c38e 100644 --- a/include/Engine/Input/FirstPersonInputController.h +++ b/include/Engine/Input/FirstPersonInputController.h @@ -27,7 +27,7 @@ public: virtual bool OnCommand(const Events::InputCommand& e) override; virtual void Reset(); - void AssaultDashCheck(double dt, bool isJumping, double assaultDashCoolDownMaxTimer, double& assaultDashCoolDownTimer); + void AssaultDashCheck(double dt, bool isJumping, double assaultDashCoolDownMaxTimer, double& assaultDashCoolDownTimer, EntityWrapper player); virtual bool AssaultDashDoubleTapped() const { return m_AssaultDashDoubleTapped; } virtual bool PlayerIsDashing() const { return m_PlayerIsDashing; } @@ -41,6 +41,7 @@ protected: bool m_Crouching = false; //assault dash membervariables - needed to calculate the doubletap- and dashlogic double m_AssaultDashDoubleTapDeltaTime = 0.0; + double m_DashEffectResetTimer = 0.0; //i will let m_AssaultDashDoubleTapSensitivityTimer stay hardcoded, its not really a gamevariable (more an inputvariable), //and its very unlikely that someone wants to change that value const float m_AssaultDashDoubleTapSensitivityTimer = 0.25f; @@ -191,12 +192,19 @@ bool FirstPersonInputController::OnLockMouse(const Events::LockMou } template -void FirstPersonInputController::AssaultDashCheck(double dt, bool isJumping, double assaultDashCoolDownMaxTimer, double& assaultDashCoolDownTimer) { +void FirstPersonInputController::AssaultDashCheck(double dt, bool isJumping, double assaultDashCoolDownMaxTimer, double& assaultDashCoolDownTimer, EntityWrapper player) { m_AssaultDashDoubleTapDeltaTime += dt; + m_DashEffectResetTimer += dt; assaultDashCoolDownTimer -= dt; //cooldown = assaultDashCoolDownMaxTimer sec, pretend the dash lasts 0.25 sec (for friction to do its work) if (assaultDashCoolDownTimer > (assaultDashCoolDownMaxTimer - 0.25f)) { m_PlayerIsDashing = true; + if (m_DashEffectResetTimer > 0.05) { + Events::DashAbility e; + e.Player = player.ID; + m_EventBroker->Publish(e); + m_DashEffectResetTimer = 0.0; + } } else { m_PlayerIsDashing = false; } @@ -209,6 +217,7 @@ void FirstPersonInputController::AssaultDashCheck(double dt, bool m_AssaultDashDoubleTapped = true; m_AssaultDashDoubleTapDeltaTime = 0.f; Events::DashAbility e; + e.Player = player.ID; m_EventBroker->Publish(e); return; } @@ -240,6 +249,7 @@ void FirstPersonInputController::AssaultDashCheck(double dt, bool assaultDashCoolDownTimer = assaultDashCoolDownMaxTimer; Events::DashAbility e; + e.Player = player.ID; m_EventBroker->Publish(e); } diff --git a/include/Engine/Network/Client.h b/include/Engine/Network/Client.h index c407f7f8..4ee071d2 100644 --- a/include/Engine/Network/Client.h +++ b/include/Engine/Network/Client.h @@ -28,6 +28,7 @@ #include "Core/EPlayerSpawned.h" #include "Core/EAmmoPickup.h" #include "Network/ESearchForServers.h" +#include "../Game/Events/EDashAbility.h" struct ServerInfo { @@ -107,6 +108,7 @@ private: void parsePlayerDamage(Packet& packet); void parseComponentDeletion(Packet& packet); void parseDoubleJump(Packet& packet); + void parseDashEffect(Packet& packet); void parseAmmoPickup(Packet& packet); void InterpolateFields(Packet& packet, const ComponentInfo & componentInfo, const EntityID & entityID, const std::string & componentType); void parseSnapshot(Packet& packet); @@ -135,6 +137,9 @@ private: EventRelay< Client, Events::SearchForServers> m_ESearchForServers; EventRelay m_EDoubleJump; bool OnDoubleJump(Events::DoubleJump & e); + EventRelay m_EDashAbility; + bool OnDashAbility(const Events::DashAbility& e); + bool OnSearchForServers(const Events::SearchForServers& e); UDPClient m_ServerlistRequest; std::vector m_Serverlist; diff --git a/include/Engine/Network/MessageType.h b/include/Engine/Network/MessageType.h index bf773618..c34f584e 100644 --- a/include/Engine/Network/MessageType.h +++ b/include/Engine/Network/MessageType.h @@ -20,6 +20,7 @@ enum class MessageType ComponentDeleted, PlayerTransform, OnDoubleJump, + OnDashEffect, ServerlistRequest, AmmoPickup, Invalid diff --git a/include/Engine/Network/Server.h b/include/Engine/Network/Server.h index 3c956ed9..7bcefc65 100644 --- a/include/Engine/Network/Server.h +++ b/include/Engine/Network/Server.h @@ -83,6 +83,7 @@ private: void parseClientPing(); void parsePing(); bool parseDoubleJump(Packet& packet); + void parseDashEffect(Packet& packet); void parseUDPConnect(Packet& packet); void parseTCPConnect(Packet& packet); void parseDisconnect(); diff --git a/include/Game/Events/EDashAbility.h b/include/Game/Events/EDashAbility.h index 62a2b935..c5078fab 100644 --- a/include/Game/Events/EDashAbility.h +++ b/include/Game/Events/EDashAbility.h @@ -2,11 +2,15 @@ #define Events_DashAbility_h__ #include "Core/Event.h" +#include "Core/EntityWrapper.h" namespace Events { -struct DashAbility : public Event { }; +struct DashAbility : public Event +{ + EntityID Player; +}; } diff --git a/resources/Schema/Entities/DashEffect.xml b/resources/Schema/Entities/DashEffect.xml index b6bd53f7..9dfdc14c 100644 --- a/resources/Schema/Entities/DashEffect.xml +++ b/resources/Schema/Entities/DashEffect.xml @@ -1,15 +1,15 @@ - + - 1 + 0.5 0 - 1 + 0.5 diff --git a/src/Engine/Network/Client.cpp b/src/Engine/Network/Client.cpp index aa87f6ff..d666e550 100644 --- a/src/Engine/Network/Client.cpp +++ b/src/Engine/Network/Client.cpp @@ -33,6 +33,7 @@ void Client::Connect(std::string address, int port) EVENT_SUBSCRIBE_MEMBER(m_EPlayerDamage, &Client::OnPlayerDamage); EVENT_SUBSCRIBE_MEMBER(m_EPlayerSpawned, &Client::OnPlayerSpawned); EVENT_SUBSCRIBE_MEMBER(m_EDoubleJump, &Client::OnDoubleJump); + EVENT_SUBSCRIBE_MEMBER(m_EDashAbility, &Client::OnDashAbility); EVENT_SUBSCRIBE_MEMBER(m_ESearchForServers, &Client::OnSearchForServers); auto config = ResourceManager::Load("Config.ini"); m_Address = address; @@ -143,6 +144,9 @@ void Client::parseMessageType(Packet& packet) case MessageType::OnDoubleJump: parseDoubleJump(packet); break; + case MessageType::OnDashEffect: + parseDashEffect(packet); + break; case MessageType::AmmoPickup: parseAmmoPickup(packet); break; @@ -262,7 +266,7 @@ void Client::parseEntityDeletion(Packet & packet) if (m_ServerIDToClientID.find(entityToDelete) != m_ServerIDToClientID.end()) { EntityID localEntity = m_ServerIDToClientID.at(entityToDelete); if (m_World->ValidEntity(localEntity)) { - if (m_World->HasComponent(localEntity,"Player")) { + if (m_World->HasComponent(localEntity, "Player")) { Events::PlayerDeath e; e.Player = EntityWrapper(m_World, localEntity); m_EventBroker->Publish(e); @@ -297,8 +301,22 @@ void Client::parseDoubleJump(Packet & packet) } } + +void Client::parseDashEffect(Packet& packet) +{ + EntityID serverID = packet.ReadPrimitive(); + if (!serverClientMapsHasEntity(serverID)) { + return; + } + Events::DashAbility e; + e.Player = m_ServerIDToClientID.at(serverID); + if (e.Player != m_LocalPlayer.ID) { + m_EventBroker->Publish(e); + } +} + void Client::parseAmmoPickup(Packet & packet) -{ +{ Events::AmmoPickup e; e.AmmoGain = packet.ReadPrimitive(); e.Player = m_LocalPlayer; @@ -388,7 +406,7 @@ void Client::parseSnapshot(Packet& packet) if (m_SnapshotFilter != nullptr) { shouldApply = m_SnapshotFilter->FilterComponent(localEntity, newComponent); } - if (shouldApply) { + if (shouldApply) { ComponentWrapper currentComponent = m_World->GetComponent(localEntityID, componentType); memcpy(currentComponent.Data, newComponent.Data, componentInfo.Stride); } @@ -518,6 +536,18 @@ bool Client::OnPlayerSpawned(const Events::PlayerSpawned& e) return true; } + +bool Client::OnDashAbility(const Events::DashAbility& e) +{ + if (!clientServerMapsHasEntity(e.Player) || e.Player != m_LocalPlayer.ID) { + return false; + } + Packet packet(MessageType::OnDashEffect); + packet.WritePrimitive(m_ClientIDToServerID.at(e.Player)); + m_Reliable.Send(packet); + return true; +} + bool Client::OnSearchForServers(const Events::SearchForServers& e) { m_SearchingForServers = true; diff --git a/src/Engine/Network/Server.cpp b/src/Engine/Network/Server.cpp index 08b72304..7ba54ec4 100644 --- a/src/Engine/Network/Server.cpp +++ b/src/Engine/Network/Server.cpp @@ -141,6 +141,9 @@ void Server::parseMessageType(Packet& packet) case MessageType::OnDoubleJump: parseDoubleJump(packet); break; + case MessageType::OnDashEffect: + parseDashEffect(packet); + break; default: break; } @@ -555,6 +558,11 @@ bool Server::parseDoubleJump(Packet & packet) return true; } +void Server::parseDashEffect(Packet& packet) +{ + reliableBroadcast(packet); +} + void Server::parseOnInputCommand(Packet& packet) { PlayerID player = -1; @@ -624,7 +632,7 @@ bool Server::shouldSendToClient(EntityWrapper childEntity) } return childEntity.HasComponent("Player") || childEntity.FirstParentWithComponent("Player").Valid() || childEntity.HasComponent("CapturePoint") || childEntity.HasComponent("HealthPickup") - || childEntity.HasComponent("AmmoPickup"); + || childEntity.HasComponent("AmmoPickup")/* || childEntity.Name() == "DashEffect"*/; } PlayerID Server::GetPlayerIDFromEndpoint() diff --git a/src/Game/Systems/PlayerMovementSystem.cpp b/src/Game/Systems/PlayerMovementSystem.cpp index 4925baa7..24bf6b05 100644 --- a/src/Game/Systems/PlayerMovementSystem.cpp +++ b/src/Game/Systems/PlayerMovementSystem.cpp @@ -67,7 +67,7 @@ void PlayerMovementSystem::updateMovementControllers(double dt) ComponentWrapper cPhysics = player["Physics"]; //Assault Dash Check if (player.HasComponent("DashAbility")) { - controller->AssaultDashCheck(dt, ((glm::vec3)cPhysics["Velocity"]).y != 0.0f, player["DashAbility"]["CoolDownMaxTimer"], player["DashAbility"]["CoolDownTimer"]); + controller->AssaultDashCheck(dt, ((glm::vec3)cPhysics["Velocity"]).y != 0.0f, player["DashAbility"]["CoolDownMaxTimer"], player["DashAbility"]["CoolDownTimer"], player); } wishDirection = controller->Movement() * glm::inverse(glm::quat(ori)); //this makes sure you can only dash in the 4 directions: forw,backw,left,right @@ -304,11 +304,11 @@ bool PlayerMovementSystem::OnPlayerSpawned(Events::PlayerSpawned& e) bool PlayerMovementSystem::OnDoubleJump(Events::DoubleJump & e) { // If entity does not exist, exit - if (!EntityWrapper(m_World, e.entityID).Valid()) { + if (!EntityWrapper(m_World, e.entityID).Valid()) { return false; } // If entity IsLocalPlayer, exit - if (e.entityID == m_LocalPlayer.ID) { + if (e.entityID == m_LocalPlayer.ID) { return false; } spawnHexagon(EntityWrapper(m_World, e.entityID)); @@ -316,7 +316,7 @@ bool PlayerMovementSystem::OnDoubleJump(Events::DoubleJump & e) } void PlayerMovementSystem::spawnHexagon(EntityWrapper target) -{ +{ //put a hexagon at the entitys... feet? auto hexagonEffect = ResourceManager::Load("Schema/Entities/DoubleJumpHexagon.xml"); EntityFileParser parser(hexagonEffect); @@ -327,11 +327,16 @@ void PlayerMovementSystem::spawnHexagon(EntityWrapper target) bool PlayerMovementSystem::OnDashAbility(Events::DashAbility & e) { + EntityWrapper player(m_World, e.Player); + if (!player.Valid() || !IsClient) { + return false; + } + auto dashEffectResource = ResourceManager::Load("Schema/Entities/DashEffect.xml"); EntityFileParser parser(dashEffectResource); EntityID dashEffectID = parser.MergeEntities(m_World); EntityWrapper dashEffect(m_World, dashEffectID); - auto playerModel = LocalPlayer.FirstChildByName("PlayerModel"); + auto playerModel = player.FirstChildByName("PlayerModel"); auto playerEntityModel = playerModel["Model"]; auto playerEntityAnimation = playerModel["Animation"]; playerEntityModel.Copy(dashEffect["Model"]); @@ -341,7 +346,7 @@ bool PlayerMovementSystem::OnDashAbility(Events::DashAbility & e) dashEffect["Animation"]["Speed1"] = 0.0; dashEffect["Animation"]["Speed2"] = 0.0; dashEffect["Animation"]["Speed3"] = 0.0; - dashEffect["Transform"]["Position"] = (glm::vec3)LocalPlayer["Transform"]["Position"]; - dashEffect["Transform"]["Orientation"] = (glm::vec3)LocalPlayer["Transform"]["Orientation"]; + dashEffect["Transform"]["Position"] = (glm::vec3)player["Transform"]["Position"]; + dashEffect["Transform"]["Orientation"] = (glm::vec3)player["Transform"]["Orientation"]; return true; } From 233a1d0990f53536065b5842088adaa7f0f6fa08 Mon Sep 17 00:00:00 2001 From: stiffly Date: Wed, 2 Mar 2016 16:56:43 +0100 Subject: [PATCH 30/51] The dash effect is now ignored on the local player, because it was annoying. Copies of yourself could be in your way. --- src/Game/Systems/PlayerMovementSystem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Game/Systems/PlayerMovementSystem.cpp b/src/Game/Systems/PlayerMovementSystem.cpp index 24bf6b05..ae1d1d9b 100644 --- a/src/Game/Systems/PlayerMovementSystem.cpp +++ b/src/Game/Systems/PlayerMovementSystem.cpp @@ -328,7 +328,7 @@ void PlayerMovementSystem::spawnHexagon(EntityWrapper target) bool PlayerMovementSystem::OnDashAbility(Events::DashAbility & e) { EntityWrapper player(m_World, e.Player); - if (!player.Valid() || !IsClient) { + if (!player.Valid() || !IsClient || player.ID == LocalPlayer.ID) { return false; } From 53c520123a7700d7284e5fe13d0bafd50c71102a Mon Sep 17 00:00:00 2001 From: William Moberg Date: Wed, 2 Mar 2016 17:06:53 +0100 Subject: [PATCH 31/51] Uncommented code. --- src/Engine/Editor/EditorSystem.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Engine/Editor/EditorSystem.cpp b/src/Engine/Editor/EditorSystem.cpp index 47547b8f..b0929df9 100644 --- a/src/Engine/Editor/EditorSystem.cpp +++ b/src/Engine/Editor/EditorSystem.cpp @@ -258,17 +258,17 @@ EntityWrapper EditorSystem::importEntity(EntityWrapper parent, boost::filesystem return EntityWrapper::Invalid; } - //try { + try { auto entityFile = ResourceManager::Load(filePath.string()); EntityFilePreprocessor fpp(entityFile); fpp.RegisterComponents(parent.World); EntityFileParser fp(entityFile); EntityID newEntity = fp.MergeEntities(parent.World, parent.ID); return EntityWrapper(parent.World, newEntity); - /*} catch (const std::exception& e) { + } catch (const std::exception& e) { LOG_ERROR("Failed to import entity \"%s\": \"%s\"", filePath.string().c_str(), e.what()); return EntityWrapper::Invalid; - }*/ + } } void EditorSystem::setWidgetMode(EditorGUI::WidgetMode mode) From a9a19193ad18c4be8149c08651988d0bd2ea2dcc Mon Sep 17 00:00:00 2001 From: Tleety Date: Wed, 2 Mar 2016 17:21:15 +0100 Subject: [PATCH 32/51] Component for Boost icons --- resources/Schema/Components.xsd | 1 + resources/Schema/Components/BoostIconsHUD.xml | 2 ++ resources/Schema/Components/BoostIconsHUD.xsd | 10 ++++++++++ resources/Schema/Types/Entity.xsd | 1 + 4 files changed, 14 insertions(+) create mode 100644 resources/Schema/Components/BoostIconsHUD.xml create mode 100644 resources/Schema/Components/BoostIconsHUD.xsd diff --git a/resources/Schema/Components.xsd b/resources/Schema/Components.xsd index a75de84e..f0fb52d3 100644 --- a/resources/Schema/Components.xsd +++ b/resources/Schema/Components.xsd @@ -56,4 +56,5 @@ + \ No newline at end of file diff --git a/resources/Schema/Components/BoostIconsHUD.xml b/resources/Schema/Components/BoostIconsHUD.xml new file mode 100644 index 00000000..e25d9611 --- /dev/null +++ b/resources/Schema/Components/BoostIconsHUD.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/resources/Schema/Components/BoostIconsHUD.xsd b/resources/Schema/Components/BoostIconsHUD.xsd new file mode 100644 index 00000000..c5fe2e5d --- /dev/null +++ b/resources/Schema/Components/BoostIconsHUD.xsd @@ -0,0 +1,10 @@ + + + + + + + Origin for the 3 boost states. Create 3 children with Sprite and Fill components, name them "Sprint", "Defender", "Assault" + + + \ No newline at end of file diff --git a/resources/Schema/Types/Entity.xsd b/resources/Schema/Types/Entity.xsd index 61d8e520..94183c75 100644 --- a/resources/Schema/Types/Entity.xsd +++ b/resources/Schema/Types/Entity.xsd @@ -53,6 +53,7 @@ + From 7d15313209e7ef79893828f22616a8c146fb4a09 Mon Sep 17 00:00:00 2001 From: antc13 Date: Wed, 2 Mar 2016 17:22:44 +0100 Subject: [PATCH 33/51] Added a FloatingEffectSystem to the game. Pickups now move up and down, if so desired. --- include/Game/Systems/FloatingEffectSystem.h | 20 +++ resources/Schema/Components.xsd | 1 + .../Schema/Components/FloatingEffect.xml | 7 + .../Schema/Components/FloatingEffect.xsd | 17 ++ resources/Schema/Entities/NewMap2version2.xml | 98 ++++++------ .../Schema/Entities/NewMap2version3NEW.xml | 148 ++++++++++++++---- src/Game/Game.cpp | 2 + 7 files changed, 210 insertions(+), 83 deletions(-) create mode 100644 include/Game/Systems/FloatingEffectSystem.h create mode 100644 resources/Schema/Components/FloatingEffect.xml create mode 100644 resources/Schema/Components/FloatingEffect.xsd diff --git a/include/Game/Systems/FloatingEffectSystem.h b/include/Game/Systems/FloatingEffectSystem.h new file mode 100644 index 00000000..2462e029 --- /dev/null +++ b/include/Game/Systems/FloatingEffectSystem.h @@ -0,0 +1,20 @@ +#include "Common.h" +#include "Core/System.h" + +class FloatingEffectSystem : public PureSystem +{ +public: + FloatingEffectSystem(SystemParams params) + : System(params) + , PureSystem("FloatingEffect") + { } + + virtual void UpdateComponent(EntityWrapper& entity, ComponentWrapper& component, double dt) override + { + ComponentWrapper& transform = m_World->GetComponent(component.EntityID, "Transform"); + (double&)component["Time"] += dt; + //(double)component["Amplitude"] * glm::sin((glm::two_pi() / (double)component["Period"]) * (double)component["Time"]); + (glm::vec3&)transform["Position"] = (float)(double)component["Amplitude"] * glm::sin((glm::two_pi() / (float)(double)component["Period"]) * (float)(double)component["Time"]) * (glm::vec3)component["Axis"]; + + } +}; \ No newline at end of file diff --git a/resources/Schema/Components.xsd b/resources/Schema/Components.xsd index a75de84e..fccfd3d0 100644 --- a/resources/Schema/Components.xsd +++ b/resources/Schema/Components.xsd @@ -56,4 +56,5 @@ + \ No newline at end of file diff --git a/resources/Schema/Components/FloatingEffect.xml b/resources/Schema/Components/FloatingEffect.xml new file mode 100644 index 00000000..661e4ae4 --- /dev/null +++ b/resources/Schema/Components/FloatingEffect.xml @@ -0,0 +1,7 @@ + + + 1 + 1 + + + \ No newline at end of file diff --git a/resources/Schema/Components/FloatingEffect.xsd b/resources/Schema/Components/FloatingEffect.xsd new file mode 100644 index 00000000..a71006f5 --- /dev/null +++ b/resources/Schema/Components/FloatingEffect.xsd @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/resources/Schema/Entities/NewMap2version2.xml b/resources/Schema/Entities/NewMap2version2.xml index fcb81666..8089073f 100644 --- a/resources/Schema/Entities/NewMap2version2.xml +++ b/resources/Schema/Entities/NewMap2version2.xml @@ -804,11 +804,11 @@ - + 2 - + @@ -825,7 +825,7 @@ - + @@ -851,11 +851,11 @@ - + 2 - + @@ -872,7 +872,7 @@ - + @@ -898,11 +898,11 @@ - + 2 - + @@ -919,7 +919,7 @@ - + @@ -945,11 +945,11 @@ - + 2 - + @@ -966,7 +966,7 @@ - + @@ -992,11 +992,11 @@ - + 2 - + @@ -1013,7 +1013,7 @@ - + @@ -1039,11 +1039,11 @@ - + 2 - + @@ -1060,7 +1060,7 @@ - + @@ -1086,11 +1086,11 @@ - + 2 - + @@ -1107,7 +1107,7 @@ - + @@ -2242,7 +2242,7 @@ Models/Props/Stones/AssaultHolder.mesh - + @@ -2355,11 +2355,11 @@ - + 2 - + @@ -2376,7 +2376,7 @@ - + @@ -2402,11 +2402,11 @@ - + 2 - + @@ -2423,7 +2423,7 @@ - + @@ -2904,11 +2904,11 @@ - + 2 - + @@ -2925,7 +2925,7 @@ - + @@ -2951,11 +2951,11 @@ - + 2 - + @@ -2972,7 +2972,7 @@ - + @@ -2998,11 +2998,11 @@ - + 2 - + @@ -3019,7 +3019,7 @@ - + @@ -3045,11 +3045,11 @@ - + 2 - + @@ -3066,7 +3066,7 @@ - + @@ -3092,11 +3092,11 @@ - + 2 - + @@ -3113,7 +3113,7 @@ - + @@ -3139,11 +3139,11 @@ - + 2 - + @@ -3160,7 +3160,7 @@ - + @@ -3186,11 +3186,11 @@ - + 2 - + @@ -3207,7 +3207,7 @@ - + diff --git a/resources/Schema/Entities/NewMap2version3NEW.xml b/resources/Schema/Entities/NewMap2version3NEW.xml index 5b224de3..61e7b740 100644 --- a/resources/Schema/Entities/NewMap2version3NEW.xml +++ b/resources/Schema/Entities/NewMap2version3NEW.xml @@ -802,8 +802,13 @@ + + + + 2 + - + @@ -821,7 +826,7 @@ - + @@ -844,8 +849,13 @@ + + + + 2 + - + @@ -863,7 +873,7 @@ - + @@ -886,8 +896,13 @@ + + + + 2 + - + @@ -905,7 +920,7 @@ - + @@ -928,8 +943,13 @@ + + + + 2 + - + @@ -947,7 +967,7 @@ - + @@ -970,8 +990,13 @@ + + + + 2 + - + @@ -989,7 +1014,7 @@ - + @@ -1012,8 +1037,13 @@ + + + + 2 + - + @@ -1031,7 +1061,7 @@ - + @@ -1054,8 +1084,13 @@ + + + + 2 + - + @@ -1073,7 +1108,7 @@ - + @@ -2318,8 +2353,13 @@ + + + + 2 + - + @@ -2337,7 +2377,7 @@ - + @@ -2360,8 +2400,13 @@ + + + + 2 + - + @@ -2379,7 +2424,7 @@ - + @@ -2857,8 +2902,13 @@ + + + + 2 + - + @@ -2876,7 +2926,7 @@ - + @@ -2899,8 +2949,13 @@ + + + + 2 + - + @@ -2918,7 +2973,7 @@ - + @@ -2941,8 +2996,13 @@ + + + + 2 + - + @@ -2960,7 +3020,7 @@ - + @@ -2983,8 +3043,13 @@ + + + + 2 + - + @@ -3002,7 +3067,7 @@ - + @@ -3025,8 +3090,13 @@ + + + + 2 + - + @@ -3044,7 +3114,7 @@ - + @@ -3067,8 +3137,13 @@ + + + + 2 + - + @@ -3086,7 +3161,7 @@ - + @@ -3109,8 +3184,13 @@ + + + + 2 + - + @@ -3128,7 +3208,7 @@ - + @@ -4222,7 +4302,7 @@ - -15 + -15 4 @@ -4444,7 +4524,7 @@ - 1 + 0.40000000596046448 diff --git a/src/Game/Game.cpp b/src/Game/Game.cpp index 8c6e653e..b4c1a71d 100644 --- a/src/Game/Game.cpp +++ b/src/Game/Game.cpp @@ -10,6 +10,7 @@ #include "Systems/SpawnerSystem.h" #include "Systems/PlayerSpawnSystem.h" #include "Systems/PlayerDeathSystem.h" +#include "Systems/FloatingEffectSystem.h" #include "Core/EntityFileWriter.h" #include "Game/Systems/CapturePointSystem.h" #include "Game/Systems/CapturePointHUDSystem.h" @@ -120,6 +121,7 @@ Game::Game(int argc, char* argv[]) ++updateOrderLevel; m_SystemPipeline->AddSystem(updateOrderLevel); m_SystemPipeline->AddSystem(updateOrderLevel); + m_SystemPipeline->AddSystem(updateOrderLevel); m_SystemPipeline->AddSystem(updateOrderLevel); m_SystemPipeline->AddSystem(updateOrderLevel); m_SystemPipeline->AddSystem(updateOrderLevel); From 8b66d29adcb75311b27c4c98480f4dcf3145a406 Mon Sep 17 00:00:00 2001 From: Tleety Date: Wed, 2 Mar 2016 17:32:45 +0100 Subject: [PATCH 34/51] Skeleton system for Boost icons --- include/Game/Systems/BoostIconsHUDSystem.h | 17 +++++++++++++++++ src/Game/Game.cpp | 2 ++ src/Game/Systems/BoostIconsHUDSystem.cpp | 6 ++++++ 3 files changed, 25 insertions(+) create mode 100644 include/Game/Systems/BoostIconsHUDSystem.h create mode 100644 src/Game/Systems/BoostIconsHUDSystem.cpp diff --git a/include/Game/Systems/BoostIconsHUDSystem.h b/include/Game/Systems/BoostIconsHUDSystem.h new file mode 100644 index 00000000..fbcdfc16 --- /dev/null +++ b/include/Game/Systems/BoostIconsHUDSystem.h @@ -0,0 +1,17 @@ +#ifndef BoostIconsHUDSystem_h__ +#define BoostIconsHUDSystem_h__ + +#include "../../Engine/Core/System.h" +#include "../../Engine/GLM.h" + +class BoostIconsHUDSystem : public ImpureSystem +{ +public: + BoostIconsHUDSystem(SystemParams params) + : System(params) + { } + + virtual void Update(double dt) override; +}; + +#endif \ No newline at end of file diff --git a/src/Game/Game.cpp b/src/Game/Game.cpp index 8c6e653e..c3f1e439 100644 --- a/src/Game/Game.cpp +++ b/src/Game/Game.cpp @@ -28,6 +28,7 @@ #include "Game/Systems/CapturePointArrowHUDSystem.h" #include "Game/Systems/KillFeedSystem.h" #include "Game/Systems/BoostSystem.h" +#include "Game/Systems/BoostIconsHUDSystem.h" #include "GUI/ButtonSystem.h" #include "GUI/MainMenuSystem.h" @@ -146,6 +147,7 @@ Game::Game(int argc, char* argv[]) m_SystemPipeline->AddSystem(updateOrderLevel); m_SystemPipeline->AddSystem(updateOrderLevel, m_Renderer); m_SystemPipeline->AddSystem(updateOrderLevel, m_Renderer); + m_SystemPipeline->AddSystem(updateOrderLevel); // Populate Octree with collidables ++updateOrderLevel; m_SystemPipeline->AddSystem(updateOrderLevel, m_OctreeCollision, "Collidable"); diff --git a/src/Game/Systems/BoostIconsHUDSystem.cpp b/src/Game/Systems/BoostIconsHUDSystem.cpp new file mode 100644 index 00000000..6d181233 --- /dev/null +++ b/src/Game/Systems/BoostIconsHUDSystem.cpp @@ -0,0 +1,6 @@ +#include "Game/Systems/BoostIconsHUDSystem.h" + +void BoostIconsHUDSystem::Update(double dt) +{ + //Logic here +} From 267c007291997ff11271364d707e5937f4d0945d Mon Sep 17 00:00:00 2001 From: stiffly Date: Wed, 2 Mar 2016 17:39:27 +0100 Subject: [PATCH 35/51] Removed unnecessary comments, variables and functions. --- include/Engine/Input/FirstPersonInputController.h | 11 +++++------ src/Engine/Network/Server.cpp | 2 +- src/Game/Systems/PlayerMovementSystem.cpp | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/include/Engine/Input/FirstPersonInputController.h b/include/Engine/Input/FirstPersonInputController.h index efa3c38e..7ed85c84 100644 --- a/include/Engine/Input/FirstPersonInputController.h +++ b/include/Engine/Input/FirstPersonInputController.h @@ -27,7 +27,7 @@ public: virtual bool OnCommand(const Events::InputCommand& e) override; virtual void Reset(); - void AssaultDashCheck(double dt, bool isJumping, double assaultDashCoolDownMaxTimer, double& assaultDashCoolDownTimer, EntityWrapper player); + void AssaultDashCheck(double dt, bool isJumping, double assaultDashCoolDownMaxTimer, double& assaultDashCoolDownTimer, EntityID playerID); virtual bool AssaultDashDoubleTapped() const { return m_AssaultDashDoubleTapped; } virtual bool PlayerIsDashing() const { return m_PlayerIsDashing; } @@ -56,7 +56,6 @@ protected: bool m_MovementKeyDown = false; bool m_SpecialAbilityKeyDown = false; int m_NumberOfMovementKeysDown = 0; - void spawnDashEffect(); EventRelay m_ELockMouse; bool OnLockMouse(const Events::LockMouse& e); @@ -192,7 +191,7 @@ bool FirstPersonInputController::OnLockMouse(const Events::LockMou } template -void FirstPersonInputController::AssaultDashCheck(double dt, bool isJumping, double assaultDashCoolDownMaxTimer, double& assaultDashCoolDownTimer, EntityWrapper player) { +void FirstPersonInputController::AssaultDashCheck(double dt, bool isJumping, double assaultDashCoolDownMaxTimer, double& assaultDashCoolDownTimer, EntityID playerID) { m_AssaultDashDoubleTapDeltaTime += dt; m_DashEffectResetTimer += dt; assaultDashCoolDownTimer -= dt; @@ -201,7 +200,7 @@ void FirstPersonInputController::AssaultDashCheck(double dt, bool m_PlayerIsDashing = true; if (m_DashEffectResetTimer > 0.05) { Events::DashAbility e; - e.Player = player.ID; + e.Player = playerID; m_EventBroker->Publish(e); m_DashEffectResetTimer = 0.0; } @@ -217,7 +216,7 @@ void FirstPersonInputController::AssaultDashCheck(double dt, bool m_AssaultDashDoubleTapped = true; m_AssaultDashDoubleTapDeltaTime = 0.f; Events::DashAbility e; - e.Player = player.ID; + e.Player = playerID; m_EventBroker->Publish(e); return; } @@ -249,7 +248,7 @@ void FirstPersonInputController::AssaultDashCheck(double dt, bool assaultDashCoolDownTimer = assaultDashCoolDownMaxTimer; Events::DashAbility e; - e.Player = player.ID; + e.Player = playerID; m_EventBroker->Publish(e); } diff --git a/src/Engine/Network/Server.cpp b/src/Engine/Network/Server.cpp index 7ba54ec4..68c00fbe 100644 --- a/src/Engine/Network/Server.cpp +++ b/src/Engine/Network/Server.cpp @@ -632,7 +632,7 @@ bool Server::shouldSendToClient(EntityWrapper childEntity) } return childEntity.HasComponent("Player") || childEntity.FirstParentWithComponent("Player").Valid() || childEntity.HasComponent("CapturePoint") || childEntity.HasComponent("HealthPickup") - || childEntity.HasComponent("AmmoPickup")/* || childEntity.Name() == "DashEffect"*/; + || childEntity.HasComponent("AmmoPickup"); } PlayerID Server::GetPlayerIDFromEndpoint() diff --git a/src/Game/Systems/PlayerMovementSystem.cpp b/src/Game/Systems/PlayerMovementSystem.cpp index 1332ca82..9afc9c8c 100644 --- a/src/Game/Systems/PlayerMovementSystem.cpp +++ b/src/Game/Systems/PlayerMovementSystem.cpp @@ -73,7 +73,7 @@ void PlayerMovementSystem::updateMovementControllers(double dt) ComponentWrapper cPhysics = player["Physics"]; //Assault Dash Check if (player.HasComponent("DashAbility")) { - controller->AssaultDashCheck(dt, ((glm::vec3)cPhysics["Velocity"]).y != 0.0f, player["DashAbility"]["CoolDownMaxTimer"], player["DashAbility"]["CoolDownTimer"], player); + controller->AssaultDashCheck(dt, ((glm::vec3)cPhysics["Velocity"]).y != 0.0f, player["DashAbility"]["CoolDownMaxTimer"], player["DashAbility"]["CoolDownTimer"], player.ID); } wishDirection = controller->Movement() * glm::inverse(glm::quat(ori)); //this makes sure you can only dash in the 4 directions: forw,backw,left,right From e56f203f7cfb8bcfa4018e2696dbcc1e1c0a98e0 Mon Sep 17 00:00:00 2001 From: antc13 Date: Wed, 2 Mar 2016 17:42:11 +0100 Subject: [PATCH 36/51] Removed unnecessary comment & added FloatingEffect to Schema/Types/Entity.xsd --- include/Game/Systems/FloatingEffectSystem.h | 1 - resources/Schema/Types/Entity.xsd | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/include/Game/Systems/FloatingEffectSystem.h b/include/Game/Systems/FloatingEffectSystem.h index 2462e029..56931001 100644 --- a/include/Game/Systems/FloatingEffectSystem.h +++ b/include/Game/Systems/FloatingEffectSystem.h @@ -13,7 +13,6 @@ public: { ComponentWrapper& transform = m_World->GetComponent(component.EntityID, "Transform"); (double&)component["Time"] += dt; - //(double)component["Amplitude"] * glm::sin((glm::two_pi() / (double)component["Period"]) * (double)component["Time"]); (glm::vec3&)transform["Position"] = (float)(double)component["Amplitude"] * glm::sin((glm::two_pi() / (float)(double)component["Period"]) * (float)(double)component["Time"]) * (glm::vec3)component["Axis"]; } diff --git a/resources/Schema/Types/Entity.xsd b/resources/Schema/Types/Entity.xsd index 61d8e520..e2ab39e5 100644 --- a/resources/Schema/Types/Entity.xsd +++ b/resources/Schema/Types/Entity.xsd @@ -53,6 +53,7 @@ + From 3094dd301bd4415b97892574ef3e4da1fd70f124 Mon Sep 17 00:00:00 2001 From: antc13 Date: Wed, 2 Mar 2016 17:47:22 +0100 Subject: [PATCH 37/51] Added a default value to Position in FloatingEffect.xml --- resources/Schema/Components/FloatingEffect.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/Schema/Components/FloatingEffect.xml b/resources/Schema/Components/FloatingEffect.xml index 661e4ae4..f1fd237a 100644 --- a/resources/Schema/Components/FloatingEffect.xml +++ b/resources/Schema/Components/FloatingEffect.xml @@ -4,4 +4,5 @@ 1 + \ No newline at end of file From 7af17049e9489a0df32418da8dfe994c75c862dc Mon Sep 17 00:00:00 2001 From: Tleety Date: Wed, 2 Mar 2016 18:13:09 +0100 Subject: [PATCH 38/51] BoostIcons should now track correctly --- include/Game/Systems/BoostIconsHUDSystem.h | 6 ++-- src/Game/Systems/BoostIconsHUDSystem.cpp | 40 ++++++++++++++++++++-- 2 files changed, 42 insertions(+), 4 deletions(-) diff --git a/include/Game/Systems/BoostIconsHUDSystem.h b/include/Game/Systems/BoostIconsHUDSystem.h index fbcdfc16..d8de777d 100644 --- a/include/Game/Systems/BoostIconsHUDSystem.h +++ b/include/Game/Systems/BoostIconsHUDSystem.h @@ -4,14 +4,16 @@ #include "../../Engine/Core/System.h" #include "../../Engine/GLM.h" -class BoostIconsHUDSystem : public ImpureSystem +class BoostIconsHUDSystem : public PureSystem { public: BoostIconsHUDSystem(SystemParams params) : System(params) + , PureSystem("BoostIconsHUD") { } - virtual void Update(double dt) override; + virtual void UpdateComponent(EntityWrapper& entity, ComponentWrapper& capturePoint, double dt) override; + }; #endif \ No newline at end of file diff --git a/src/Game/Systems/BoostIconsHUDSystem.cpp b/src/Game/Systems/BoostIconsHUDSystem.cpp index 6d181233..f83278ff 100644 --- a/src/Game/Systems/BoostIconsHUDSystem.cpp +++ b/src/Game/Systems/BoostIconsHUDSystem.cpp @@ -1,6 +1,42 @@ #include "Game/Systems/BoostIconsHUDSystem.h" -void BoostIconsHUDSystem::Update(double dt) +void BoostIconsHUDSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapper& capturePoint, double dt) { - //Logic here + EntityWrapper assaultEntity = entity.FirstChildByName("Assault"); + EntityWrapper defenderEntity = entity.FirstChildByName("Defender"); + EntityWrapper sniperEntity = entity.FirstChildByName("Sniper"); + + if(assaultEntity.Valid()) { + if (assaultEntity.HasComponent("Fill")) { + EntityWrapper parentWithAssaultBoost = assaultEntity.FirstParentWithComponent("BoostAssault"); + if (parentWithAssaultBoost.Valid()) { + (double&)assaultEntity["Fill"]["Percentage"] = 1.0; + } else { + (double&)assaultEntity["Fill"]["Percentage"] = 0.0; + } + } + } + + if (defenderEntity.Valid()) { + if (defenderEntity.HasComponent("Fill")) { + EntityWrapper parentWithAssaultBoost = defenderEntity.FirstParentWithComponent("BoostDefender"); + if (parentWithAssaultBoost.Valid()) { + (double&)defenderEntity["Fill"]["Percentage"] = 1.0; + } else { + (double&)defenderEntity["Fill"]["Percentage"] = 0.0; + } + } + } + + if (sniperEntity.Valid()) { + if (sniperEntity.HasComponent("Fill")) { + EntityWrapper parentWithAssaultBoost = sniperEntity.FirstParentWithComponent("BoostSniper"); + if (parentWithAssaultBoost.Valid()) { + (double&)sniperEntity["Fill"]["Percentage"] = 1.0; + } else { + (double&)sniperEntity["Fill"]["Percentage"] = 0.0; + } + } + } } + From 62c8196ad4395bce57e7071e22230552359882d6 Mon Sep 17 00:00:00 2001 From: sippeangelo Date: Wed, 2 Mar 2016 18:38:49 +0100 Subject: [PATCH 39/51] Created World::Merge which will merge a world into another one --- include/Engine/Core/World.h | 8 ++++++-- src/Engine/Core/World.cpp | 39 ++++++++++++++++++++++++++++++++++++- 2 files changed, 44 insertions(+), 3 deletions(-) diff --git a/include/Engine/Core/World.h b/include/Engine/Core/World.h index d8e2c7ba..28c96303 100644 --- a/include/Engine/Core/World.h +++ b/include/Engine/Core/World.h @@ -19,13 +19,13 @@ public: World(const World& other); // Create empty entity - EntityID CreateEntity(EntityID parent = 0); + EntityID CreateEntity(EntityID parent = EntityID_Invalid); // Delete entity and all components within void DeleteEntity(EntityID entity); // Check if an entity exists bool ValidEntity(EntityID entity) const; // Register a component type and allocate space for it - void RegisterComponent(ComponentInfo& ci); + void RegisterComponent(const ComponentInfo& ci); // Attach a component to an entity and fill it with default values ComponentWrapper AttachComponent(EntityID entity, const std::string& componentType); // Check if an entity has a component @@ -53,6 +53,10 @@ public: // Get the first entity in the world with the name. EntityWrapper GetFirstEntityByName(const std::string& name); + // Merge another world into this one + // Returns a map that maps entities from the other world to their copies in this one + std::unordered_map Merge(World& other); + private: EventBroker* m_EventBroker = nullptr; EntityID m_CurrentEntityID = 0; diff --git a/src/Engine/Core/World.cpp b/src/Engine/Core/World.cpp index 65bc60d2..96c4660d 100644 --- a/src/Engine/Core/World.cpp +++ b/src/Engine/Core/World.cpp @@ -45,7 +45,7 @@ bool World::ValidEntity(EntityID entity) const return m_EntityParents.find(entity) != m_EntityParents.end(); } -void World::RegisterComponent(ComponentInfo& ci) +void World::RegisterComponent(const ComponentInfo& ci) { if (m_ComponentPools.find(ci.Name) == m_ComponentPools.end()) { m_ComponentPools[ci.Name] = new ComponentPool(ci); @@ -169,6 +169,43 @@ EntityWrapper World::GetFirstEntityByName(const std::string& name) return EntityWrapper::Invalid; } +std::unordered_map World::Merge(World& other) +{ + std::unordered_map oldToNew; + + // Create new entities + for (auto& kv : other.m_EntityParents) { + EntityID entity = kv.first; + + EntityID newEntity = CreateEntity(); + SetName(newEntity, other.GetName(entity)); + oldToNew[entity] = newEntity; + } + // Fix relationships + for (auto& kv : other.m_EntityParents) { + EntityID entity = kv.first; + EntityID parent = kv.second; + SetParent(oldToNew.at(entity), oldToNew.at(parent)); + } + + // Transfer components + for (auto& kv : other.m_ComponentPools) { + auto& componentType = kv.first; + ComponentPool* pool = kv.second; + // Register pool if it's not present in world + if (m_ComponentPools.count(componentType) == 0) { + RegisterComponent(pool->ComponentInfo()); + } + // Copy components + for (auto component : *pool) { + ComponentWrapper newComponent = AttachComponent(oldToNew.at(component.EntityID), componentType); + component.Copy(newComponent); + } + } + + return oldToNew; +} + EntityID World::generateEntityID() { // TODO: Make EntityID generation smarter From 26d6546d795b0a840b06e1c423180205a4e942e0 Mon Sep 17 00:00:00 2001 From: sippeangelo Date: Wed, 2 Mar 2016 18:42:11 +0100 Subject: [PATCH 40/51] Renamed EntityFile to EntityXMLFile to be able to separate file parsing from entity creation --- .../Core/{EntityFile.h => EntityXMLFile.h} | 6 ++--- ...tityFileParser.h => EntityXMLFileParser.h} | 8 +++--- ...rocessor.h => EntityXMLFilePreprocessor.h} | 8 +++--- ...tityFileWriter.h => EntityXMLFileWriter.h} | 6 ++--- include/Engine/Editor/EditorSystem.h | 6 ++--- include/Game/Game.h | 6 ++--- include/Game/Systems/AmmoPickupSystem.h | 2 +- include/Game/Systems/BoostSystem.h | 2 +- include/Game/Systems/DamageIndicatorSystem.h | 2 +- include/Game/Systems/PickupSpawnSystem.h | 2 +- include/Game/Systems/PlayerDeathSystem.h | 4 +-- include/Game/Systems/PlayerMovementSystem.h | 4 +-- include/Game/Systems/SpawnerSystem.h | 2 +- include/Game/Systems/Weapon/WeaponSystem.h | 4 +-- .../{EntityFile.cpp => EntityXMLFile.cpp} | 18 ++++++------- ...FileParser.cpp => EntityXMLFileParser.cpp} | 26 +++++++++---------- ...ssor.cpp => EntityXMLFilePreprocessor.cpp} | 24 ++++++++--------- ...FileWriter.cpp => EntityXMLFileWriter.cpp} | 10 +++---- src/Engine/Editor/EditorSystem.cpp | 8 +++--- src/Game/Game.cpp | 10 +++---- src/Game/Systems/AmmoPickupSystem.cpp | 4 +-- src/Game/Systems/BoostSystem.cpp | 4 +-- src/Game/Systems/DamageIndicatorSystem.cpp | 10 +++---- src/Game/Systems/PickupSpawnSystem.cpp | 4 +-- src/Game/Systems/PlayerDeathSystem.cpp | 4 +-- src/Game/Systems/PlayerMovementSystem.cpp | 8 +++--- src/Game/Systems/SpawnerSystem.cpp | 4 +-- src/Tests/CapturePointTest.cpp | 10 +++---- src/Tests/CapturePointTest.h | 8 +++--- src/Tests/HealthSystemTest.cpp | 8 +++--- src/Tests/HealthSystemTest.h | 2 +- src/Tests/PickupSpawnTest.cpp | 8 +++--- src/Tests/PickupSpawnTest.h | 10 +++---- 33 files changed, 121 insertions(+), 121 deletions(-) rename include/Engine/Core/{EntityFile.h => EntityXMLFile.h} (98%) rename include/Engine/Core/{EntityFileParser.h => EntityXMLFileParser.h} (86%) rename include/Engine/Core/{EntityFilePreprocessor.h => EntityXMLFilePreprocessor.h} (87%) rename include/Engine/Core/{EntityFileWriter.h => EntityXMLFileWriter.h} (92%) rename src/Engine/Core/{EntityFile.cpp => EntityXMLFile.cpp} (94%) rename src/Engine/Core/{EntityFileParser.cpp => EntityXMLFileParser.cpp} (59%) rename src/Engine/Core/{EntityFilePreprocessor.cpp => EntityXMLFilePreprocessor.cpp} (93%) rename src/Engine/Core/{EntityFileWriter.cpp => EntityXMLFileWriter.cpp} (94%) diff --git a/include/Engine/Core/EntityFile.h b/include/Engine/Core/EntityXMLFile.h similarity index 98% rename from include/Engine/Core/EntityFile.h rename to include/Engine/Core/EntityXMLFile.h index 538e9047..6dcc74c5 100644 --- a/include/Engine/Core/EntityFile.h +++ b/include/Engine/Core/EntityXMLFile.h @@ -134,13 +134,13 @@ private: } }; -class EntityFile : public Resource +class EntityXMLFile : public Resource { friend class ResourceManager; friend class EntityFileSAXHandler; private: - EntityFile(boost::filesystem::path path); - ~EntityFile(); + EntityXMLFile(boost::filesystem::path path); + ~EntityXMLFile(); public: static unsigned int GetTypeStride(std::string typeName); diff --git a/include/Engine/Core/EntityFileParser.h b/include/Engine/Core/EntityXMLFileParser.h similarity index 86% rename from include/Engine/Core/EntityFileParser.h rename to include/Engine/Core/EntityXMLFileParser.h index b4eee5b2..c058640f 100644 --- a/include/Engine/Core/EntityFileParser.h +++ b/include/Engine/Core/EntityXMLFileParser.h @@ -1,18 +1,18 @@ #ifndef EntityFileParser_h__ #define EntityFileParser_h__ -#include "EntityFile.h" +#include "EntityXMLFile.h" #include "World.h" -class EntityFileParser +class EntityXMLFileParser { public: - EntityFileParser(const EntityFile* entityFile); + EntityXMLFileParser(const EntityXMLFile* entityFile); EntityID MergeEntities(World* world, EntityID baseParent = EntityID_Invalid); private: - const EntityFile* m_EntityFile; + const EntityXMLFile* m_EntityFile; EntityFileHandler m_Handler; World* m_World = nullptr; EntityID m_FirstEntity = EntityID_Invalid; diff --git a/include/Engine/Core/EntityFilePreprocessor.h b/include/Engine/Core/EntityXMLFilePreprocessor.h similarity index 87% rename from include/Engine/Core/EntityFilePreprocessor.h rename to include/Engine/Core/EntityXMLFilePreprocessor.h index b46bd383..45880835 100644 --- a/include/Engine/Core/EntityFilePreprocessor.h +++ b/include/Engine/Core/EntityXMLFilePreprocessor.h @@ -17,17 +17,17 @@ #include "Util/XercesString.h" #include "ResourceManager.h" #include "World.h" -#include "EntityFile.h" +#include "EntityXMLFile.h" -class EntityFilePreprocessor +class EntityXMLFilePreprocessor { public: - EntityFilePreprocessor(const EntityFile* entityFile); + EntityXMLFilePreprocessor(const EntityXMLFile* entityFile); void RegisterComponents(World* world); private: - const EntityFile* m_EntityFile; + const EntityXMLFile* m_EntityFile; std::map m_ComponentCounts; std::map m_ComponentInfo; diff --git a/include/Engine/Core/EntityFileWriter.h b/include/Engine/Core/EntityXMLFileWriter.h similarity index 92% rename from include/Engine/Core/EntityFileWriter.h rename to include/Engine/Core/EntityXMLFileWriter.h index b75bc145..9b100670 100644 --- a/include/Engine/Core/EntityFileWriter.h +++ b/include/Engine/Core/EntityXMLFileWriter.h @@ -8,13 +8,13 @@ #include #include "Util/XercesString.h" -#include "EntityFile.h" +#include "EntityXMLFile.h" #include "World.h" -class EntityFileWriter +class EntityXMLFileWriter { public: - EntityFileWriter(boost::filesystem::path file) + EntityXMLFileWriter(boost::filesystem::path file) : m_FilePath(file) { using namespace xercesc; diff --git a/include/Engine/Editor/EditorSystem.h b/include/Engine/Editor/EditorSystem.h index 06ee53b6..b565367a 100644 --- a/include/Engine/Editor/EditorSystem.h +++ b/include/Engine/Editor/EditorSystem.h @@ -5,9 +5,9 @@ #include "../Core/World.h" #include "../Core/SystemPipeline.h" #include "../Core/ResourceManager.h" -#include "../Core/EntityFilePreprocessor.h" -#include "../Core/EntityFileParser.h" -#include "../Core/EntityFileWriter.h" +#include "../Core/EntityXMLFilePreprocessor.h" +#include "../Core/EntityXMLFileParser.h" +#include "../Core/EntityXMLFileWriter.h" #include "../Core/EMousePress.h" #include "../Input/EInputCommand.h" #include "EditorGUI.h" diff --git a/include/Game/Game.h b/include/Game/Game.h index 06fd4703..4d173b48 100644 --- a/include/Game/Game.h +++ b/include/Game/Game.h @@ -13,13 +13,13 @@ #include "Input/KeyboardInputHandler.h" #include "Input/MouseInputHandler.h" #include "Core/EKeyDown.h" -#include "Core/EntityFilePreprocessor.h" +#include "Core/EntityXMLFilePreprocessor.h" #include "Core/SystemPipeline.h" #include "Systems/ExplosionEffectSystem.h" #include "Editor/EditorSystem.h" -#include "Core/EntityFile.h" +#include "Core/EntityXMLFile.h" #include "Rendering/RenderSystem.h" -#include "Core/EntityFileParser.h" +#include "Core/EntityXMLFileParser.h" #include "Core/Octree.h" #include "Rendering/Font.h" #include "Systems/InterpolationSystem.h" diff --git a/include/Game/Systems/AmmoPickupSystem.h b/include/Game/Systems/AmmoPickupSystem.h index 7917e765..8e5c4f1d 100644 --- a/include/Game/Systems/AmmoPickupSystem.h +++ b/include/Game/Systems/AmmoPickupSystem.h @@ -4,7 +4,7 @@ #include "Core/System.h" #include "Core/Transform.h" #include "Core/ResourceManager.h" -#include "Core/EntityFileParser.h" +#include "Core/EntityXMLFileParser.h" #include "Core/EPickupSpawned.h" #include "Core/EAmmoPickup.h" #include "Engine/Collision/ETrigger.h" diff --git a/include/Game/Systems/BoostSystem.h b/include/Game/Systems/BoostSystem.h index f82707ab..525918a4 100644 --- a/include/Game/Systems/BoostSystem.h +++ b/include/Game/Systems/BoostSystem.h @@ -3,7 +3,7 @@ #include "Core/System.h" #include "Core/ResourceManager.h" -#include "Core/EntityFileParser.h" +#include "Core/EntityXMLFileParser.h" #include "Core/EPlayerDamage.h" #include "Common.h" diff --git a/include/Game/Systems/DamageIndicatorSystem.h b/include/Game/Systems/DamageIndicatorSystem.h index ae9ba195..935089fa 100644 --- a/include/Game/Systems/DamageIndicatorSystem.h +++ b/include/Game/Systems/DamageIndicatorSystem.h @@ -4,7 +4,7 @@ #include "Core/System.h" #include "Core/Transform.h" #include "Core/ResourceManager.h" -#include "Core/EntityFileParser.h" +#include "Core/EntityXMLFileParser.h" #include "Core/EPlayerDamage.h" #include "Common.h" #include diff --git a/include/Game/Systems/PickupSpawnSystem.h b/include/Game/Systems/PickupSpawnSystem.h index be99141c..1151b487 100644 --- a/include/Game/Systems/PickupSpawnSystem.h +++ b/include/Game/Systems/PickupSpawnSystem.h @@ -4,7 +4,7 @@ #include "Core/System.h" #include "Core/Transform.h" #include "Core/ResourceManager.h" -#include "Core/EntityFileParser.h" +#include "Core/EntityXMLFileParser.h" #include "Core/EPickupSpawned.h" #include "Core/EPlayerHealthPickup.h" #include "Engine/Collision/ETrigger.h" diff --git a/include/Game/Systems/PlayerDeathSystem.h b/include/Game/Systems/PlayerDeathSystem.h index f32e32df..96ed2ab5 100644 --- a/include/Game/Systems/PlayerDeathSystem.h +++ b/include/Game/Systems/PlayerDeathSystem.h @@ -7,8 +7,8 @@ #include "Rendering/ESetCamera.h" #include "Core/ConfigFile.h" -#include "Core/EntityFile.h" -#include "Core/EntityFileParser.h" +#include "Core/EntityXMLFile.h" +#include "Core/EntityXMLFileParser.h" #include "Core/EPlayerDeath.h" #include "Core/EEntityDeleted.h" diff --git a/include/Game/Systems/PlayerMovementSystem.h b/include/Game/Systems/PlayerMovementSystem.h index cdf8ee22..8b6e4e54 100644 --- a/include/Game/Systems/PlayerMovementSystem.h +++ b/include/Game/Systems/PlayerMovementSystem.h @@ -7,8 +7,8 @@ #include "Events/EDoubleJump.h" #include "../Engine/Sound/EPlaySoundOnEntity.h" -#include "Core/EntityFile.h" -#include "Core/EntityFileParser.h" +#include "Core/EntityXMLFile.h" +#include "Core/EntityXMLFileParser.h" class PlayerMovementSystem : public ImpureSystem { diff --git a/include/Game/Systems/SpawnerSystem.h b/include/Game/Systems/SpawnerSystem.h index e4a44738..10817ef0 100644 --- a/include/Game/Systems/SpawnerSystem.h +++ b/include/Game/Systems/SpawnerSystem.h @@ -8,7 +8,7 @@ #include "Events/ESpawnerSpawn.h" #include "Core/Transform.h" #include "Core/ResourceManager.h" -#include "Core/EntityFileParser.h" +#include "Core/EntityXMLFileParser.h" class SpawnerSystem : public System { diff --git a/include/Game/Systems/Weapon/WeaponSystem.h b/include/Game/Systems/Weapon/WeaponSystem.h index b8278bc4..f6543ffb 100644 --- a/include/Game/Systems/Weapon/WeaponSystem.h +++ b/include/Game/Systems/Weapon/WeaponSystem.h @@ -9,8 +9,8 @@ #include "Core/EShoot.h" #include "Core/EPlayerSpawned.h" #include "Input/EInputCommand.h" -#include "Core/EntityFile.h" -#include "Core/EntityFileParser.h" +#include "Core/EntityXMLFile.h" +#include "Core/EntityXMLFileParser.h" #include "Core/Octree.h" #include "Collision/EntityAABB.h" #include "Systems/SpawnerSystem.h" diff --git a/src/Engine/Core/EntityFile.cpp b/src/Engine/Core/EntityXMLFile.cpp similarity index 94% rename from src/Engine/Core/EntityFile.cpp rename to src/Engine/Core/EntityXMLFile.cpp index 3987b092..b32d952d 100644 --- a/src/Engine/Core/EntityFile.cpp +++ b/src/Engine/Core/EntityXMLFile.cpp @@ -1,6 +1,6 @@ -#include "Core/EntityFile.h" +#include "Core/EntityXMLFile.h" -EntityFile::EntityFile(boost::filesystem::path path) +EntityXMLFile::EntityXMLFile(boost::filesystem::path path) : m_FilePath(path) { using namespace xercesc; @@ -9,14 +9,14 @@ EntityFile::EntityFile(boost::filesystem::path path) m_SAX2XMLReader = XMLReaderFactory::createXMLReader(XMLPlatformUtils::fgMemoryManager, m_GrammarPool); } -EntityFile::~EntityFile() +EntityXMLFile::~EntityXMLFile() { delete m_SAX2XMLReader; delete m_GrammarPool; xercesc::XMLPlatformUtils::Terminate(); } -void EntityFile::Parse(const EntityFileHandler* handler) const +void EntityXMLFile::Parse(const EntityFileHandler* handler) const { using namespace xercesc; @@ -28,7 +28,7 @@ void EntityFile::Parse(const EntityFileHandler* handler) const m_SAX2XMLReader->parse(m_FilePath.string().c_str()); } -void EntityFile::setReaderFeatures(xercesc::SAX2XMLReader* reader) +void EntityXMLFile::setReaderFeatures(xercesc::SAX2XMLReader* reader) { using namespace xercesc; reader->setFeature(XMLUni::fgXercesCacheGrammarFromParse, true); @@ -41,7 +41,7 @@ void EntityFile::setReaderFeatures(xercesc::SAX2XMLReader* reader) reader->setFeature(XMLUni::fgXercesIdentityConstraintChecking, true); } -unsigned int EntityFile::GetTypeStride(std::string typeName) +unsigned int EntityXMLFile::GetTypeStride(std::string typeName) { std::map typeStrides{ { "bool", sizeof(bool) }, @@ -59,7 +59,7 @@ unsigned int EntityFile::GetTypeStride(std::string typeName) return (it != typeStrides.end()) ? it->second : 0; } -void EntityFile::WriteAttributeData(char* outData, const ComponentInfo::Field_t& field, const std::map& attributes) +void EntityXMLFile::WriteAttributeData(char* outData, const ComponentInfo::Field_t& field, const std::map& attributes) { if (field.Type == "Vector") { glm::vec3 vec; @@ -86,7 +86,7 @@ void EntityFile::WriteAttributeData(char* outData, const ComponentInfo::Field_t& } } -void EntityFile::WriteValueData(char* outData, const ComponentInfo::Field_t& field, const char* valueData) +void EntityXMLFile::WriteValueData(char* outData, const ComponentInfo::Field_t& field, const char* valueData) { // Catch and ignore casting errors so whitespace around string enums won't mess anything up try { @@ -243,7 +243,7 @@ void EntityFileSAXHandler::onStartEntityRef(const xercesc::Attributes& attrs) std::string path = XS::ToString(attrs.getValue(XS::ToXMLCh("file"))); xercesc::SAX2XMLReader* reader = xercesc::XMLReaderFactory::createXMLReader(); - EntityFile::setReaderFeatures(reader); + EntityXMLFile::setReaderFeatures(reader); reader->setContentHandler(this); reader->setErrorHandler(this); reader->parse(path.c_str()); diff --git a/src/Engine/Core/EntityFileParser.cpp b/src/Engine/Core/EntityXMLFileParser.cpp similarity index 59% rename from src/Engine/Core/EntityFileParser.cpp rename to src/Engine/Core/EntityXMLFileParser.cpp index 2beaac14..9c79775c 100644 --- a/src/Engine/Core/EntityFileParser.cpp +++ b/src/Engine/Core/EntityXMLFileParser.cpp @@ -1,15 +1,15 @@ -#include "Core/EntityFileParser.h" +#include "Core/EntityXMLFileParser.h" -EntityFileParser::EntityFileParser(const EntityFile* entityFile) +EntityXMLFileParser::EntityXMLFileParser(const EntityXMLFile* entityFile) : m_EntityFile(entityFile) { - m_Handler.SetStartEntityCallback(std::bind(&EntityFileParser::onStartEntity, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); - m_Handler.SetStartComponentCallback(std::bind(&EntityFileParser::onStartComponent, this, std::placeholders::_1, std::placeholders::_2)); - m_Handler.SetStartFieldCallback(std::bind(&EntityFileParser::onStartComponentField, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4)); - m_Handler.SetStartFieldDataCallback(std::bind(&EntityFileParser::onFieldData, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4)); + m_Handler.SetStartEntityCallback(std::bind(&EntityXMLFileParser::onStartEntity, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); + m_Handler.SetStartComponentCallback(std::bind(&EntityXMLFileParser::onStartComponent, this, std::placeholders::_1, std::placeholders::_2)); + m_Handler.SetStartFieldCallback(std::bind(&EntityXMLFileParser::onStartComponentField, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4)); + m_Handler.SetStartFieldDataCallback(std::bind(&EntityXMLFileParser::onFieldData, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4)); } -EntityID EntityFileParser::MergeEntities(World* world, EntityID baseParent /*= EntityID_Invalid */) +EntityID EntityXMLFileParser::MergeEntities(World* world, EntityID baseParent /*= EntityID_Invalid */) { m_World = world; m_EntityIDMapper[0] = baseParent; @@ -17,7 +17,7 @@ EntityID EntityFileParser::MergeEntities(World* world, EntityID baseParent /*= E return m_FirstEntity; } -void EntityFileParser::onStartEntity(EntityID entity, EntityID parent, const std::string& name) +void EntityXMLFileParser::onStartEntity(EntityID entity, EntityID parent, const std::string& name) { EntityID realParent = m_EntityIDMapper.at(parent); EntityID realEntity = m_World->CreateEntity(realParent); @@ -31,7 +31,7 @@ void EntityFileParser::onStartEntity(EntityID entity, EntityID parent, const std //LOG_DEBUG("Created entity #%i (%i) with parent %i (%i)", entity, realEntity, parent, realParent); } -void EntityFileParser::onStartComponent(EntityID entity, const std::string& component) +void EntityXMLFileParser::onStartComponent(EntityID entity, const std::string& component) { if (m_World->GetComponentPools().count(component) != 0) { EntityID realEntity = m_EntityIDMapper.at(entity); @@ -42,7 +42,7 @@ void EntityFileParser::onStartComponent(EntityID entity, const std::string& comp //LOG_DEBUG("Attached component of type \"%s\" to entity #%i (%i)", component.c_str(), entity, realEntity); } -void EntityFileParser::onStartComponentField(EntityID entity, const std::string& componentType, const std::string& fieldName, const std::map& attributes) +void EntityXMLFileParser::onStartComponentField(EntityID entity, const std::string& componentType, const std::string& fieldName, const std::map& attributes) { if (m_World->GetComponentPools().count(componentType) == 0) { return; @@ -63,10 +63,10 @@ void EntityFileParser::onStartComponentField(EntityID entity, const std::string& //} char* data = component.Data + field.Offset; - EntityFile::WriteAttributeData(data, field, attributes); + EntityXMLFile::WriteAttributeData(data, field, attributes); } -void EntityFileParser::onFieldData(EntityID entity, const std::string& componentType, const std::string& fieldName, const char* fieldData) +void EntityXMLFileParser::onFieldData(EntityID entity, const std::string& componentType, const std::string& fieldName, const char* fieldData) { if (m_World->GetComponentPools().count(componentType) == 0) { return; @@ -80,5 +80,5 @@ void EntityFileParser::onFieldData(EntityID entity, const std::string& component auto& field = fieldIt->second; char* data = component.Data + field.Offset; - EntityFile::WriteValueData(data, field, fieldData); + EntityXMLFile::WriteValueData(data, field, fieldData); } diff --git a/src/Engine/Core/EntityFilePreprocessor.cpp b/src/Engine/Core/EntityXMLFilePreprocessor.cpp similarity index 93% rename from src/Engine/Core/EntityFilePreprocessor.cpp rename to src/Engine/Core/EntityXMLFilePreprocessor.cpp index 592daedb..9695509d 100644 --- a/src/Engine/Core/EntityFilePreprocessor.cpp +++ b/src/Engine/Core/EntityXMLFilePreprocessor.cpp @@ -1,10 +1,10 @@ -#include "Core/EntityFilePreprocessor.h" +#include "Core/EntityXMLFilePreprocessor.h" -EntityFilePreprocessor::EntityFilePreprocessor(const EntityFile* entityFile) +EntityXMLFilePreprocessor::EntityXMLFilePreprocessor(const EntityXMLFile* entityFile) : m_EntityFile(entityFile) { EntityFileHandler handler; - handler.SetStartComponentCallback(std::bind(&EntityFilePreprocessor::onStartComponent, this, std::placeholders::_1, std::placeholders::_2)); + handler.SetStartComponentCallback(std::bind(&EntityXMLFilePreprocessor::onStartComponent, this, std::placeholders::_1, std::placeholders::_2)); m_EntityFile->Parse(&handler); //LOG_DEBUG("___ COMPONENT DEFINITIONS ___"); @@ -28,20 +28,20 @@ EntityFilePreprocessor::EntityFilePreprocessor(const EntityFile* entityFile) parseDefaults(); } -void EntityFilePreprocessor::RegisterComponents(World* world) +void EntityXMLFilePreprocessor::RegisterComponents(World* world) { for (auto& kv : m_ComponentInfo) { world->RegisterComponent(kv.second); } } -void EntityFilePreprocessor::onStartComponent(EntityID entity, std::string type) +void EntityXMLFilePreprocessor::onStartComponent(EntityID entity, std::string type) { //LOG_DEBUG("Component: %s", type.c_str()); m_ComponentCounts[type]++; } -void EntityFilePreprocessor::parseComponentInfo() +void EntityXMLFilePreprocessor::parseComponentInfo() { using namespace xercesc; EntityFileXMLErrorHandler errorHandler; @@ -141,9 +141,9 @@ void EntityFilePreprocessor::parseComponentInfo() std::string baseType = XS::ToString(elementDeclaration->getTypeDefinition()->getBaseType()->getName()); std::string effectiveType = type; - unsigned int stride = EntityFile::GetTypeStride(type); + unsigned int stride = EntityXMLFile::GetTypeStride(type); if (stride == 0) { - stride = EntityFile::GetTypeStride(baseType); + stride = EntityXMLFile::GetTypeStride(baseType); if (stride == 0) { LOG_WARNING("Field \"%s\" in component \"%s\" uses unexpected field type \"%s\" with base type \"%s\". Skipping.", name.c_str(), compInfo.Name.c_str(), type.c_str(), baseType.c_str()); continue; @@ -196,7 +196,7 @@ void EntityFilePreprocessor::parseComponentInfo() } } -void EntityFilePreprocessor::parseDefaults() +void EntityXMLFilePreprocessor::parseDefaults() { using namespace xercesc; @@ -261,7 +261,7 @@ void EntityFilePreprocessor::parseDefaults() auto attribItem = attributeMap->item(i); attributes[XS::ToString(attribItem->getNodeName())] = XS::ToString(attribItem->getNodeValue()); } - EntityFile::WriteAttributeData(data, field, attributes); + EntityXMLFile::WriteAttributeData(data, field, attributes); } auto childNode = fieldElement->getFirstChild(); @@ -278,14 +278,14 @@ void EntityFilePreprocessor::parseDefaults() // Handle potential field values if (childNode->getNodeType() == DOMNode::TEXT_NODE) { char* cstrValue = XMLString::transcode(childNode->getNodeValue()); - EntityFile::WriteValueData(data, field, cstrValue); + EntityXMLFile::WriteValueData(data, field, cstrValue); XMLString::release(&cstrValue); } } } } -std::string EntityFilePreprocessor::parseAnnotationXML(const XMLCh* xml) +std::string EntityXMLFilePreprocessor::parseAnnotationXML(const XMLCh* xml) { using namespace xercesc; diff --git a/src/Engine/Core/EntityFileWriter.cpp b/src/Engine/Core/EntityXMLFileWriter.cpp similarity index 94% rename from src/Engine/Core/EntityFileWriter.cpp rename to src/Engine/Core/EntityXMLFileWriter.cpp index 06a3c4ca..a98d3fbd 100644 --- a/src/Engine/Core/EntityFileWriter.cpp +++ b/src/Engine/Core/EntityXMLFileWriter.cpp @@ -1,13 +1,13 @@ -#include "Core/EntityFileWriter.h" +#include "Core/EntityXMLFileWriter.h" #define X(str) XS::ToXMLCh(str) -void EntityFileWriter::WriteWorld(World* world) +void EntityXMLFileWriter::WriteWorld(World* world) { WriteEntity(world, 0); } -void EntityFileWriter::WriteEntity(World* world, EntityID entity) +void EntityXMLFileWriter::WriteEntity(World* world, EntityID entity) { using namespace xercesc; DOMDocument* doc = m_DOMImplementation->createDocument(nullptr, X("Entity"), nullptr); @@ -41,7 +41,7 @@ void EntityFileWriter::WriteEntity(World* world, EntityID entity) doc->release(); } -void EntityFileWriter::appendEntityChildren(xercesc::DOMElement* parentElement, const World* world, EntityID entity) +void EntityXMLFileWriter::appendEntityChildren(xercesc::DOMElement* parentElement, const World* world, EntityID entity) { using namespace xercesc; DOMDocument* doc = parentElement->getOwnerDocument(); @@ -67,7 +67,7 @@ void EntityFileWriter::appendEntityChildren(xercesc::DOMElement* parentElement, } } -void EntityFileWriter::appentEntityComponents(xercesc::DOMElement* parentElement, const World* world, EntityID entity) +void EntityXMLFileWriter::appentEntityComponents(xercesc::DOMElement* parentElement, const World* world, EntityID entity) { using namespace xercesc; DOMDocument* doc = parentElement->getOwnerDocument(); diff --git a/src/Engine/Editor/EditorSystem.cpp b/src/Engine/Editor/EditorSystem.cpp index b0929df9..3e664161 100644 --- a/src/Engine/Editor/EditorSystem.cpp +++ b/src/Engine/Editor/EditorSystem.cpp @@ -129,7 +129,7 @@ void EditorSystem::OnEntitySelected(EntityWrapper entity) void EditorSystem::OnEntitySave(EntityWrapper entity, boost::filesystem::path filePath) { - EntityFileWriter writer(filePath); + EntityXMLFileWriter writer(filePath); writer.WriteEntity(entity.World, entity.ID); } @@ -259,10 +259,10 @@ EntityWrapper EditorSystem::importEntity(EntityWrapper parent, boost::filesystem } try { - auto entityFile = ResourceManager::Load(filePath.string()); - EntityFilePreprocessor fpp(entityFile); + auto entityFile = ResourceManager::Load(filePath.string()); + EntityXMLFilePreprocessor fpp(entityFile); fpp.RegisterComponents(parent.World); - EntityFileParser fp(entityFile); + EntityXMLFileParser fp(entityFile); EntityID newEntity = fp.MergeEntities(parent.World, parent.ID); return EntityWrapper(parent.World, newEntity); } catch (const std::exception& e) { diff --git a/src/Game/Game.cpp b/src/Game/Game.cpp index b4c1a71d..9c9228b9 100644 --- a/src/Game/Game.cpp +++ b/src/Game/Game.cpp @@ -11,7 +11,7 @@ #include "Systems/PlayerSpawnSystem.h" #include "Systems/PlayerDeathSystem.h" #include "Systems/FloatingEffectSystem.h" -#include "Core/EntityFileWriter.h" +#include "Core/EntityXMLFileWriter.h" #include "Game/Systems/CapturePointSystem.h" #include "Game/Systems/CapturePointHUDSystem.h" #include "Game/Systems/PickupSpawnSystem.h" @@ -44,7 +44,7 @@ Game::Game(int argc, char* argv[]) ResourceManager::RegisterType("Texture"); ResourceManager::RegisterType("Png"); ResourceManager::RegisterType("ShaderProgram"); - ResourceManager::RegisterType("EntityFile"); + ResourceManager::RegisterType("EntityFile"); ResourceManager::RegisterType("FontFile"); m_Config = ResourceManager::Load("Config.ini"); @@ -80,10 +80,10 @@ Game::Game(int argc, char* argv[]) m_World = new World(m_EventBroker); std::string mapToLoad = m_Config->Get("Debug.LoadMap", ""); if (!mapToLoad.empty()) { - auto file = ResourceManager::Load(mapToLoad); - EntityFilePreprocessor fpp(file); + auto file = ResourceManager::Load(mapToLoad); + EntityXMLFilePreprocessor fpp(file); fpp.RegisterComponents(m_World); - EntityFileParser fp(file); + EntityXMLFileParser fp(file); fp.MergeEntities(m_World); } diff --git a/src/Game/Systems/AmmoPickupSystem.cpp b/src/Game/Systems/AmmoPickupSystem.cpp index 74d86f70..e3051efe 100644 --- a/src/Game/Systems/AmmoPickupSystem.cpp +++ b/src/Game/Systems/AmmoPickupSystem.cpp @@ -20,8 +20,8 @@ void AmmoPickupSystem::Update(double dt) auto& somePickup = *it; somePickup.DecreaseThisRespawnTimer -= dt; if (somePickup.DecreaseThisRespawnTimer < 0.0) { - auto entityFile = ResourceManager::Load("Schema/Entities/AmmoPickup.xml"); - EntityFileParser parser(entityFile); + auto entityFile = ResourceManager::Load("Schema/Entities/AmmoPickup.xml"); + EntityXMLFileParser parser(entityFile); EntityID ammoPickupID = parser.MergeEntities(m_World); //let the world know a pickup has spawned diff --git a/src/Game/Systems/BoostSystem.cpp b/src/Game/Systems/BoostSystem.cpp index 9e4d6968..7f335d1f 100644 --- a/src/Game/Systems/BoostSystem.cpp +++ b/src/Game/Systems/BoostSystem.cpp @@ -38,8 +38,8 @@ bool BoostSystem::OnPlayerDamage(Events::PlayerDamage& e) m_World->DeleteEntity(playerBoostAssaultEntity.ID); } //load boost XML file, set it entity parented with the victim player - auto entityFile = ResourceManager::Load(classXML); - EntityFileParser parser(entityFile); + auto entityFile = ResourceManager::Load(classXML); + EntityXMLFileParser parser(entityFile); EntityID boostAssaultEntity = parser.MergeEntities(m_World); m_World->SetName(boostAssaultEntity, className); m_World->SetParent(boostAssaultEntity, e.Victim.ID); diff --git a/src/Game/Systems/DamageIndicatorSystem.cpp b/src/Game/Systems/DamageIndicatorSystem.cpp index ca26052d..55a1046c 100644 --- a/src/Game/Systems/DamageIndicatorSystem.cpp +++ b/src/Game/Systems/DamageIndicatorSystem.cpp @@ -9,7 +9,7 @@ DamageIndicatorSystem::DamageIndicatorSystem(SystemParams params) //load texture to cache auto texture = CommonFunctions::LoadTexture("Textures/DamageIndicator.png", false); - auto entityFile = ResourceManager::Load("Schema/Entities/DamageIndicator.xml"); + auto entityFile = ResourceManager::Load("Schema/Entities/DamageIndicator.xml"); } void DamageIndicatorSystem::Update(double dt) { @@ -49,8 +49,8 @@ bool DamageIndicatorSystem::OnPlayerDamage(Events::PlayerDamage& e) float angleBetweenVectors = CalculateAngle(e.Victim, inflictorPos); //load & set the "2d" sprite - auto entityFile = ResourceManager::Load("Schema/Entities/DamageIndicator.xml"); - EntityFileParser parser(entityFile); + auto entityFile = ResourceManager::Load("Schema/Entities/DamageIndicator.xml"); + EntityXMLFileParser parser(entityFile); EntityID spriteID = parser.MergeEntities(m_World); m_World->SetParent(spriteID, m_CurrentCamera); auto spriteWrapper = EntityWrapper(m_World, spriteID); @@ -127,8 +127,8 @@ glm::vec3 DamageIndicatorSystem::DamageIndicatorTest(EntityWrapper player) { auto inflictorPos = glm::vec3(currentPos.x + testVar*6.0f, currentPos.y, currentPos.z + testVar2*6.0f); //load the explosioneffect XML - auto deathEffect = ResourceManager::Load("Schema/Entities/PlayerDeathExplosionWithCamera.xml"); - EntityFileParser parser(deathEffect); + auto deathEffect = ResourceManager::Load("Schema/Entities/PlayerDeathExplosionWithCamera.xml"); + EntityXMLFileParser parser(deathEffect); EntityID deathEffectID = parser.MergeEntities(m_World); EntityWrapper deathEffectEW = EntityWrapper(m_World, deathEffectID); diff --git a/src/Game/Systems/PickupSpawnSystem.cpp b/src/Game/Systems/PickupSpawnSystem.cpp index 79e7d66b..9d1ce5b6 100644 --- a/src/Game/Systems/PickupSpawnSystem.cpp +++ b/src/Game/Systems/PickupSpawnSystem.cpp @@ -18,8 +18,8 @@ void PickupSpawnSystem::Update(double dt) somePickup.DecreaseThisRespawnTimer -= dt; if (somePickup.DecreaseThisRespawnTimer < 0.0) { //spawn the new healthPickup - auto entityFile = ResourceManager::Load("Schema/Entities/HealthPickup.xml"); - EntityFileParser parser(entityFile); + auto entityFile = ResourceManager::Load("Schema/Entities/HealthPickup.xml"); + EntityXMLFileParser parser(entityFile); EntityID healthPickupID = parser.MergeEntities(m_World); //let the world know a pickup has spawned (graphics effects, etc) diff --git a/src/Game/Systems/PlayerDeathSystem.cpp b/src/Game/Systems/PlayerDeathSystem.cpp index 0f05da57..1a491580 100644 --- a/src/Game/Systems/PlayerDeathSystem.cpp +++ b/src/Game/Systems/PlayerDeathSystem.cpp @@ -28,8 +28,8 @@ bool PlayerDeathSystem::OnPlayerDeath(Events::PlayerDeath& e) void PlayerDeathSystem::createDeathEffect(EntityWrapper player) { //load the explosioneffect XML - auto deathEffect = ResourceManager::Load("Schema/Entities/PlayerDeathExplosionWithCamera.xml"); - EntityFileParser parser(deathEffect); + auto deathEffect = ResourceManager::Load("Schema/Entities/PlayerDeathExplosionWithCamera.xml"); + EntityXMLFileParser parser(deathEffect); EntityID deathEffectID = parser.MergeEntities(m_World); EntityWrapper deathEffectEW = EntityWrapper(m_World, deathEffectID); diff --git a/src/Game/Systems/PlayerMovementSystem.cpp b/src/Game/Systems/PlayerMovementSystem.cpp index 9afc9c8c..5a687b84 100644 --- a/src/Game/Systems/PlayerMovementSystem.cpp +++ b/src/Game/Systems/PlayerMovementSystem.cpp @@ -328,8 +328,8 @@ bool PlayerMovementSystem::OnDoubleJump(Events::DoubleJump & e) void PlayerMovementSystem::spawnHexagon(EntityWrapper target) { //put a hexagon at the entitys... feet? - auto hexagonEffect = ResourceManager::Load("Schema/Entities/DoubleJumpHexagon.xml"); - EntityFileParser parser(hexagonEffect); + auto hexagonEffect = ResourceManager::Load("Schema/Entities/DoubleJumpHexagon.xml"); + EntityXMLFileParser parser(hexagonEffect); EntityID hexagonEffectID = parser.MergeEntities(m_World); EntityWrapper hexagonEW = EntityWrapper(m_World, hexagonEffectID); hexagonEW["Transform"]["Position"] = (glm::vec3)target["Transform"]["Position"]; @@ -342,8 +342,8 @@ bool PlayerMovementSystem::OnDashAbility(Events::DashAbility & e) return false; } - auto dashEffectResource = ResourceManager::Load("Schema/Entities/DashEffect.xml"); - EntityFileParser parser(dashEffectResource); + auto dashEffectResource = ResourceManager::Load("Schema/Entities/DashEffect.xml"); + EntityXMLFileParser parser(dashEffectResource); EntityID dashEffectID = parser.MergeEntities(m_World); EntityWrapper dashEffect(m_World, dashEffectID); auto playerModel = player.FirstChildByName("PlayerModel"); diff --git a/src/Game/Systems/SpawnerSystem.cpp b/src/Game/Systems/SpawnerSystem.cpp index 6500460f..b16f7dfe 100644 --- a/src/Game/Systems/SpawnerSystem.cpp +++ b/src/Game/Systems/SpawnerSystem.cpp @@ -17,11 +17,11 @@ EntityWrapper SpawnerSystem::Spawn(EntityWrapper spawner, EntityWrapper parent / // Load the entity file and parse it const std::string& entityFilePath = spawner["Spawner"]["EntityFile"]; - auto entityFile = ResourceManager::Load(entityFilePath); + auto entityFile = ResourceManager::Load(entityFilePath); if (entityFile == nullptr) { return EntityWrapper::Invalid; } - EntityFileParser parser(entityFile); + EntityXMLFileParser parser(entityFile); EntityWrapper spawnedEntity(world, parser.MergeEntities(world, parent.ID)); //If the spawned entity is collideable, then we must not spawn it where it collides with something that diff --git a/src/Tests/CapturePointTest.cpp b/src/Tests/CapturePointTest.cpp index 8a9baf40..8fb7869c 100644 --- a/src/Tests/CapturePointTest.cpp +++ b/src/Tests/CapturePointTest.cpp @@ -7,7 +7,7 @@ using boost::unit_test_framework::test_case; #include "Collision/TriggerSystem.h" #include "Collision/CollisionSystem.h" -#include "Core/EntityFileWriter.h" +#include "Core/EntityXMLFileWriter.h" #include "Game/Systems/CapturePointSystem.h" BOOST_AUTO_TEST_SUITE(CapturePointTestSuite) @@ -82,7 +82,7 @@ bool CapturePointTest::CapturePoint_Game_Loop_OneHundredTimes() { CapturePointTest::CapturePointTest(int runTestNumber) { ResourceManager::RegisterType("ConfigFile"); - ResourceManager::RegisterType("EntityFile"); + ResourceManager::RegisterType("EntityFile"); m_Config = ResourceManager::Load("Config.ini"); LOG_LEVEL = static_cast<_LOG_LEVEL>(m_Config->Get("Debug.LogLevel", 1)); @@ -99,10 +99,10 @@ CapturePointTest::CapturePointTest(int runTestNumber) m_SystemPipeline->AddSystem(1); //must register components (Components.xsd), else you cant create entities. Easiest done by loading a test xsd file - auto file = ResourceManager::Load("Schema/Entities/TeamTest.xml"); - EntityFilePreprocessor fpp(file); + auto file = ResourceManager::Load("Schema/Entities/TeamTest.xml"); + EntityXMLFilePreprocessor fpp(file); fpp.RegisterComponents(m_World); - EntityFileParser fp(file); + EntityXMLFileParser fp(file); fp.MergeEntities(m_World); EntityID playerID = m_World->CreateEntity(); diff --git a/src/Tests/CapturePointTest.h b/src/Tests/CapturePointTest.h index 54bdc55c..1046f714 100644 --- a/src/Tests/CapturePointTest.h +++ b/src/Tests/CapturePointTest.h @@ -9,12 +9,12 @@ #include "Input/KeyboardInputHandler.h" #include "Input/MouseInputHandler.h" #include "Core/EKeyDown.h" -#include "Core/EntityFile.h" +#include "Core/EntityXMLFile.h" #include "Core/SystemPipeline.h" -#include "Core/EntityFilePreprocessor.h" -#include "Core/EntityFileParser.h" -#include "Core/EntityFileWriter.h" +#include "Core/EntityXMLFilePreprocessor.h" +#include "Core/EntityXMLFileParser.h" +#include "Core/EntityXMLFileWriter.h" #include "Engine/Collision/ETrigger.h" diff --git a/src/Tests/HealthSystemTest.cpp b/src/Tests/HealthSystemTest.cpp index bf2650a3..0a8758ae 100644 --- a/src/Tests/HealthSystemTest.cpp +++ b/src/Tests/HealthSystemTest.cpp @@ -30,7 +30,7 @@ BOOST_AUTO_TEST_SUITE_END() GameHealthSystemTest::GameHealthSystemTest() { ResourceManager::RegisterType("ConfigFile"); - ResourceManager::RegisterType("EntityFile"); + ResourceManager::RegisterType("EntityFile"); m_Config = ResourceManager::Load("Config.ini"); LOG_LEVEL = static_cast<_LOG_LEVEL>(m_Config->Get("Debug.LogLevel", 1)); @@ -41,10 +41,10 @@ GameHealthSystemTest::GameHealthSystemTest() // Create a world m_World = new World(); - auto file = ResourceManager::Load("Schema/Entities/TeamTest.xml"); - EntityFilePreprocessor fpp(file); + auto file = ResourceManager::Load("Schema/Entities/TeamTest.xml"); + EntityXMLFilePreprocessor fpp(file); fpp.RegisterComponents(m_World); - EntityFileParser fp(file); + EntityXMLFileParser fp(file); fp.MergeEntities(m_World); // Create system pipeline diff --git a/src/Tests/HealthSystemTest.h b/src/Tests/HealthSystemTest.h index 275558d2..787a2d0e 100644 --- a/src/Tests/HealthSystemTest.h +++ b/src/Tests/HealthSystemTest.h @@ -11,7 +11,7 @@ #include "Input/KeyboardInputHandler.h" #include "Input/MouseInputHandler.h" #include "Core/EKeyDown.h" -#include "Core/EntityFile.h" +#include "Core/EntityXMLFile.h" #include "Core/SystemPipeline.h" #include "Editor/EditorSystem.h" diff --git a/src/Tests/PickupSpawnTest.cpp b/src/Tests/PickupSpawnTest.cpp index 4acd897e..0af72883 100644 --- a/src/Tests/PickupSpawnTest.cpp +++ b/src/Tests/PickupSpawnTest.cpp @@ -30,7 +30,7 @@ BOOST_AUTO_TEST_SUITE_END() PickupSpawnTest::PickupSpawnTest(int runTestNumber) { ResourceManager::RegisterType("ConfigFile"); - ResourceManager::RegisterType("EntityFile"); + ResourceManager::RegisterType("EntityFile"); m_Config = ResourceManager::Load("Config.ini"); LOG_LEVEL = static_cast<_LOG_LEVEL>(m_Config->Get("Debug.LogLevel", 1)); @@ -44,10 +44,10 @@ PickupSpawnTest::PickupSpawnTest(int runTestNumber) m_SystemPipeline->AddSystem(1); //must register components (Components.xsd), else you cant create entities. Easiest done by loading a test xsd file - auto file = ResourceManager::Load("Schema/Entities/HealthPickup.xml"); - EntityFilePreprocessor fpp(file); + auto file = ResourceManager::Load("Schema/Entities/HealthPickup.xml"); + EntityXMLFilePreprocessor fpp(file); fpp.RegisterComponents(m_World); - EntityFileParser fp(file); + EntityXMLFileParser fp(file); //connect the healthpickup to the world m_HealthPickupID = fp.MergeEntities(m_World); diff --git a/src/Tests/PickupSpawnTest.h b/src/Tests/PickupSpawnTest.h index b9d5483a..372b07cd 100644 --- a/src/Tests/PickupSpawnTest.h +++ b/src/Tests/PickupSpawnTest.h @@ -9,12 +9,12 @@ #include "Input/KeyboardInputHandler.h" #include "Input/MouseInputHandler.h" #include "Core/EKeyDown.h" -#include "Core/EntityFile.h" +#include "Core/EntityXMLFile.h" #include "Core/SystemPipeline.h" -#include "Core/EntityFilePreprocessor.h" -#include "Core/EntityFileParser.h" -#include "Core/EntityFileWriter.h" +#include "Core/EntityXMLFilePreprocessor.h" +#include "Core/EntityXMLFileParser.h" +#include "Core/EntityXMLFileWriter.h" #include "Engine/Collision/ETrigger.h" @@ -29,7 +29,7 @@ //#include #include "Collision/TriggerSystem.h" #include "Collision/CollisionSystem.h" -#include "Core/EntityFileWriter.h" +#include "Core/EntityXMLFileWriter.h" #include "Game/Systems/HealthSystem.h" #include "Game/Systems/PickupSpawnSystem.h" From 0c0f2d7e50d8d14a395b95b1452571a89f59ba9c Mon Sep 17 00:00:00 2001 From: sippeangelo Date: Wed, 2 Mar 2016 18:56:22 +0100 Subject: [PATCH 41/51] fixup! Renamed EntityFile to EntityXMLFile to be able to separate file parsing from entity creation --- include/Engine/Core/EntityXMLFile.h | 4 ++-- include/Engine/Core/EntityXMLFileParser.h | 4 ++-- include/Engine/Core/EntityXMLFilePreprocessor.h | 4 ++-- include/Engine/Core/EntityXMLFileWriter.h | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/Engine/Core/EntityXMLFile.h b/include/Engine/Core/EntityXMLFile.h index 6dcc74c5..6f24154d 100644 --- a/include/Engine/Core/EntityXMLFile.h +++ b/include/Engine/Core/EntityXMLFile.h @@ -1,5 +1,5 @@ -#ifndef EntityFile_h__ -#define EntityFile_h__ +#ifndef EntityXMLFile_h__ +#define EntityXMLFile_h__ #include #include diff --git a/include/Engine/Core/EntityXMLFileParser.h b/include/Engine/Core/EntityXMLFileParser.h index c058640f..984f9e46 100644 --- a/include/Engine/Core/EntityXMLFileParser.h +++ b/include/Engine/Core/EntityXMLFileParser.h @@ -1,5 +1,5 @@ -#ifndef EntityFileParser_h__ -#define EntityFileParser_h__ +#ifndef EntityXMLFileParser_h__ +#define EntityXMLFileParser_h__ #include "EntityXMLFile.h" #include "World.h" diff --git a/include/Engine/Core/EntityXMLFilePreprocessor.h b/include/Engine/Core/EntityXMLFilePreprocessor.h index 45880835..e102ef79 100644 --- a/include/Engine/Core/EntityXMLFilePreprocessor.h +++ b/include/Engine/Core/EntityXMLFilePreprocessor.h @@ -1,5 +1,5 @@ -#ifndef EntityFilePreprocessor_h__ -#define EntityFilePreprocessor_h__ +#ifndef EntityXMLFilePreprocessor_h__ +#define EntityXMLFilePreprocessor_h__ #include #include diff --git a/include/Engine/Core/EntityXMLFileWriter.h b/include/Engine/Core/EntityXMLFileWriter.h index 9b100670..da073a73 100644 --- a/include/Engine/Core/EntityXMLFileWriter.h +++ b/include/Engine/Core/EntityXMLFileWriter.h @@ -1,5 +1,5 @@ -#ifndef EntityFileWriter_h__ -#define EntityFileWriter_h__ +#ifndef EntityXMLFileWriter_h__ +#define EntityXMLFileWriter_h__ #include #include From fb9914d08a821d800641f7138ad9f3ca2824fe26 Mon Sep 17 00:00:00 2001 From: sippeangelo Date: Wed, 2 Mar 2016 19:48:20 +0100 Subject: [PATCH 42/51] Fixed AMD shader compilation error --- resources/Shaders/ForwardPlusSplatMapRGBShieldCheck.frag.glsl | 1 - 1 file changed, 1 deletion(-) diff --git a/resources/Shaders/ForwardPlusSplatMapRGBShieldCheck.frag.glsl b/resources/Shaders/ForwardPlusSplatMapRGBShieldCheck.frag.glsl index fa3af6ac..d61726fe 100644 --- a/resources/Shaders/ForwardPlusSplatMapRGBShieldCheck.frag.glsl +++ b/resources/Shaders/ForwardPlusSplatMapRGBShieldCheck.frag.glsl @@ -40,7 +40,6 @@ layout (binding = 10) uniform sampler2D SpecularMapTexture3; layout (binding = 11) uniform sampler2D GlowMapTexture1; layout (binding = 12) uniform sampler2D GlowMapTexture2; layout (binding = 13) uniform sampler2D GlowMapTexture3; -layout (binding = 13) uniform sampler2D GlowMapTexture3; layout (binding = 31) uniform samplerCube ShieldBuffer; #define TILE_SIZE 16 From 618e96da9084fa4d452ad1b9c1bacc9eea6b58f5 Mon Sep 17 00:00:00 2001 From: sippeangelo Date: Wed, 2 Mar 2016 19:49:54 +0100 Subject: [PATCH 43/51] "Fixed" this crash in debug. The attachment vector is sometimes empty! @Tleety --- src/Engine/Rendering/FrameBuffer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Engine/Rendering/FrameBuffer.cpp b/src/Engine/Rendering/FrameBuffer.cpp index 9ba0d2d8..da438e7a 100644 --- a/src/Engine/Rendering/FrameBuffer.cpp +++ b/src/Engine/Rendering/FrameBuffer.cpp @@ -70,7 +70,7 @@ void FrameBuffer::Generate() } GLERROR("3"); - GLenum* bufferTextures = &attachments[0]; + GLenum* bufferTextures = attachments.data(); glDrawBuffers(attachments.size(), bufferTextures); if (GLERROR("GLBufferAttachement error")) { printf(": AttachmentSize %i", attachments.size()); From 44b4a597d43e2058025caadce3e880f7a947c737 Mon Sep 17 00:00:00 2001 From: sippeangelo Date: Wed, 2 Mar 2016 19:50:52 +0100 Subject: [PATCH 44/51] fixup! Created World::Merge which will merge a world into another one --- include/Engine/Core/World.h | 2 +- src/Engine/Core/World.cpp | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/include/Engine/Core/World.h b/include/Engine/Core/World.h index 28c96303..9ae38021 100644 --- a/include/Engine/Core/World.h +++ b/include/Engine/Core/World.h @@ -55,7 +55,7 @@ public: // Merge another world into this one // Returns a map that maps entities from the other world to their copies in this one - std::unordered_map Merge(World& other); + std::unordered_map Merge(const World* other); private: EventBroker* m_EventBroker = nullptr; diff --git a/src/Engine/Core/World.cpp b/src/Engine/Core/World.cpp index 96c4660d..0952a53b 100644 --- a/src/Engine/Core/World.cpp +++ b/src/Engine/Core/World.cpp @@ -169,27 +169,29 @@ EntityWrapper World::GetFirstEntityByName(const std::string& name) return EntityWrapper::Invalid; } -std::unordered_map World::Merge(World& other) +std::unordered_map World::Merge(const World* other) { std::unordered_map oldToNew; // Create new entities - for (auto& kv : other.m_EntityParents) { + for (auto& kv : other->m_EntityParents) { EntityID entity = kv.first; EntityID newEntity = CreateEntity(); - SetName(newEntity, other.GetName(entity)); + SetName(newEntity, other->GetName(entity)); oldToNew[entity] = newEntity; } // Fix relationships - for (auto& kv : other.m_EntityParents) { + for (auto& kv : other->m_EntityParents) { EntityID entity = kv.first; EntityID parent = kv.second; - SetParent(oldToNew.at(entity), oldToNew.at(parent)); + if (parent != EntityID_Invalid) { + SetParent(oldToNew.at(entity), oldToNew.at(parent)); + } } // Transfer components - for (auto& kv : other.m_ComponentPools) { + for (auto& kv : other->m_ComponentPools) { auto& componentType = kv.first; ComponentPool* pool = kv.second; // Register pool if it's not present in world From 069583e09f29d695240f8f1423aeb48925f788eb Mon Sep 17 00:00:00 2001 From: sippeangelo Date: Wed, 2 Mar 2016 19:52:11 +0100 Subject: [PATCH 45/51] Created EntityFile which loads an EntityXMLFile into a temporary world to be merged with another world when you want to create a copy of the entity loaded from disk. This allows us to free EntityXMLFile once it's loaded into an EntityFile. --- include/Engine/Core/EntityFile.h | 21 +++++++++++++++++++++ src/Engine/Core/EntityFile.cpp | 22 ++++++++++++++++++++++ src/Game/Game.cpp | 4 +++- 3 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 include/Engine/Core/EntityFile.h create mode 100644 src/Engine/Core/EntityFile.cpp diff --git a/include/Engine/Core/EntityFile.h b/include/Engine/Core/EntityFile.h new file mode 100644 index 00000000..fae39c51 --- /dev/null +++ b/include/Engine/Core/EntityFile.h @@ -0,0 +1,21 @@ +#ifndef EntityFile_h__ +#define EntityFile_h__ + +#include "World.h" +#include "EntityXMLFile.h" +#include "EntityXMLFilePreprocessor.h" +#include "EntityXMLFileParser.h" +#include "EntityWrapper.h" + +class EntityFile : private World, public Resource +{ +public: + EntityFile(std::string path); + + EntityWrapper MergeInto(World* other); + +private: + EntityID m_RootEntity = EntityID_Invalid; +}; + +#endif \ No newline at end of file diff --git a/src/Engine/Core/EntityFile.cpp b/src/Engine/Core/EntityFile.cpp new file mode 100644 index 00000000..090bbbd8 --- /dev/null +++ b/src/Engine/Core/EntityFile.cpp @@ -0,0 +1,22 @@ +#include "Core/EntityFile.h" + +EntityFile::EntityFile(std::string path) +{ + EntityXMLFile* xml = ResourceManager::Load(path); + + EntityXMLFilePreprocessor preprocessor(xml); + preprocessor.RegisterComponents(this); + + EntityXMLFileParser parser(xml); + m_RootEntity = parser.MergeEntities(this); + + if (m_RootEntity == EntityID_Invalid) { + throw Resource::FailedLoadingException("Failed to merge entities; root entity is invalid"); + } +} + +EntityWrapper EntityFile::MergeInto(World* other) +{ + auto mapping = other->Merge(this); + return EntityWrapper(other, mapping.at(m_RootEntity)); +} \ No newline at end of file diff --git a/src/Game/Game.cpp b/src/Game/Game.cpp index 9c9228b9..1a672f25 100644 --- a/src/Game/Game.cpp +++ b/src/Game/Game.cpp @@ -11,6 +11,7 @@ #include "Systems/PlayerSpawnSystem.h" #include "Systems/PlayerDeathSystem.h" #include "Systems/FloatingEffectSystem.h" +#include "Core/EntityFile.h" #include "Core/EntityXMLFileWriter.h" #include "Game/Systems/CapturePointSystem.h" #include "Game/Systems/CapturePointHUDSystem.h" @@ -44,7 +45,8 @@ Game::Game(int argc, char* argv[]) ResourceManager::RegisterType("Texture"); ResourceManager::RegisterType("Png"); ResourceManager::RegisterType("ShaderProgram"); - ResourceManager::RegisterType("EntityFile"); + ResourceManager::RegisterType("EntityFile"); + ResourceManager::RegisterType("EntityXMLFile"); ResourceManager::RegisterType("FontFile"); m_Config = ResourceManager::Load("Config.ini"); From 5923d2d7a72512137ae789755fc15fcd41334e8b Mon Sep 17 00:00:00 2001 From: sippeangelo Date: Wed, 2 Mar 2016 19:52:34 +0100 Subject: [PATCH 46/51] Made SpawnerSystem utilize the new EntityFile for spawning instead --- include/Game/Systems/SpawnerSystem.h | 3 +-- src/Game/Systems/SpawnerSystem.cpp | 14 ++++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/include/Game/Systems/SpawnerSystem.h b/include/Game/Systems/SpawnerSystem.h index 10817ef0..f36f7259 100644 --- a/include/Game/Systems/SpawnerSystem.h +++ b/include/Game/Systems/SpawnerSystem.h @@ -7,8 +7,7 @@ #include "Core/System.h" #include "Events/ESpawnerSpawn.h" #include "Core/Transform.h" -#include "Core/ResourceManager.h" -#include "Core/EntityXMLFileParser.h" +#include "Core/EntityFile.h" class SpawnerSystem : public System { diff --git a/src/Game/Systems/SpawnerSystem.cpp b/src/Game/Systems/SpawnerSystem.cpp index b16f7dfe..282c958b 100644 --- a/src/Game/Systems/SpawnerSystem.cpp +++ b/src/Game/Systems/SpawnerSystem.cpp @@ -17,15 +17,17 @@ EntityWrapper SpawnerSystem::Spawn(EntityWrapper spawner, EntityWrapper parent / // Load the entity file and parse it const std::string& entityFilePath = spawner["Spawner"]["EntityFile"]; - auto entityFile = ResourceManager::Load(entityFilePath); - if (entityFile == nullptr) { + EntityWrapper spawnedEntity; + try { + auto entityFile = ResourceManager::Load(entityFilePath); + spawnedEntity = entityFile->MergeInto(world); + world->SetParent(spawnedEntity.ID, parent.ID); + } catch (const Resource::FailedLoadingException& e) { return EntityWrapper::Invalid; } - EntityXMLFileParser parser(entityFile); - EntityWrapper spawnedEntity(world, parser.MergeEntities(world, parent.ID)); - //If the spawned entity is collideable, then we must not spawn it where it collides with something that - //has a dontCollideComponent attached. + // If the spawned entity is collidable, then we must not spawn it where it collides with something that + // has a dontCollideComponent attached. bool spawnOnCollidable = dontCollideComponent.empty() || !spawnedEntity.HasComponent("Collidable"); if (!spawnOnCollidable) { boost::optional optBox = Collision::EntityAbsoluteAABB(spawnedEntity); From 3ef15dcb8108da3d9ec5d187bd674b85b6aeb6a1 Mon Sep 17 00:00:00 2001 From: sippeangelo Date: Wed, 2 Mar 2016 20:01:18 +0100 Subject: [PATCH 47/51] EntityFile now releases EntityXMLFile after processing. --- src/Engine/Core/EntityFile.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Engine/Core/EntityFile.cpp b/src/Engine/Core/EntityFile.cpp index 090bbbd8..997b9c46 100644 --- a/src/Engine/Core/EntityFile.cpp +++ b/src/Engine/Core/EntityFile.cpp @@ -11,8 +11,11 @@ EntityFile::EntityFile(std::string path) m_RootEntity = parser.MergeEntities(this); if (m_RootEntity == EntityID_Invalid) { + ResourceManager::Release("EntityXMLFile", path); throw Resource::FailedLoadingException("Failed to merge entities; root entity is invalid"); } + + ResourceManager::Release("EntityXMLFile", path); } EntityWrapper EntityFile::MergeInto(World* other) From 7624c6ee0a739a81dfcbf65e00bdbc2316f8c264 Mon Sep 17 00:00:00 2001 From: sippeangelo Date: Wed, 2 Mar 2016 20:12:59 +0100 Subject: [PATCH 48/51] Updated all uses of EntityXMLFile to use the new EntityFile to load entities into a world. --- include/Engine/Core/EntityXMLFileParser.h | 3 ++- include/Engine/Core/EntityXMLFilePreprocessor.h | 3 ++- include/Engine/Editor/EditorSystem.h | 3 +-- include/Game/Systems/AmmoPickupSystem.h | 2 +- include/Game/Systems/BoostSystem.h | 2 +- include/Game/Systems/DamageIndicatorSystem.h | 2 +- include/Game/Systems/PickupSpawnSystem.h | 2 +- include/Game/Systems/PlayerDeathSystem.h | 5 +---- include/Game/Systems/PlayerMovementSystem.h | 4 +--- src/Engine/Editor/EditorSystem.cpp | 11 +++++------ src/Game/Game.cpp | 7 ++----- src/Game/Systems/AmmoPickupSystem.cpp | 9 ++++----- src/Game/Systems/BoostSystem.cpp | 9 ++++----- src/Game/Systems/DamageIndicatorSystem.cpp | 12 +++++------- src/Game/Systems/PickupSpawnSystem.cpp | 9 ++++----- src/Game/Systems/PlayerDeathSystem.cpp | 6 ++---- src/Game/Systems/PlayerMovementSystem.cpp | 12 ++++-------- 17 files changed, 41 insertions(+), 60 deletions(-) diff --git a/include/Engine/Core/EntityXMLFileParser.h b/include/Engine/Core/EntityXMLFileParser.h index 984f9e46..4bc2fab9 100644 --- a/include/Engine/Core/EntityXMLFileParser.h +++ b/include/Engine/Core/EntityXMLFileParser.h @@ -6,12 +6,13 @@ class EntityXMLFileParser { + friend class EntityFile; public: EntityXMLFileParser(const EntityXMLFile* entityFile); +private: EntityID MergeEntities(World* world, EntityID baseParent = EntityID_Invalid); -private: const EntityXMLFile* m_EntityFile; EntityFileHandler m_Handler; World* m_World = nullptr; diff --git a/include/Engine/Core/EntityXMLFilePreprocessor.h b/include/Engine/Core/EntityXMLFilePreprocessor.h index e102ef79..4f969291 100644 --- a/include/Engine/Core/EntityXMLFilePreprocessor.h +++ b/include/Engine/Core/EntityXMLFilePreprocessor.h @@ -21,12 +21,13 @@ class EntityXMLFilePreprocessor { + friend class EntityFile; public: EntityXMLFilePreprocessor(const EntityXMLFile* entityFile); +private: void RegisterComponents(World* world); -private: const EntityXMLFile* m_EntityFile; std::map m_ComponentCounts; std::map m_ComponentInfo; diff --git a/include/Engine/Editor/EditorSystem.h b/include/Engine/Editor/EditorSystem.h index b565367a..655ac9b9 100644 --- a/include/Engine/Editor/EditorSystem.h +++ b/include/Engine/Editor/EditorSystem.h @@ -5,8 +5,7 @@ #include "../Core/World.h" #include "../Core/SystemPipeline.h" #include "../Core/ResourceManager.h" -#include "../Core/EntityXMLFilePreprocessor.h" -#include "../Core/EntityXMLFileParser.h" +#include "../Core/EntityFile.h" #include "../Core/EntityXMLFileWriter.h" #include "../Core/EMousePress.h" #include "../Input/EInputCommand.h" diff --git a/include/Game/Systems/AmmoPickupSystem.h b/include/Game/Systems/AmmoPickupSystem.h index 8e5c4f1d..70c5630f 100644 --- a/include/Game/Systems/AmmoPickupSystem.h +++ b/include/Game/Systems/AmmoPickupSystem.h @@ -4,7 +4,7 @@ #include "Core/System.h" #include "Core/Transform.h" #include "Core/ResourceManager.h" -#include "Core/EntityXMLFileParser.h" +#include "Core/EntityFile.h" #include "Core/EPickupSpawned.h" #include "Core/EAmmoPickup.h" #include "Engine/Collision/ETrigger.h" diff --git a/include/Game/Systems/BoostSystem.h b/include/Game/Systems/BoostSystem.h index 525918a4..f02e9472 100644 --- a/include/Game/Systems/BoostSystem.h +++ b/include/Game/Systems/BoostSystem.h @@ -3,7 +3,7 @@ #include "Core/System.h" #include "Core/ResourceManager.h" -#include "Core/EntityXMLFileParser.h" +#include "Core/EntityFile.h" #include "Core/EPlayerDamage.h" #include "Common.h" diff --git a/include/Game/Systems/DamageIndicatorSystem.h b/include/Game/Systems/DamageIndicatorSystem.h index 935089fa..9c88ba78 100644 --- a/include/Game/Systems/DamageIndicatorSystem.h +++ b/include/Game/Systems/DamageIndicatorSystem.h @@ -4,7 +4,7 @@ #include "Core/System.h" #include "Core/Transform.h" #include "Core/ResourceManager.h" -#include "Core/EntityXMLFileParser.h" +#include "Core/EntityFile.h" #include "Core/EPlayerDamage.h" #include "Common.h" #include diff --git a/include/Game/Systems/PickupSpawnSystem.h b/include/Game/Systems/PickupSpawnSystem.h index 1151b487..b72b8b25 100644 --- a/include/Game/Systems/PickupSpawnSystem.h +++ b/include/Game/Systems/PickupSpawnSystem.h @@ -4,7 +4,7 @@ #include "Core/System.h" #include "Core/Transform.h" #include "Core/ResourceManager.h" -#include "Core/EntityXMLFileParser.h" +#include "Core/EntityFile.h" #include "Core/EPickupSpawned.h" #include "Core/EPlayerHealthPickup.h" #include "Engine/Collision/ETrigger.h" diff --git a/include/Game/Systems/PlayerDeathSystem.h b/include/Game/Systems/PlayerDeathSystem.h index 96ed2ab5..e4f96114 100644 --- a/include/Game/Systems/PlayerDeathSystem.h +++ b/include/Game/Systems/PlayerDeathSystem.h @@ -6,10 +6,7 @@ #include "GLM.h" #include "Rendering/ESetCamera.h" #include "Core/ConfigFile.h" - -#include "Core/EntityXMLFile.h" -#include "Core/EntityXMLFileParser.h" - +#include "Core/EntityFile.h" #include "Core/EPlayerDeath.h" #include "Core/EEntityDeleted.h" diff --git a/include/Game/Systems/PlayerMovementSystem.h b/include/Game/Systems/PlayerMovementSystem.h index 8b6e4e54..bf7b4718 100644 --- a/include/Game/Systems/PlayerMovementSystem.h +++ b/include/Game/Systems/PlayerMovementSystem.h @@ -6,9 +6,7 @@ #include #include "Events/EDoubleJump.h" #include "../Engine/Sound/EPlaySoundOnEntity.h" - -#include "Core/EntityXMLFile.h" -#include "Core/EntityXMLFileParser.h" +#include "Core/EntityFile.h" class PlayerMovementSystem : public ImpureSystem { diff --git a/src/Engine/Editor/EditorSystem.cpp b/src/Engine/Editor/EditorSystem.cpp index 3e664161..62ddba88 100644 --- a/src/Engine/Editor/EditorSystem.cpp +++ b/src/Engine/Editor/EditorSystem.cpp @@ -2,6 +2,7 @@ #include "Core/UniformScaleSystem.h" #include "Editor/EditorRenderSystem.h" #include "Editor/EditorWidgetSystem.h" +#include "Core/EntityFile.h" EditorSystem::EditorSystem(SystemParams params, IRenderer* renderer, RenderFrame* renderFrame) : System(params) @@ -259,12 +260,10 @@ EntityWrapper EditorSystem::importEntity(EntityWrapper parent, boost::filesystem } try { - auto entityFile = ResourceManager::Load(filePath.string()); - EntityXMLFilePreprocessor fpp(entityFile); - fpp.RegisterComponents(parent.World); - EntityXMLFileParser fp(entityFile); - EntityID newEntity = fp.MergeEntities(parent.World, parent.ID); - return EntityWrapper(parent.World, newEntity); + auto entityFile = ResourceManager::Load(filePath.string()); + EntityWrapper newEntity = entityFile->MergeInto(parent.World); + parent.World->SetParent(newEntity.ID, parent.ID); + return newEntity; } catch (const std::exception& e) { LOG_ERROR("Failed to import entity \"%s\": \"%s\"", filePath.string().c_str(), e.what()); return EntityWrapper::Invalid; diff --git a/src/Game/Game.cpp b/src/Game/Game.cpp index 1a672f25..5e82dc2e 100644 --- a/src/Game/Game.cpp +++ b/src/Game/Game.cpp @@ -82,11 +82,8 @@ Game::Game(int argc, char* argv[]) m_World = new World(m_EventBroker); std::string mapToLoad = m_Config->Get("Debug.LoadMap", ""); if (!mapToLoad.empty()) { - auto file = ResourceManager::Load(mapToLoad); - EntityXMLFilePreprocessor fpp(file); - fpp.RegisterComponents(m_World); - EntityXMLFileParser fp(file); - fp.MergeEntities(m_World); + auto file = ResourceManager::Load(mapToLoad); + file->MergeInto(m_World); } // Create the sound manager diff --git a/src/Game/Systems/AmmoPickupSystem.cpp b/src/Game/Systems/AmmoPickupSystem.cpp index e3051efe..062efe94 100644 --- a/src/Game/Systems/AmmoPickupSystem.cpp +++ b/src/Game/Systems/AmmoPickupSystem.cpp @@ -20,17 +20,16 @@ void AmmoPickupSystem::Update(double dt) auto& somePickup = *it; somePickup.DecreaseThisRespawnTimer -= dt; if (somePickup.DecreaseThisRespawnTimer < 0.0) { - auto entityFile = ResourceManager::Load("Schema/Entities/AmmoPickup.xml"); - EntityXMLFileParser parser(entityFile); - EntityID ammoPickupID = parser.MergeEntities(m_World); + auto entityFile = ResourceManager::Load("Schema/Entities/AmmoPickup.xml"); + EntityWrapper ammoPickup = entityFile->MergeInto(m_World); //let the world know a pickup has spawned Events::PickupSpawned ePickupSpawned; - ePickupSpawned.Pickup = EntityWrapper(m_World, ammoPickupID); + ePickupSpawned.Pickup = ammoPickup; m_EventBroker->Publish(ePickupSpawned); //copy values from the old entity to the new entity - auto& newAmmoPickupEntity = EntityWrapper(m_World, ammoPickupID); + auto& newAmmoPickupEntity = ammoPickup; newAmmoPickupEntity["Transform"]["Position"] = somePickup.Pos; newAmmoPickupEntity["AmmoPickup"]["AmmoGain"] = somePickup.AmmoGain; newAmmoPickupEntity["AmmoPickup"]["RespawnTimer"] = somePickup.RespawnTimer; diff --git a/src/Game/Systems/BoostSystem.cpp b/src/Game/Systems/BoostSystem.cpp index 7f335d1f..c79576e4 100644 --- a/src/Game/Systems/BoostSystem.cpp +++ b/src/Game/Systems/BoostSystem.cpp @@ -38,11 +38,10 @@ bool BoostSystem::OnPlayerDamage(Events::PlayerDamage& e) m_World->DeleteEntity(playerBoostAssaultEntity.ID); } //load boost XML file, set it entity parented with the victim player - auto entityFile = ResourceManager::Load(classXML); - EntityXMLFileParser parser(entityFile); - EntityID boostAssaultEntity = parser.MergeEntities(m_World); - m_World->SetName(boostAssaultEntity, className); - m_World->SetParent(boostAssaultEntity, e.Victim.ID); + auto entityFile = ResourceManager::Load(classXML); + EntityWrapper boostAssaultEntity = entityFile->MergeInto(m_World); + m_World->SetName(boostAssaultEntity.ID, className); + m_World->SetParent(boostAssaultEntity.ID, e.Victim.ID); return true; } diff --git a/src/Game/Systems/DamageIndicatorSystem.cpp b/src/Game/Systems/DamageIndicatorSystem.cpp index 55a1046c..e68f741d 100644 --- a/src/Game/Systems/DamageIndicatorSystem.cpp +++ b/src/Game/Systems/DamageIndicatorSystem.cpp @@ -49,16 +49,14 @@ bool DamageIndicatorSystem::OnPlayerDamage(Events::PlayerDamage& e) float angleBetweenVectors = CalculateAngle(e.Victim, inflictorPos); //load & set the "2d" sprite - auto entityFile = ResourceManager::Load("Schema/Entities/DamageIndicator.xml"); - EntityXMLFileParser parser(entityFile); - EntityID spriteID = parser.MergeEntities(m_World); - m_World->SetParent(spriteID, m_CurrentCamera); - auto spriteWrapper = EntityWrapper(m_World, spriteID); + auto entityFile = ResourceManager::Load("Schema/Entities/DamageIndicator.xml"); + EntityWrapper sprite = entityFile->MergeInto(m_World); + m_World->SetParent(sprite.ID, m_CurrentCamera); //simply set the rotation z-wise to the angleBetweenVectors - spriteWrapper["Transform"]["Orientation"] = glm::vec3(0, 0, angleBetweenVectors); + sprite["Transform"]["Orientation"] = glm::vec3(0, 0, angleBetweenVectors); if (!IsServer) { - updateDamageIndicatorVector.emplace_back(spriteWrapper, inflictorPos); + updateDamageIndicatorVector.emplace_back(sprite, inflictorPos); } return true; diff --git a/src/Game/Systems/PickupSpawnSystem.cpp b/src/Game/Systems/PickupSpawnSystem.cpp index 9d1ce5b6..99da931f 100644 --- a/src/Game/Systems/PickupSpawnSystem.cpp +++ b/src/Game/Systems/PickupSpawnSystem.cpp @@ -18,17 +18,16 @@ void PickupSpawnSystem::Update(double dt) somePickup.DecreaseThisRespawnTimer -= dt; if (somePickup.DecreaseThisRespawnTimer < 0.0) { //spawn the new healthPickup - auto entityFile = ResourceManager::Load("Schema/Entities/HealthPickup.xml"); - EntityXMLFileParser parser(entityFile); - EntityID healthPickupID = parser.MergeEntities(m_World); + auto entityFile = ResourceManager::Load("Schema/Entities/HealthPickup.xml"); + EntityWrapper healthPickup = entityFile->MergeInto(m_World); //let the world know a pickup has spawned (graphics effects, etc) Events::PickupSpawned ePickupSpawned; - ePickupSpawned.Pickup = EntityWrapper(m_World, healthPickupID); + ePickupSpawned.Pickup = healthPickup; m_EventBroker->Publish(ePickupSpawned); //copy values from the old entity to the new entity - auto& newHealthPickupEntity = EntityWrapper(m_World, healthPickupID); + auto& newHealthPickupEntity = healthPickup; newHealthPickupEntity["Transform"]["Position"] = somePickup.Pos; newHealthPickupEntity["HealthPickup"]["HealthGain"] = somePickup.HealthGain; newHealthPickupEntity["HealthPickup"]["RespawnTimer"] = somePickup.RespawnTimer; diff --git a/src/Game/Systems/PlayerDeathSystem.cpp b/src/Game/Systems/PlayerDeathSystem.cpp index 1a491580..cbf0927f 100644 --- a/src/Game/Systems/PlayerDeathSystem.cpp +++ b/src/Game/Systems/PlayerDeathSystem.cpp @@ -28,10 +28,8 @@ bool PlayerDeathSystem::OnPlayerDeath(Events::PlayerDeath& e) void PlayerDeathSystem::createDeathEffect(EntityWrapper player) { //load the explosioneffect XML - auto deathEffect = ResourceManager::Load("Schema/Entities/PlayerDeathExplosionWithCamera.xml"); - EntityXMLFileParser parser(deathEffect); - EntityID deathEffectID = parser.MergeEntities(m_World); - EntityWrapper deathEffectEW = EntityWrapper(m_World, deathEffectID); + auto entityFile = ResourceManager::Load("Schema/Entities/PlayerDeathExplosionWithCamera.xml"); + EntityWrapper deathEffectEW = entityFile->MergeInto(m_World); //components that we need from player auto playerModel = player.FirstChildByName("PlayerModel"); diff --git a/src/Game/Systems/PlayerMovementSystem.cpp b/src/Game/Systems/PlayerMovementSystem.cpp index 5a687b84..802b5048 100644 --- a/src/Game/Systems/PlayerMovementSystem.cpp +++ b/src/Game/Systems/PlayerMovementSystem.cpp @@ -328,10 +328,8 @@ bool PlayerMovementSystem::OnDoubleJump(Events::DoubleJump & e) void PlayerMovementSystem::spawnHexagon(EntityWrapper target) { //put a hexagon at the entitys... feet? - auto hexagonEffect = ResourceManager::Load("Schema/Entities/DoubleJumpHexagon.xml"); - EntityXMLFileParser parser(hexagonEffect); - EntityID hexagonEffectID = parser.MergeEntities(m_World); - EntityWrapper hexagonEW = EntityWrapper(m_World, hexagonEffectID); + auto entityFile = ResourceManager::Load("Schema/Entities/DoubleJumpHexagon.xml"); + EntityWrapper hexagonEW = entityFile->MergeInto(m_World); hexagonEW["Transform"]["Position"] = (glm::vec3)target["Transform"]["Position"]; } @@ -342,10 +340,8 @@ bool PlayerMovementSystem::OnDashAbility(Events::DashAbility & e) return false; } - auto dashEffectResource = ResourceManager::Load("Schema/Entities/DashEffect.xml"); - EntityXMLFileParser parser(dashEffectResource); - EntityID dashEffectID = parser.MergeEntities(m_World); - EntityWrapper dashEffect(m_World, dashEffectID); + auto entityFile = ResourceManager::Load("Schema/Entities/DashEffect.xml"); + EntityWrapper dashEffect = entityFile->MergeInto(m_World); auto playerModel = player.FirstChildByName("PlayerModel"); auto playerEntityModel = playerModel["Model"]; auto playerEntityAnimation = playerModel["Animation"]; From 9a668ed7d7f298bfed7fa21114199ef88f3e0da5 Mon Sep 17 00:00:00 2001 From: sippeangelo Date: Wed, 2 Mar 2016 20:16:03 +0100 Subject: [PATCH 49/51] Now here's the real fix for the lag when loading entity files: CONSOLE SPAM --- include/Engine/Core/MemoryPool.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/include/Engine/Core/MemoryPool.h b/include/Engine/Core/MemoryPool.h index 053e75aa..da4af84e 100644 --- a/include/Engine/Core/MemoryPool.h +++ b/include/Engine/Core/MemoryPool.h @@ -118,9 +118,6 @@ public: else { m_ExtraMemory.push_back((char*)malloc(m_Stride)); //We should preferably not enter here to avoid performance issues. Set more numMaxElements in constructor instead. - if (!DisableMemoryPool::Value) { - LOG_DEBUG("Allocated slots exceed Pool size, extra memory allocated dynamically. Pool size: %u, dynamic size: %u.", m_NumSlots, m_ExtraMemory.size()); - } return m_ExtraMemory.back(); } } From 8b81ba9019b566ccca5315a5c6cea3b14f7cb15d Mon Sep 17 00:00:00 2001 From: Tleety Date: Wed, 2 Mar 2016 21:40:20 +0100 Subject: [PATCH 50/51] Some small fixes, also added new UI elements to Player --- resources/Schema/Components/Text.xml | 2 +- resources/Schema/Entities/Player.xml | 93 ++++++++++++++++++++++++++-- 2 files changed, 89 insertions(+), 6 deletions(-) diff --git a/resources/Schema/Components/Text.xml b/resources/Schema/Components/Text.xml index d38d3961..cda29b86 100644 --- a/resources/Schema/Components/Text.xml +++ b/resources/Schema/Components/Text.xml @@ -1,7 +1,7 @@ - + Fonts/DroidSans.ttf,64 true
diff --git a/resources/Schema/Entities/Player.xml b/resources/Schema/Entities/Player.xml index 28ace561..9fb563f8 100644 --- a/resources/Schema/Entities/Player.xml +++ b/resources/Schema/Entities/Player.xml @@ -132,7 +132,70 @@ - + + + + + + + + + + + + + + Textures/Core/White.png + false + + + + + + + + + + + + + + + + + Textures/Core/White.png + false + + + + + + + + + + + + + + + + + Textures/Core/White.png + false + + + + + + + + + + + + + @@ -196,7 +259,6 @@ 3 - 0.80222018197612788 @@ -231,6 +293,7 @@ 4 + 1 @@ -286,7 +349,7 @@ Textures/Core/UnitHexagon.png - + @@ -297,7 +360,8 @@ - + 1 + Textures/Core/UnitHexagon_Rotated.png @@ -306,7 +370,7 @@ - + @@ -369,6 +433,25 @@ + + + + + Models/Widgets/Arrows/Arrow9.mesh + + + + + + + + + + + + + + From 2d438060ddc5e396aa96b9c94e8ab60839c51911 Mon Sep 17 00:00:00 2001 From: Tleety Date: Wed, 2 Mar 2016 22:08:23 +0100 Subject: [PATCH 51/51] Player arrow change --- resources/Schema/Entities/Player.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/Schema/Entities/Player.xml b/resources/Schema/Entities/Player.xml index 9fb563f8..34692605 100644 --- a/resources/Schema/Entities/Player.xml +++ b/resources/Schema/Entities/Player.xml @@ -100,12 +100,12 @@ 1 - 100/100 Fonts/DroidSans.ttf,64 + @@ -437,7 +437,7 @@ - Models/Widgets/Arrows/Arrow9.mesh + Models/Widgets/Arrows/Arrow5.mesh @@ -447,7 +447,7 @@ - +