From 4b8f4981a36f819512c1faf535bd29f5d6dd2c4f Mon Sep 17 00:00:00 2001 From: antc13 Date: Thu, 11 Feb 2016 00:05:27 +0100 Subject: [PATCH 01/25] New Map with Meshes, WIP. --- assets | 2 +- resources/Schema/Entities/NewMap.xml | 1287 +++++++- resources/Schema/Entities/NewMapBackup.xml | 3222 ++++++++++++++++++++ resources/Schema/Entities/StoneWall.xml | 147 + 4 files changed, 4591 insertions(+), 67 deletions(-) create mode 100644 resources/Schema/Entities/NewMapBackup.xml create mode 100644 resources/Schema/Entities/StoneWall.xml diff --git a/assets b/assets index e0ad8b8d..c56f6380 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit e0ad8b8d45a79b8f17876f9541cc5e03758ae16c +Subproject commit c56f6380ab05c23419beafe14190013d1432e32c diff --git a/resources/Schema/Entities/NewMap.xml b/resources/Schema/Entities/NewMap.xml index a79fee7b..8a5227aa 100644 --- a/resources/Schema/Entities/NewMap.xml +++ b/resources/Schema/Entities/NewMap.xml @@ -134,7 +134,7 @@ - + @@ -199,7 +199,7 @@ Models/Props/Pillars/SciFiPillar1.mesh - + @@ -213,7 +213,7 @@ Models/Props/Pillars/SciFiPillar1.mesh - + @@ -292,7 +292,7 @@ Models/Props/Pillars/SciFiPillar2.mesh - + @@ -338,7 +338,7 @@ Models/Props/Walls/BigWall.mesh - + @@ -363,7 +363,7 @@ Models/Props/Walls/BigWall.mesh - + @@ -388,7 +388,8 @@ Models/Props/Walls/BigWall.mesh - + + @@ -413,7 +414,8 @@ Models/Props/Walls/BigWall.mesh - + + @@ -438,7 +440,7 @@ Models/Props/Walls/BigWall.mesh - + @@ -713,8 +715,8 @@ Models/Props/Walls/MediumWall3.mesh - - + + @@ -725,7 +727,7 @@ Models/Props/Walls/MediumWall3.mesh - + @@ -737,7 +739,7 @@ Models/Props/Walls/MediumWall3.mesh - + @@ -801,7 +803,8 @@ Models/Props/Walls/BigWall.mesh - + + @@ -813,7 +816,7 @@ Models/Props/Walls/BigWall.mesh - + @@ -966,7 +969,7 @@ Models/Props/Walls/BigWall.mesh - + @@ -1136,6 +1139,247 @@ + + + + + Models/Props/Walls/BigWall.mesh + + + + + + + + + + + Models/Props/Walls/BigWall.mesh + + + + + + + + + + + + Models/Props/Walls/BigWall.mesh + + + + + + + + + + + + + + Models/Props/Walls/BigWall.mesh + + + + + + + + + + + + Models/Props/Walls/BigWall.mesh + + + + + + + + + + + + + + Models/Props/Walls/BigWall.mesh + + + + + + + + + + + + Models/Props/Walls/BigWall.mesh + + + + + + + + + + + + Models/Props/Walls/SmallWall2.mesh + + + + + + + + + + + + Models/Props/Walls/BigWall.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 + + + + + + + + @@ -1150,8 +1394,8 @@ Models/Props/Bridges/WoodenBridge.mesh - - + + @@ -1178,8 +1422,8 @@ Models/Props/Bridges/WoodenBridge.mesh - - + + @@ -1205,12 +1449,118 @@ Models/Props/Bridges/SciFiBridge.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 + + + + + + + + + + + + + + @@ -1254,7 +1604,7 @@ Models/Props/Pillars/SciFiBridgePillar1.mesh - + @@ -1506,7 +1856,7 @@ true - + @@ -1517,7 +1867,7 @@ true - + @@ -1529,7 +1879,7 @@ true - + @@ -1541,7 +1891,7 @@ true - + @@ -1553,7 +1903,7 @@ true - + @@ -1565,7 +1915,7 @@ true - + @@ -1612,6 +1962,227 @@ + + + + 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 + + + + + + + + + @@ -1679,7 +2250,8 @@ Models/Props/Stones/MediumStone1.mesh - + + @@ -1717,8 +2289,8 @@ Models/Props/Stones/MediumStone1.mesh - - + + @@ -1730,8 +2302,8 @@ Models/Props/Stones/MediumStone1.mesh - - + + @@ -1756,7 +2328,7 @@ Models/Props/Stones/MediumStone1.mesh - + @@ -1768,21 +2340,8 @@ Models/Props/Stones/MediumStone1.mesh - - - - - - - - - - - Models/Props/Stones/BigStone.mesh - - - - + + @@ -1794,7 +2353,7 @@ Models/Props/Stones/MediumStone1.mesh - + @@ -1819,7 +2378,7 @@ Models/Props/Stones/MediumStone1.mesh - + @@ -2093,6 +2652,226 @@ + + + + + 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/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystal.mesh + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystal.mesh + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystal.mesh + + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + @@ -2107,7 +2886,7 @@ Models/Props/PickUps/PickUpHolder.mesh - + @@ -2184,6 +2963,168 @@ + + + + + + + + + + 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 + + + + + + + + + + @@ -2193,9 +3134,6 @@ - - - @@ -2203,7 +3141,8 @@ Models/Props/CapturePoint.mesh - + + true @@ -2219,13 +3158,13 @@ - 1 Models/Props/CapturePoint.mesh - + + true @@ -2237,12 +3176,13 @@ - 2 Models/Props/CapturePoint.mesh + + true @@ -2254,13 +3194,13 @@ - 3 Models/Props/CapturePoint.mesh - + + true @@ -2272,7 +3212,6 @@ - @@ -2281,7 +3220,8 @@ Models/Props/CapturePoint.mesh - + + true @@ -2373,7 +3313,7 @@ 1 - + @@ -2386,11 +3326,226 @@ Models/Characters/Assault/AssaultTPose.mesh - + + + + + + Schema/Entities/Player.xml + + + + + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + + + + diff --git a/resources/Schema/Entities/NewMapBackup.xml b/resources/Schema/Entities/NewMapBackup.xml new file mode 100644 index 00000000..15ec64cf --- /dev/null +++ b/resources/Schema/Entities/NewMapBackup.xml @@ -0,0 +1,3222 @@ + + + + + + + + + + + + + + + + + + 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/Pillars/SciFiPillar1.mesh + + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar1.mesh + + + + + + + + + + + + + + Models/Props/Pillars/StonePillar.mesh + + + + + + + + + + + + Models/Props/Pillars/StonePillar.mesh + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar2.mesh + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar3.mesh + + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar1.mesh + + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar1.mesh + + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar3.mesh + + + + + + + + + + + + + + Models/Props/Pillars/StonePillar.mesh + + + + + + + + + + + + Models/Props/Pillars/StonePillar.mesh + + + + + + + + + + + + + Models/Props/Pillars/StonePillar.mesh + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar2.mesh + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar2.mesh + + + + + + + + + + + + + Models/Props/Pillars/StonePillar.mesh + + + + + + + + + + + Models/Props/Pillars/StonePillar.mesh + + + + + + + + + + + + + + + + + + + + + + Models/Props/Walls/BigWall.mesh + + + + + + + + + + + Models/Props/Walls/BigWall.mesh + + + + + + + + + + + + + + Models/Props/Walls/BigWall.mesh + + + + + + + + + + + Models/Props/Walls/BigWall.mesh + + + + + + + + + + + + + + Models/Props/Walls/BigWall.mesh + + + + + + + + + + + + Models/Props/Walls/BigWall.mesh + + + + + + + + + + + + + + Models/Props/Walls/BigWall.mesh + + + + + + + + + + + + Models/Props/Walls/BigWall.mesh + + + + + + + + + + + + + + Models/Props/Walls/BigWall.mesh + + + + + + + + + + + + Models/Props/Walls/BigWall.mesh + + + + + + + + + + + + + + Models/Props/Walls/BigWall.mesh + + + + + + + + + + + + + + + + Models/Props/Walls/BigWall.mesh + + + + + + + + + + + + Models/Props/Walls/BigWall.mesh + + + + + + + + + + + + + Models/Props/Walls/BigWall.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/MediumWall3.mesh + + + + + + + + + + + + Models/Props/Walls/MediumWall3.mesh + + + + + + + + + + + + Models/Props/Walls/MediumWall3.mesh + + + + + + + + + + + + + + Models/Props/Walls/BigWall.mesh + + + + + + + + + + + Models/Props/Walls/BigWall.mesh + + + + + + + + + + + + Models/Props/Walls/BigWall.mesh + + + + + + + + + + + Models/Props/Walls/BigWall.mesh + + + + + + + + + + + + + + + + Models/Props/Walls/BigWall.mesh + + + + + + + + + + + + + Models/Props/Walls/BigWall.mesh + + + + + + + + + + + + + + Models/Props/Walls/BigWall.mesh + + + + + + + + + + + Models/Props/Walls/BigWall.mesh + + + + + + + + + + + + Models/Props/Walls/BigWall.mesh + + + + + + + + + + + + Models/Props/Walls/BigWall.mesh + + + + + + + + + + + + + + Models/Props/Walls/BigWall.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/BigWall.mesh + + + + + + + + + + + Models/Props/Walls/BigWall.mesh + + + + + + + + + + + Models/Props/Walls/BigWall.mesh + + + + + + + + + + + + + + Models/Props/Walls/SmallWall2.mesh + + + + + + + + + + + + + + Models/Props/Walls/SmallWall2.mesh + + + + + + + + + + + Models/Props/Walls/BigWall.mesh + + + + + + + + + + + Models/Props/Walls/BigWall.mesh + + + + + + + + + + + + + + + + Models/Props/Walls/BigWall.mesh + + + + + + + + + + + Models/Props/Walls/BigWall.mesh + + + + + + + + + + + + Models/Props/Walls/BigWall.mesh + + + + + + + + + + + + Models/Props/Walls/BigWall.mesh + + + + + + + + + + + + + + Models/Props/Walls/BigWall.mesh + + + + + + + + + + + + Models/Props/Walls/BigWall.mesh + + + + + + + + + + + + + + + Models/Props/Walls/MediumWall3.mesh + + + + + + + + + + + + + Models/Props/Walls/BigWall.mesh + + + + + + + + + + + Models/Props/Walls/BigWall.mesh + + + + + + + + + + + + Models/Props/Walls/BigWall.mesh + + + + + + + + + + + + + + Models/Props/Walls/BigWall.mesh + + + + + + + + + + + + Models/Props/Walls/BigWall.mesh + + + + + + + + + + + + + + Models/Props/Walls/BigWall.mesh + + + + + + + + + + + + Models/Props/Walls/BigWall.mesh + + + + + + + + + + + + Models/Props/Walls/SmallWall2.mesh + + + + + + + + + + + + Models/Props/Walls/BigWall.mesh + + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + Models/Props/Walls/SpecialWall1.mesh + + + + + + + + + + + + + Models/Props/Flora/SpecialRoot.mesh + + + + + + + + + + + + + + + + + + + + Models/Props/Bridges/WoodenBridge.mesh + + + + + + + + + + + + + + Models/Props/Bridges/WoodenBridge.mesh + + + + + + + + + + + + + + Models/Props/Bridges/WoodenBridge.mesh + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridge.mesh + + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridge.mesh + + + + + + + + + + + + + + Models/Props/Flora/TreeLog.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/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/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/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/MediumStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + Models/Props/Stones/MediumStone1.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/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + Models/Props/Stones/MediumStone1.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/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/BigStone.mesh + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystal.mesh + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystal.mesh + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystal.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/CapturePoint.mesh + + true + + + + + + + + + + + + + + + + + + 1 + + + Models/Props/CapturePoint.mesh + + true + + + + + + + + + + + + + + 2 + + + Models/Props/CapturePoint.mesh + + true + + + + + + + + + + + + + + 3 + + + Models/Props/CapturePoint.mesh + + true + + + + + + + + + + + + + + + + + 4 + + + Models/Props/CapturePoint.mesh + + true + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + 10 + + + + + + + + + + 10 + + + + + + + + + + + + + 10 + + + + + + + + + + + 10 + + + + + + + + + + + 10 + + + + + + + + + + + 1 + + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + + + + + + + + + + + + Schema/Entities/Player.xml + + + + + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + + + + + + + diff --git a/resources/Schema/Entities/StoneWall.xml b/resources/Schema/Entities/StoneWall.xml new file mode 100644 index 00000000..e578d339 --- /dev/null +++ b/resources/Schema/Entities/StoneWall.xml @@ -0,0 +1,147 @@ + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + From 2f640d224ced2eb89b32762a1351e964ea938a0b Mon Sep 17 00:00:00 2001 From: antc13 Date: Thu, 11 Feb 2016 12:23:20 +0100 Subject: [PATCH 02/25] New Map with Meshes WIP --- resources/Schema/Entities/NewMap.xml | 65 ++++++++++++++-------------- 1 file changed, 33 insertions(+), 32 deletions(-) diff --git a/resources/Schema/Entities/NewMap.xml b/resources/Schema/Entities/NewMap.xml index 8a5227aa..7a1d620b 100644 --- a/resources/Schema/Entities/NewMap.xml +++ b/resources/Schema/Entities/NewMap.xml @@ -338,7 +338,7 @@ Models/Props/Walls/BigWall.mesh - + @@ -349,6 +349,7 @@ Models/Props/Walls/BigWall.mesh + @@ -363,7 +364,7 @@ Models/Props/Walls/BigWall.mesh - + @@ -440,7 +441,7 @@ Models/Props/Walls/BigWall.mesh - + @@ -452,7 +453,7 @@ Models/Props/Walls/BigWall.mesh - + @@ -466,7 +467,7 @@ Models/Props/Walls/BigWall.mesh - + @@ -482,7 +483,7 @@ Models/Props/Walls/BigWall.mesh - + @@ -494,7 +495,7 @@ Models/Props/Walls/BigWall.mesh - + @@ -507,7 +508,7 @@ Models/Props/Walls/BigWall.mesh - + @@ -753,7 +754,7 @@ Models/Props/Walls/BigWall.mesh - + @@ -764,7 +765,7 @@ Models/Props/Walls/BigWall.mesh - + @@ -776,7 +777,7 @@ Models/Props/Walls/BigWall.mesh - + @@ -803,7 +804,7 @@ Models/Props/Walls/BigWall.mesh - + @@ -830,7 +831,7 @@ Models/Props/Walls/BigWall.mesh - + @@ -841,7 +842,7 @@ Models/Props/Walls/BigWall.mesh - + @@ -853,7 +854,7 @@ Models/Props/Walls/BigWall.mesh - + @@ -879,7 +880,7 @@ Models/Props/Walls/BigWall.mesh - + @@ -1030,7 +1031,7 @@ Models/Props/Walls/BigWall.mesh - + @@ -1057,7 +1058,7 @@ Models/Props/Walls/BigWall.mesh - + @@ -1068,7 +1069,7 @@ Models/Props/Walls/BigWall.mesh - + @@ -1080,7 +1081,7 @@ Models/Props/Walls/BigWall.mesh - + @@ -1092,7 +1093,7 @@ Models/Props/Walls/BigWall.mesh - + @@ -1106,7 +1107,7 @@ Models/Props/Walls/BigWall.mesh - + @@ -1118,7 +1119,7 @@ Models/Props/Walls/BigWall.mesh - + @@ -1183,7 +1184,7 @@ Models/Props/Walls/BigWall.mesh - + @@ -1195,7 +1196,7 @@ Models/Props/Walls/BigWall.mesh - + @@ -1449,7 +1450,7 @@ Models/Props/Bridges/SciFiBridge.mesh - + @@ -1462,7 +1463,7 @@ Models/Props/Bridges/SciFiBridgeDefense.mesh - + @@ -1515,7 +1516,7 @@ Models/Props/Bridges/SciFiBridgeDefense.mesh - + @@ -1604,7 +1605,7 @@ Models/Props/Pillars/SciFiBridgePillar1.mesh - + @@ -2886,9 +2887,9 @@ Models/Props/PickUps/PickUpHolder.mesh - + - + @@ -3117,7 +3118,7 @@ Models/Props/SciFiHolder1.mesh - + From 8eea0c83953dc84be7e9769d1bb9a080be29e0b1 Mon Sep 17 00:00:00 2001 From: William Moberg Date: Thu, 11 Feb 2016 16:08:19 +0100 Subject: [PATCH 03/25] WIP respawning. --- include/Game/Systems/PlayerSpawnSystem.h | 13 ++- resources/DefaultConfig.ini | 1 + resources/Schema/Entities/MovementTest.xml | 117 --------------------- src/Game/Game.cpp | 3 +- src/Game/Systems/PlayerDeathSystem.cpp | 15 ++- src/Game/Systems/PlayerSpawnSystem.cpp | 76 ++++++++++++- src/Game/Systems/SoundSystem.cpp | 4 +- 7 files changed, 101 insertions(+), 128 deletions(-) diff --git a/include/Game/Systems/PlayerSpawnSystem.h b/include/Game/Systems/PlayerSpawnSystem.h index f5aa7b82..681620bb 100644 --- a/include/Game/Systems/PlayerSpawnSystem.h +++ b/include/Game/Systems/PlayerSpawnSystem.h @@ -13,6 +13,8 @@ public: PlayerSpawnSystem(World* world, EventBroker* eventBroker); virtual void Update(double dt) override; + + static void SetRespawnTime(float respawnTime) { m_RespawnTime = respawnTime; }; private: struct SpawnRequest @@ -23,10 +25,19 @@ private: bool m_NetworkEnabled = false; std::vector m_SpawnRequests; + + //Player ID -> EntityWrapper. std::map m_PlayerEntities; + //EntityWrapper ID -> Player ID. + std::map m_PlayerIDs; + + static float m_RespawnTime; + float m_Timer; EventRelay m_OnInputCommand; - bool OnInputCommand(const Events::InputCommand& e); + bool OnInputCommand(Events::InputCommand& e); EventRelay m_OnPlayerSpawnerd; bool OnPlayerSpawned(Events::PlayerSpawned& e); + EventRelay m_OnPlayerDeath; + bool OnPlayerDeath(Events::PlayerDeath& e); }; \ No newline at end of file diff --git a/resources/DefaultConfig.ini b/resources/DefaultConfig.ini index 12ec06c8..1b4fffc8 100644 --- a/resources/DefaultConfig.ini +++ b/resources/DefaultConfig.ini @@ -4,6 +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 [Editor] CameraSpeed=3 diff --git a/resources/Schema/Entities/MovementTest.xml b/resources/Schema/Entities/MovementTest.xml index b8b68ef1..e7bbf236 100644 --- a/resources/Schema/Entities/MovementTest.xml +++ b/resources/Schema/Entities/MovementTest.xml @@ -120,123 +120,6 @@ - - - - - - - - - - false - - - 5 - - - - - - - - - - - - - - - - - - - - - - - - Fonts/DroidSans.ttf,100 - - false - - - - - - - - - - - - - Models/Widgets/Camera.mesh - - - - - - - - - - - - - - - Models/Widgets/Camera.mesh - false - - - - - - - - - - - - Models/Characters/Assault/AssaultHeadless.mesh - - - - - - - - - - - - Models/Core/UnitCube.mesh - - false - - - - - - - - - - - - Models/Core/UnitCube.mesh - - false - - - - - - - - - diff --git a/src/Game/Game.cpp b/src/Game/Game.cpp index 95310952..6d8933da 100644 --- a/src/Game/Game.cpp +++ b/src/Game/Game.cpp @@ -34,6 +34,7 @@ Game::Game(int argc, char* argv[]) ResourceManager::UseThreading = m_Config->Get("Multithreading.ResourceLoading", true); DisableMemoryPool::Value = m_Config->Get("Debug.DisableMemoryPool", false); LOG_LEVEL = static_cast<_LOG_LEVEL>(m_Config->Get("Debug.LogLevel", 1)); + PlayerSpawnSystem::SetRespawnTime(m_Config->Get("Debug.RespawnTime", 15.0f)); // Create the core event broker m_EventBroker = new EventBroker(); @@ -97,7 +98,6 @@ 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_Renderer); m_SystemPipeline->AddSystem(updateOrderLevel); m_SystemPipeline->AddSystem(updateOrderLevel); @@ -109,6 +109,7 @@ Game::Game(int argc, char* argv[]) m_SystemPipeline->AddSystem(updateOrderLevel, m_OctreeFrustrumCulling); m_SystemPipeline->AddSystem(updateOrderLevel); m_SystemPipeline->AddSystem(updateOrderLevel); + m_SystemPipeline->AddSystem(updateOrderLevel); // Collision and TriggerSystem should update after player. ++updateOrderLevel; diff --git a/src/Game/Systems/PlayerDeathSystem.cpp b/src/Game/Systems/PlayerDeathSystem.cpp index 60c31ce5..021056fd 100644 --- a/src/Game/Systems/PlayerDeathSystem.cpp +++ b/src/Game/Systems/PlayerDeathSystem.cpp @@ -34,14 +34,23 @@ void PlayerDeathSystem::createDeathEffect(EntityWrapper player) //components that we need from player auto playerCamera = player.FirstChildByName("Camera"); - auto playerEntityModel = player.FirstChildByName("PlayerModel")["Model"]; - auto playerEntityAnimation = player.FirstChildByName("PlayerModel")["Animation"]; + auto playerModel = player.FirstChildByName("PlayerModel"); + if (!playerCamera.Valid() || !playerModel.Valid()) { + return; + } + if (!playerModel.HasComponent("Model") || !playerModel.HasComponent("Animation")) { + return; + } + auto playerEntityModel = playerModel["Model"]; + auto playerEntityAnimation = playerModel["Animation"]; //copy the data from player to explisioneffectmodel playerEntityModel.Copy(deathEffectEW["Model"]); playerEntityAnimation.Copy(deathEffectEW["Animation"]); //freeze the animation - deathEffectEW["Animation"]["Speed"] = 0.0; + deathEffectEW["Animation"]["Speed1"] = 0.0; + deathEffectEW["Animation"]["Speed2"] = 0.0; + deathEffectEW["Animation"]["Speed3"] = 0.0; //copy the models position,orientation deathEffectEW["Transform"]["Position"] = (glm::vec3)player["Transform"]["Position"]; diff --git a/src/Game/Systems/PlayerSpawnSystem.cpp b/src/Game/Systems/PlayerSpawnSystem.cpp index 5f46cce3..0ca7bbac 100644 --- a/src/Game/Systems/PlayerSpawnSystem.cpp +++ b/src/Game/Systems/PlayerSpawnSystem.cpp @@ -1,20 +1,39 @@ #include "Systems/PlayerSpawnSystem.h" +//This should be set by the config anyway. +float PlayerSpawnSystem::m_RespawnTime = 15.0f; + PlayerSpawnSystem::PlayerSpawnSystem(World* m_World, EventBroker* eventBroker) : System(m_World, eventBroker) + , m_Timer(0.f) { EVENT_SUBSCRIBE_MEMBER(m_OnInputCommand, &PlayerSpawnSystem::OnInputCommand); EVENT_SUBSCRIBE_MEMBER(m_OnPlayerSpawnerd, &PlayerSpawnSystem::OnPlayerSpawned); + EVENT_SUBSCRIBE_MEMBER(m_OnPlayerDeath, &PlayerSpawnSystem::OnPlayerDeath); m_NetworkEnabled = ResourceManager::Load("Config.ini")->Get("Networking.StartNetwork", false); } void PlayerSpawnSystem::Update(double dt) { + //Increase timer. + m_Timer += dt; + if (m_Timer < m_RespawnTime) { + return; + } + //If respawn time has passed, we spawn all players that have requested to be spawned. + m_Timer = 0.f; + + //If there are no spawn requests, return immediately, if we are client the SpawnRequests should always be empty. + if (m_SpawnRequests.size() == 0) { + return; + } + auto playerSpawns = m_World->GetComponents("PlayerSpawn"); if (playerSpawns == nullptr) { return; } + int numSpawnedPlayers = 0; for (auto& req : m_SpawnRequests) { for (auto& cPlayerSpawn : *playerSpawns) { EntityWrapper spawner(m_World, cPlayerSpawn.EntityID); @@ -40,13 +59,19 @@ void PlayerSpawnSystem::Update(double dt) e.Player = player; e.Spawner = spawner; m_EventBroker->Publish(e); - + ++numSpawnedPlayers; + break; } } + if (numSpawnedPlayers != (int)m_SpawnRequests.size()) { + LOG_DEBUG("%i players were supposed to be spawned, but %i was spawned.", (int)m_SpawnRequests.size(), numSpawnedPlayers); + } else { + LOG_DEBUG("%i players were spawned.", numSpawnedPlayers); + } m_SpawnRequests.clear(); } -bool PlayerSpawnSystem::OnInputCommand(const Events::InputCommand& e) +bool PlayerSpawnSystem::OnInputCommand(Events::InputCommand& e) { if (e.Command != "PickTeam") { return false; @@ -58,11 +83,37 @@ bool PlayerSpawnSystem::OnInputCommand(const Events::InputCommand& e) return false; } - if (e.Value != 0) { + if (e.Value == 0) { + return false; + } + + //TODO: Spectating? + if (e.Player.Valid() && e.Player.HasComponent("Team")) { + ComponentWrapper cTeam = e.Player["Team"]; + if ((ComponentInfo::EnumType)e.Value == cTeam["Team"].Enum("Spectator")) { + return false; + } + } + + auto iter = m_SpawnRequests.begin(); + for (; iter != m_SpawnRequests.end(); ++iter) { + if (iter->PlayerID == e.PlayerID) { + break; + } + } + + if (iter != m_SpawnRequests.end()) { + //If player is in queue to spawn, then change their team affiliation. + 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. SpawnRequest req; req.PlayerID = e.PlayerID; req.Team = (ComponentInfo::EnumType)e.Value; m_SpawnRequests.push_back(req); + } else { + return false; } return true; @@ -82,6 +133,7 @@ bool PlayerSpawnSystem::OnPlayerSpawned(Events::PlayerSpawned& e) // Store the player for future reference m_PlayerEntities[e.PlayerID] = e.Player; + m_PlayerIDs[e.Player.ID] = e.PlayerID; // Set the camera to the correct entity EntityWrapper cameraEntity = e.Player.FirstChildByName("Camera"); @@ -110,4 +162,20 @@ bool PlayerSpawnSystem::OnPlayerSpawned(Events::PlayerSpawned& e) } return true; -} \ No newline at end of file +} + +bool PlayerSpawnSystem::OnPlayerDeath(Events::PlayerDeath& e) +{ + if (!e.Player.HasComponent("Team")) { + return false; + } + ComponentWrapper cTeam = e.Player["Team"]; + //A spectator can't die anyway + if ((ComponentInfo::EnumType)cTeam["Team"] == cTeam["Team"].Enum("Spectator")) { + return false; + } + SpawnRequest req; + req.PlayerID = m_PlayerIDs[e.Player.ID]; + req.Team = cTeam["Team"]; + m_SpawnRequests.push_back(req); +} diff --git a/src/Game/Systems/SoundSystem.cpp b/src/Game/Systems/SoundSystem.cpp index e3aa49b2..7026bfd3 100644 --- a/src/Game/Systems/SoundSystem.cpp +++ b/src/Game/Systems/SoundSystem.cpp @@ -57,10 +57,10 @@ bool SoundSystem::OnInputCommand(const Events::InputCommand & e) return true; } } - if (e.Command == "TakeDamage" && e.Value > 0) { + if (e.Command == "TakeDamage" && e.Value > 0 && m_LocalPlayer.Valid()) { Events::PlayerDamage ev; ev.Player = m_LocalPlayer; - ev.Damage = 1.0; + ev.Damage = e.Value; m_EventBroker->Publish(ev); } From 1d14094e903ca7baa09263fcea33a52cb298232e Mon Sep 17 00:00:00 2001 From: antc13 Date: Thu, 11 Feb 2016 16:52:10 +0100 Subject: [PATCH 04/25] NewMap Updated. Still WIP --- assets | 2 +- resources/Schema/Entities/NewMap.xml | 422 ++++++++++++++++++++++----- 2 files changed, 353 insertions(+), 71 deletions(-) diff --git a/assets b/assets index c56f6380..66e2a73b 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit c56f6380ab05c23419beafe14190013d1432e32c +Subproject commit 66e2a73bdb2c385cac37476980809cc587e2e612 diff --git a/resources/Schema/Entities/NewMap.xml b/resources/Schema/Entities/NewMap.xml index 7a1d620b..f4c768f0 100644 --- a/resources/Schema/Entities/NewMap.xml +++ b/resources/Schema/Entities/NewMap.xml @@ -104,6 +104,100 @@ + + + + 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 + + + + + + + @@ -1436,12 +1530,117 @@ Models/Props/Bridges/SciFiBridge.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 + + + + + + + + + + + + + + @@ -1591,9 +1790,9 @@ Models/Props/Pillars/SciFiBridgePillar1.mesh - + - + @@ -2901,9 +3100,9 @@ Models/Props/PickUps/PickUpHolder.mesh - + - + @@ -3124,6 +3323,19 @@ + + + + + Models/Props/SciFiHolder1.mesh + + + + + + + + @@ -3135,106 +3347,176 @@ - - - - - + - Models/Props/CapturePoint.mesh - - true + Models/Props/CapturePoint/CapturePointBlue.mesh - - - - - - + - - + + + + + + + + + + Models/Core/UnitCylinder.mesh + + true + + + + + + + + + + + + + + + - - 1 - + - Models/Props/CapturePoint.mesh - - true + Models/Props/CapturePoint/CapturePointNeutral.mesh - - + - - + + + + + 1 + + + Models/Core/UnitCylinder.mesh + + true + + + + + + + + + + + - - 2 - + - Models/Props/CapturePoint.mesh - - true + Models/Props/CapturePoint/CapturePointNeutral.mesh - - + - - + + + + + 2 + + + Models/Core/UnitCylinder.mesh + + true + + + + + + + + + + + - - 3 - + - Models/Props/CapturePoint.mesh - - true + Models/Props/CapturePoint/CapturePointNeutral.mesh - - + - - + + + + + 3 + + + Models/Core/UnitCylinder.mesh + + true + + + + + + + + + + + - - - - - 4 - + - Models/Props/CapturePoint.mesh - - true + Models/Props/CapturePoint/CapturePointNeutral.mesh - - - - - - + - - + + + + + + + + 4 + + + Models/Core/UnitCylinder.mesh + + true + + + + + + + + + + + + + + + From e47201ff6108627fc7997bf7aa5e22f2658b70d8 Mon Sep 17 00:00:00 2001 From: sippeangelo Date: Thu, 11 Feb 2016 17:06:34 +0100 Subject: [PATCH 05/25] First person shoot animations --- .../Systems/Weapon/AssaultWeaponBehaviour.h | 34 ++++ include/Game/Systems/Weapon/WeaponBehaviour.h | 31 +++ include/Game/Systems/Weapon/WeaponSystem.h | 46 +++++ include/Game/Systems/WeaponSystem.h | 192 ------------------ resources/Schema/Components/AssaultWeapon.xml | 1 + resources/Schema/Components/AssaultWeapon.xsd | 3 + resources/Schema/Components/Player.xml | 1 + resources/Schema/Components/Player.xsd | 3 +- src/Engine/Rendering/AnimationSystem.cpp | 21 +- src/Game/CMakeLists.txt | 7 + src/Game/Game.cpp | 2 +- src/Game/Systems/PlayerMovementSystem.cpp | 3 +- .../Systems/Weapon/AssaultWeaponBehaviour.cpp | 190 +++++++++++++++++ .../Systems/{ => Weapon}/WeaponSystem.cpp | 5 +- 14 files changed, 338 insertions(+), 201 deletions(-) create mode 100644 include/Game/Systems/Weapon/AssaultWeaponBehaviour.h create mode 100644 include/Game/Systems/Weapon/WeaponBehaviour.h create mode 100644 include/Game/Systems/Weapon/WeaponSystem.h delete mode 100644 include/Game/Systems/WeaponSystem.h create mode 100644 src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp rename src/Game/Systems/{ => Weapon}/WeaponSystem.cpp (97%) diff --git a/include/Game/Systems/Weapon/AssaultWeaponBehaviour.h b/include/Game/Systems/Weapon/AssaultWeaponBehaviour.h new file mode 100644 index 00000000..58d7755f --- /dev/null +++ b/include/Game/Systems/Weapon/AssaultWeaponBehaviour.h @@ -0,0 +1,34 @@ +#include "Sound/EPlaySoundOnEntity.h" +#include "Rendering/AnimationSystem.h" +#include "WeaponBehaviour.h" +#include "../SpawnerSystem.h" + +class AssaultWeaponBehaviour : public WeaponBehaviour +{ +public: + AssaultWeaponBehaviour(SystemParams systemParams, Octree* collisionOctree, EntityWrapper weaponEntity); + + virtual void Fire() override; + virtual void CeaseFire() override; + virtual void Reload() override; + + virtual void Update(double dt) override; + +private: + EntityWrapper m_FirstPersonModel; + // State + bool m_Firing = false; + bool m_Reloading = false; + double m_TimeSinceLastFire = 0.0; + + EventRelay m_EAnimationComplete; + bool OnAnimationComplete(Events::AnimationComplete& e); + + void fireRound(); + void spawnTracer(); + float traceRayDistance(glm::vec3 origin, glm::vec3 direction); + void playSound(); + void viewPunch(); + void playShootAnimation(); + void playIdleAnimation(); +}; diff --git a/include/Game/Systems/Weapon/WeaponBehaviour.h b/include/Game/Systems/Weapon/WeaponBehaviour.h new file mode 100644 index 00000000..38ab5f58 --- /dev/null +++ b/include/Game/Systems/Weapon/WeaponBehaviour.h @@ -0,0 +1,31 @@ +#ifndef WeaponBehaviour_h__ +#define WeaponBehaviour_h__ + +#include "Core/System.h" +#include "Core/Octree.h" +#include "Collision/EntityAABB.h" + +class WeaponBehaviour : public System +{ +public: + WeaponBehaviour(SystemParams systemParams, Octree* collisionOctree, EntityWrapper weaponEntity) + : System(systemParams) + , m_CollisionOctree(collisionOctree) + , m_Entity(weaponEntity) + { } + virtual ~WeaponBehaviour() = default; + + WeaponBehaviour(const WeaponBehaviour&) = delete; + WeaponBehaviour& operator=(const WeaponBehaviour &) = delete; + + virtual void Fire() = 0; + virtual void CeaseFire() { } + virtual void Reload() { } + virtual void Update(double dt) { } + +protected: + Octree* m_CollisionOctree; + EntityWrapper m_Entity; +}; + +#endif diff --git a/include/Game/Systems/Weapon/WeaponSystem.h b/include/Game/Systems/Weapon/WeaponSystem.h new file mode 100644 index 00000000..68cf2ef3 --- /dev/null +++ b/include/Game/Systems/Weapon/WeaponSystem.h @@ -0,0 +1,46 @@ +#ifndef WeaponSystem_h__ +#define WeaponSystem_h__ + +#include "Rendering/IRenderer.h" + +#include "Common.h" +#include "Core/System.h" +#include "Core/EPlayerDamage.h" +#include "Core/EShoot.h" +#include "Core/EPlayerSpawned.h" +#include "Input/EInputCommand.h" +#include "Core/EntityFile.h" +#include "Core/EntityFileParser.h" +#include "Core/Octree.h" +#include "Collision/EntityAABB.h" +#include "Systems/SpawnerSystem.h" +#include "Sound/EPlaySoundOnEntity.h" +#include "AssaultWeaponBehaviour.h" + +class WeaponSystem : public PureSystem, ImpureSystem +{ +public: + WeaponSystem(SystemParams params, IRenderer* renderer, Octree* collisionOctree); + + virtual void Update(double dt) override; + virtual void UpdateComponent(EntityWrapper& entity, ComponentWrapper& cPlayer, double dt) override; + +private: + SystemParams m_SystemParams; + IRenderer* m_Renderer; + Octree* m_CollisionOctree; + + std::unordered_map> m_ActiveWeapons; + + // Events + EventRelay m_EPlayerSpawned; + bool OnPlayerSpawned(Events::PlayerSpawned& e); + EventRelay m_EShoot; + bool OnShoot(Events::Shoot& e); + EventRelay m_EInputCommand; + bool OnInputCommand(Events::InputCommand& e); + + void selectWeapon(EntityWrapper player, ComponentInfo::EnumType slot); +}; + +#endif \ No newline at end of file diff --git a/include/Game/Systems/WeaponSystem.h b/include/Game/Systems/WeaponSystem.h deleted file mode 100644 index b118b8cd..00000000 --- a/include/Game/Systems/WeaponSystem.h +++ /dev/null @@ -1,192 +0,0 @@ -#ifndef WeaponSystem_h__ -#define WeaponSystem_h__ - -//#include -//#include -#include "Rendering/IRenderer.h" - -#include "Common.h" -#include "Core/System.h" -#include "Core/EPlayerDamage.h" -#include "Core/EShoot.h" -#include "Core/EPlayerSpawned.h" -#include "Input/EInputCommand.h" -#include "Core/EntityFile.h" -#include "Core/EntityFileParser.h" -#include "Core/Octree.h" -#include "Collision/EntityAABB.h" -#include "Systems/SpawnerSystem.h" -#include "Sound/EPlaySoundOnEntity.h" - -class WeaponBehaviour; - -class WeaponSystem : public PureSystem, ImpureSystem -{ -public: - WeaponSystem(SystemParams params, IRenderer* renderer, Octree* collisionOctree); - - virtual void Update(double dt) override; - virtual void UpdateComponent(EntityWrapper& entity, ComponentWrapper& cPlayer, double dt) override; - -private: - SystemParams m_SystemParams; - IRenderer* m_Renderer; - Octree* m_CollisionOctree; - - std::unordered_map> m_ActiveWeapons; - - // Events - EventRelay m_EPlayerSpawned; - bool OnPlayerSpawned(Events::PlayerSpawned& e); - EventRelay m_EShoot; - bool OnShoot(Events::Shoot& e); - EventRelay m_EInputCommand; - bool OnInputCommand(Events::InputCommand& e); - - void selectWeapon(EntityWrapper player, ComponentInfo::EnumType slot); -}; - -class WeaponBehaviour : public System -{ -public: - WeaponBehaviour(SystemParams systemParams, Octree* collisionOctree, EntityWrapper weaponEntity) - : System(systemParams) - , m_CollisionOctree(collisionOctree) - , m_Entity(weaponEntity) - { } - virtual ~WeaponBehaviour() = default; - - WeaponBehaviour(const WeaponBehaviour&) = delete; - WeaponBehaviour& operator=(const WeaponBehaviour &) = delete; - - virtual void Fire() = 0; - virtual void CeaseFire() { } - virtual void Reload() { } - virtual void Update(double dt) { } - -protected: - Octree* m_CollisionOctree; - EntityWrapper m_Entity; -}; - -class AssaultWeaponBehaviour : public WeaponBehaviour -{ -public: - AssaultWeaponBehaviour(SystemParams systemParams, Octree* collisionOctree, EntityWrapper weaponEntity) - : WeaponBehaviour(systemParams, collisionOctree, weaponEntity) - { } - - virtual void Fire() override - { - m_TimeSinceLastFire = 0.0; - m_Firing = true; - fireRound(); - } - - virtual void CeaseFire() override - { - m_Firing = false; - } - - virtual void Reload() override - { - ComponentWrapper& cAssaultWeapon = m_Entity["AssaultWeapon"]; - - int& magAmmo = cAssaultWeapon["MagazineAmmo"]; - int magSize = cAssaultWeapon["MagazineSize"]; - int& ammo = cAssaultWeapon["Ammo"]; - - // Don't reload if we're already fully loaded - if (magAmmo == magSize) { - return; - } - - // Throw away rounds in magazine to incentivise ammo sharing - int toLoad = glm::min(magSize, ammo); - magAmmo = toLoad; - ammo -= toLoad; - } - - virtual void Update(double dt) override - { - if (!m_Firing) { - return; - } - - m_TimeSinceLastFire += dt; - - ComponentWrapper& cAssaultWeapon = m_Entity["AssaultWeapon"]; - if (m_TimeSinceLastFire >= 1.0 / ((double)cAssaultWeapon["RPM"] / 60.0)) { - fireRound(); - } - } - -private: - bool m_Firing = false; - double m_TimeSinceLastFire = 0.0; - EntityFile* m_RayRed = nullptr; - EntityFile* m_RayBlue = nullptr; - - void fireRound() - { - ComponentWrapper& cAssaultWeapon = m_Entity["AssaultWeapon"]; - - int& magAmmo = cAssaultWeapon["MagazineAmmo"]; - int ammo = cAssaultWeapon["Ammo"]; - - // Reload if our magazine is empty - if (magAmmo <= 0) { - Reload(); - return; - } - - // Fire - magAmmo -= 1; - spawnTracer(); - playSound(); - - m_TimeSinceLastFire = 0.0; - } - - void spawnTracer() - { - if (!IsClient) { - return; - } - - EntityWrapper spawner; - if (m_Entity == LocalPlayer) { - spawner = m_Entity.FirstChildByName("WeaponMuzzle"); - } else { - spawner = m_Entity.FirstChildByName("ThirdPersonWeaponMuzzle"); - } - - if (!spawner.Valid()) { - return; - } - - Events::SpawnerSpawn e; - e.Spawner = spawner; - m_EventBroker->Publish(e); - } - - float traceRayDistance(glm::vec3 origin, glm::vec3 direction) - { - // TODO: Cast a ray and size tracer appropriately - return 100.f; - } - - void playSound() - { - if (!IsClient) { - return; - } - - Events::PlaySoundOnEntity e; - e.EmitterID = m_Entity.ID; - e.FilePath = "Audio/laser/laser1.wav"; - m_EventBroker->Publish(e); - } -}; - -#endif \ No newline at end of file diff --git a/resources/Schema/Components/AssaultWeapon.xml b/resources/Schema/Components/AssaultWeapon.xml index 902795c1..c7dbfb0d 100755 --- a/resources/Schema/Components/AssaultWeapon.xml +++ b/resources/Schema/Components/AssaultWeapon.xml @@ -6,4 +6,5 @@ 360 5 120 + 0.01 \ No newline at end of file diff --git a/resources/Schema/Components/AssaultWeapon.xsd b/resources/Schema/Components/AssaultWeapon.xsd index 1b2704ea..65558db5 100755 --- a/resources/Schema/Components/AssaultWeapon.xsd +++ b/resources/Schema/Components/AssaultWeapon.xsd @@ -22,6 +22,9 @@ Rate of fire in rounds per minute + + View punch in radians for each bullet fired + diff --git a/resources/Schema/Components/Player.xml b/resources/Schema/Components/Player.xml index b51326aa..00cff257 100644 --- a/resources/Schema/Components/Player.xml +++ b/resources/Schema/Components/Player.xml @@ -2,4 +2,5 @@ 3 1.5 + \ No newline at end of file diff --git a/resources/Schema/Components/Player.xsd b/resources/Schema/Components/Player.xsd index 13948dc2..1b33d222 100644 --- a/resources/Schema/Components/Player.xsd +++ b/resources/Schema/Components/Player.xsd @@ -5,12 +5,13 @@ - The player charachter + The player entity + diff --git a/src/Engine/Rendering/AnimationSystem.cpp b/src/Engine/Rendering/AnimationSystem.cpp index 48681e6e..d5b5984d 100644 --- a/src/Engine/Rendering/AnimationSystem.cpp +++ b/src/Engine/Rendering/AnimationSystem.cpp @@ -34,19 +34,32 @@ void AnimationSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapper& a if (!(bool)animationComponent["Loop" + std::to_string(i)]) { if (nextTime > animation->Duration) { nextTime = animation->Duration; + Events::AnimationComplete e; + e.Entity = entity; + e.Name = (std::string)animationComponent["AnimationName" + std::to_string(i)]; + m_EventBroker->Publish(e); } else if (nextTime < 0) { + Events::AnimationComplete e; + e.Entity = entity; + e.Name = (std::string)animationComponent["AnimationName" + std::to_string(i)]; + m_EventBroker->Publish(e); nextTime = 0; } (double&)animationComponent["Speed" + std::to_string(i)] = 0.0; - Events::AnimationComplete e; - e.Entity = entity; - e.Name = (std::string)animationComponent["AnimationName" + std::to_string(i)]; - m_EventBroker->Publish(e); + } else { if (nextTime > animation->Duration) { + Events::AnimationComplete e; + e.Entity = entity; + e.Name = (std::string)animationComponent["AnimationName" + std::to_string(i)]; + m_EventBroker->Publish(e); nextTime -= animation->Duration; } else if (nextTime < 0) { + Events::AnimationComplete e; + e.Entity = entity; + e.Name = (std::string)animationComponent["AnimationName" + std::to_string(i)]; + m_EventBroker->Publish(e); nextTime += animation->Duration; } } diff --git a/src/Game/CMakeLists.txt b/src/Game/CMakeLists.txt index db923364..f188d7fa 100644 --- a/src/Game/CMakeLists.txt +++ b/src/Game/CMakeLists.txt @@ -16,6 +16,12 @@ file(GLOB SOURCE_FILES_Systems ) source_group(Systems FILES ${SOURCE_FILES_Systems}) +file(GLOB SOURCE_FILES_Systems_Weapon + "${INCLUDE_PATH}/Systems/Weapon/*.h" + "Systems/Weapon/*.cpp" +) +source_group(Systems\\Weapon FILES ${SOURCE_FILES_Systems_Weapon}) + file(GLOB SOURCE_FILES_Events "${INCLUDE_PATH}/Events/*.h" "Events/*.cpp" @@ -31,6 +37,7 @@ set(SOURCE_FILES ${SOURCE_FILES} "Game.cpp" ${SOURCE_FILES_Systems} + ${SOURCE_FILES_Systems_Weapon} ${SOURCE_FILES_Events} ${SOURCE_FILES_Network} ) diff --git a/src/Game/Game.cpp b/src/Game/Game.cpp index 6057d463..cf14fc76 100644 --- a/src/Game/Game.cpp +++ b/src/Game/Game.cpp @@ -13,7 +13,7 @@ #include "Core/EntityFileWriter.h" #include "Game/Systems/CapturePointSystem.h" #include "Game/Systems/PickupSpawnSystem.h" -#include "Game/Systems/WeaponSystem.h" +#include "Game/Systems/Weapon/WeaponSystem.h" #include "Rendering/AnimationSystem.h" #include "Game/Systems/PlayerHUDSystem.h" #include "Rendering/BoneAttachmentSystem.h" diff --git a/src/Game/Systems/PlayerMovementSystem.cpp b/src/Game/Systems/PlayerMovementSystem.cpp index 7c69f0ce..65f7c302 100644 --- a/src/Game/Systems/PlayerMovementSystem.cpp +++ b/src/Game/Systems/PlayerMovementSystem.cpp @@ -51,6 +51,7 @@ void PlayerMovementSystem::updateMovementControllers(double dt) float playerMovementSpeed = player["Player"]["MovementSpeed"]; float playerCrouchSpeed = player["Player"]["CrouchSpeed"]; + glm::vec3& wishDirection = player["Player"]["CurrentWishDirection"]; if (player.HasComponent("Physics")) { ComponentWrapper cPhysics = player["Physics"]; @@ -58,7 +59,7 @@ void PlayerMovementSystem::updateMovementControllers(double dt) if (player.HasComponent("DashAbility")) { controller->AssaultDashCheck(dt, ((glm::vec3)cPhysics["Velocity"]).y != 0.0f, player["DashAbility"]["CoolDownMaxTimer"]); } - glm::vec3 wishDirection = controller->Movement() * glm::inverse(glm::quat(ori)); + wishDirection = controller->Movement() * glm::inverse(glm::quat(ori)); //this makes sure you can only dash in the 4 directions: forw,backw,left,right if (controller->AssaultDashDoubleTapped() && controller->Movement().z != 0 && controller->Movement().x != 0) { wishDirection = glm::vec3(controller->Movement().x, 0, 0)* glm::inverse(glm::quat(ori)); diff --git a/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp b/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp new file mode 100644 index 00000000..bb5a025f --- /dev/null +++ b/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp @@ -0,0 +1,190 @@ +#include "Systems/Weapon/AssaultWeaponBehaviour.h" + +AssaultWeaponBehaviour::AssaultWeaponBehaviour(SystemParams systemParams, Octree* collisionOctree, EntityWrapper weaponEntity) + : WeaponBehaviour(systemParams, collisionOctree, weaponEntity) +{ + m_FirstPersonModel = m_Entity.FirstChildByName("Hands"); + EVENT_SUBSCRIBE_MEMBER(m_EAnimationComplete, &AssaultWeaponBehaviour::OnAnimationComplete); +} + +void AssaultWeaponBehaviour::Fire() +{ + m_TimeSinceLastFire = 0.0; + m_Firing = true; + fireRound(); + playShootAnimation(); +} + +void AssaultWeaponBehaviour::CeaseFire() +{ + m_Firing = false; +} + +void AssaultWeaponBehaviour::Reload() +{ + ComponentWrapper& cAssaultWeapon = m_Entity["AssaultWeapon"]; + + int& magAmmo = cAssaultWeapon["MagazineAmmo"]; + int magSize = cAssaultWeapon["MagazineSize"]; + int& ammo = cAssaultWeapon["Ammo"]; + + // Don't reload if we're already fully loaded + if (magAmmo == magSize) { + return; + } + + // Throw away rounds in magazine to incentivise ammo sharing + int toLoad = glm::min(magSize, ammo); + magAmmo = toLoad; + ammo -= toLoad; +} + +void AssaultWeaponBehaviour::Update(double dt) +{ + if (m_Firing) { + m_TimeSinceLastFire += dt; + + ComponentWrapper& cAssaultWeapon = m_Entity["AssaultWeapon"]; + if (m_TimeSinceLastFire >= 1.0 / ((double)cAssaultWeapon["RPM"] / 60.0)) { + fireRound(); + } + } + + if (!m_Firing && !m_Reloading) { + playIdleAnimation(); + } +} + +bool AssaultWeaponBehaviour::OnAnimationComplete(Events::AnimationComplete& e) +{ + if (e.Entity != m_FirstPersonModel) { + return false; + } + + //if (e.Name == "ShootRifle") { + // if (!m_Firing) { + // playIdleAnimation(); + // } + //} + + return true; +} + +void AssaultWeaponBehaviour::fireRound() +{ + ComponentWrapper& cAssaultWeapon = m_Entity["AssaultWeapon"]; + + int& magAmmo = cAssaultWeapon["MagazineAmmo"]; + int ammo = cAssaultWeapon["Ammo"]; + + // Reload if our magazine is empty + if (magAmmo <= 0) { + Reload(); + return; + } + + // Fire + magAmmo -= 1; + spawnTracer(); + playSound(); + viewPunch(); + + m_TimeSinceLastFire = 0.0; +} + +void AssaultWeaponBehaviour::spawnTracer() +{ + if (!IsClient) { + return; + } + + EntityWrapper spawner; + if (m_Entity == LocalPlayer) { + spawner = m_Entity.FirstChildByName("WeaponMuzzle"); + } else { + spawner = m_Entity.FirstChildByName("ThirdPersonWeaponMuzzle"); + } + + if (!spawner.Valid()) { + return; + } + + Events::SpawnerSpawn e; + e.Spawner = spawner; + m_EventBroker->Publish(e); +} + +float AssaultWeaponBehaviour::traceRayDistance(glm::vec3 origin, glm::vec3 direction) +{ + // TODO: Cast a ray and size tracer appropriately + return 100.f; +} + +void AssaultWeaponBehaviour::playSound() +{ + if (!IsClient) { + return; + } + + Events::PlaySoundOnEntity e; + e.EmitterID = m_Entity.ID; + e.FilePath = "Audio/laser/laser1.wav"; + m_EventBroker->Publish(e); +} + +void AssaultWeaponBehaviour::viewPunch() +{ + EntityWrapper playerCamera = m_Entity.FirstChildByName("Camera"); + if (!playerCamera.Valid()) { + return; + } + float viewPunch = m_Entity["AssaultWeapon"]["ViewPunch"]; + ComponentWrapper cTransform = playerCamera["Transform"]; + glm::vec3& orientation = cTransform["Orientation"]; + orientation.x += viewPunch; +} + +void AssaultWeaponBehaviour::playShootAnimation() +{ + EntityWrapper firstPersonWeapon = m_Entity.FirstChildByName("Hands"); + ComponentWrapper cAnimation = firstPersonWeapon["Animation"]; + cAnimation["AnimationName1"] = "ShootRifle"; + cAnimation["Weight1"] = 1.0; + cAnimation["Time1"] = 0.0; + cAnimation["Speed1"] = 1.0; + cAnimation["Loop1"] = true; +} + +void AssaultWeaponBehaviour::playIdleAnimation() +{ + if (!m_FirstPersonModel.Valid()) { + return; + } + + ComponentWrapper cAnimation = m_FirstPersonModel["Animation"]; + std::string& animationName1 = cAnimation["AnimationName1"]; + double& animationSpeed1 = cAnimation["Speed1"]; + + std::string animationToPlay = "Idle"; + double speedToSet = 1.0; + + ComponentWrapper cPlayer = m_Entity["Player"]; + glm::vec3 movementDirection = cPlayer["CurrentWishDirection"]; + if (glm::length2(movementDirection) > 0) { + animationToPlay = "Run"; + ComponentWrapper cPhysics = m_Entity["Physics"]; + speedToSet = glm::length((glm::vec3)cPhysics["Velocity"]) / (float)cPlayer["MovementSpeed"]; + } + + if (animationName1 != animationToPlay) { + cAnimation["AnimationName1"] = animationToPlay; + cAnimation["Weight1"] = 1.0; + cAnimation["Time1"] = 0.0; + cAnimation["Loop1"] = true; + } + + if (animationSpeed1 != speedToSet) { + cAnimation["Speed1"] = speedToSet; + } +} + diff --git a/src/Game/Systems/WeaponSystem.cpp b/src/Game/Systems/Weapon/WeaponSystem.cpp similarity index 97% rename from src/Game/Systems/WeaponSystem.cpp rename to src/Game/Systems/Weapon/WeaponSystem.cpp index eeb7dd00..bdd27ea9 100644 --- a/src/Game/Systems/WeaponSystem.cpp +++ b/src/Game/Systems/Weapon/WeaponSystem.cpp @@ -1,4 +1,4 @@ -#include "Systems/WeaponSystem.h" +#include "Systems/Weapon/WeaponSystem.h" WeaponSystem::WeaponSystem(SystemParams params, IRenderer* renderer, Octree* collisionOctree) : System(params) @@ -24,7 +24,8 @@ void WeaponSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapper& cPla if (it == m_ActiveWeapons.end()) { selectWeapon(entity, 1); } - + + m_EventBroker->Process(); m_ActiveWeapons.at(entity)->Update(dt); } From 14054ad8987ebfd5041a52951da822bcf5b57872 Mon Sep 17 00:00:00 2001 From: William Moberg Date: Thu, 11 Feb 2016 17:08:45 +0100 Subject: [PATCH 06/25] WIP respawning. --- src/Game/Systems/PlayerSpawnSystem.cpp | 14 +++++++++----- src/Game/Systems/SoundSystem.cpp | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/Game/Systems/PlayerSpawnSystem.cpp b/src/Game/Systems/PlayerSpawnSystem.cpp index aaca4551..0d84bb5d 100644 --- a/src/Game/Systems/PlayerSpawnSystem.cpp +++ b/src/Game/Systems/PlayerSpawnSystem.cpp @@ -95,6 +95,7 @@ bool PlayerSpawnSystem::OnInputCommand(Events::InputCommand& e) } } + //Check if the player already requested spawn. auto iter = m_SpawnRequests.begin(); for (; iter != m_SpawnRequests.end(); ++iter) { if (iter->PlayerID == e.PlayerID) { @@ -103,7 +104,7 @@ bool PlayerSpawnSystem::OnInputCommand(Events::InputCommand& e) } if (iter != m_SpawnRequests.end()) { - //If player is in queue to spawn, then change their team affiliation. + //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, @@ -121,6 +122,10 @@ bool PlayerSpawnSystem::OnInputCommand(Events::InputCommand& e) bool PlayerSpawnSystem::OnPlayerSpawned(Events::PlayerSpawned& e) { + // Store the player for future reference + m_PlayerEntities[e.PlayerID] = e.Player; + m_PlayerIDs[e.Player.ID] = e.PlayerID; + // When a player is actually spawned (since the actual spawning is handled on the server) if (!IsClient) { return false; @@ -134,10 +139,6 @@ bool PlayerSpawnSystem::OnPlayerSpawned(Events::PlayerSpawned& e) } } - // Store the player for future reference - m_PlayerEntities[e.PlayerID] = e.Player; - m_PlayerIDs[e.Player.ID] = e.PlayerID; - // Set the camera to the correct entity EntityWrapper cameraEntity = e.Player.FirstChildByName("Camera"); if (cameraEntity.Valid()) { @@ -169,6 +170,9 @@ bool PlayerSpawnSystem::OnPlayerSpawned(Events::PlayerSpawned& e) bool PlayerSpawnSystem::OnPlayerDeath(Events::PlayerDeath& e) { + if (!IsServer && m_NetworkEnabled) { + return false; + } if (!e.Player.HasComponent("Team")) { return false; } diff --git a/src/Game/Systems/SoundSystem.cpp b/src/Game/Systems/SoundSystem.cpp index 9788817f..a9b1ccaf 100644 --- a/src/Game/Systems/SoundSystem.cpp +++ b/src/Game/Systems/SoundSystem.cpp @@ -52,7 +52,7 @@ bool SoundSystem::OnInputCommand(const Events::InputCommand & e) return true; } } - if (e.Command == "TakeDamage" && e.Value > 0 && m_LocalPlayer.Valid()) { + if (e.Command == "TakeDamage" && e.Value > 0 && LocalPlayer.Valid()) { Events::PlayerDamage ev; ev.Player = LocalPlayer; ev.Damage = e.Value; From 6caa7e94a4945cfd7bf2944cfe0bb8b515a6a701 Mon Sep 17 00:00:00 2001 From: Teejoon Date: Thu, 11 Feb 2016 18:28:33 +0100 Subject: [PATCH 07/25] RGB is now the only channels thats beeing usesed in splatmap --- assets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets b/assets index c56f6380..0107c7df 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit c56f6380ab05c23419beafe14190013d1432e32c +Subproject commit 0107c7dfdfd02bc4966b35ed6ee0f0f3e366f23d From f088aa1d85d82bbc78a50006a6effc19c7330bfa Mon Sep 17 00:00:00 2001 From: Teejoon Date: Thu, 11 Feb 2016 18:45:48 +0100 Subject: [PATCH 08/25] Commit the files now.... --- .../Shaders/ForwardPlusSplatMapRGB.frag.glsl | 245 ++++++++++++++++++ src/Engine/Rendering/DrawFinalPass.cpp | 16 +- 2 files changed, 253 insertions(+), 8 deletions(-) create mode 100644 resources/Shaders/ForwardPlusSplatMapRGB.frag.glsl diff --git a/resources/Shaders/ForwardPlusSplatMapRGB.frag.glsl b/resources/Shaders/ForwardPlusSplatMapRGB.frag.glsl new file mode 100644 index 00000000..e862d926 --- /dev/null +++ b/resources/Shaders/ForwardPlusSplatMapRGB.frag.glsl @@ -0,0 +1,245 @@ +#version 430 + +uniform mat4 M; +uniform mat4 V; +uniform mat4 P; +uniform vec2 ScreenDimensions; +uniform float FillPercentage; +uniform vec4 DiffuseColor; +uniform vec4 FillColor; +uniform vec4 Color; +uniform vec4 AmbientColor; + +//Get bineded at the same time as the textures +uniform vec2 DiffuseUVRepeat1; +uniform vec2 DiffuseUVRepeat2; +uniform vec2 DiffuseUVRepeat3; +uniform vec2 NormalUVRepeat1; +uniform vec2 NormalUVRepeat2; +uniform vec2 NormalUVRepeat3; +uniform vec2 SpecularUVRepeat1; +uniform vec2 SpecularUVRepeat2; +uniform vec2 SpecularUVRepeat3; +uniform vec2 GlowUVRepeat1; +uniform vec2 GlowUVRepeat2; +uniform vec2 GlowUVRepeat3; +layout (binding = 0) uniform sampler2D SplatMapTexture; +layout (binding = 1) uniform sampler2D DiffuseTexture1; +layout (binding = 2) uniform sampler2D DiffuseTexture2; +layout (binding = 3) uniform sampler2D DiffuseTexture3; +layout (binding = 4) uniform sampler2D NormalMapTexture1; +layout (binding = 5) uniform sampler2D NormalMapTexture2; +layout (binding = 6) uniform sampler2D NormalMapTexture3; +layout (binding = 7) uniform sampler2D SpecularMapTexture1; +layout (binding = 8) uniform sampler2D SpecularMapTexture2; +layout (binding = 9) uniform sampler2D SpecularMapTexture3; +layout (binding = 10) uniform sampler2D GlowMapTexture1; +layout (binding = 11) uniform sampler2D GlowMapTexture2; +layout (binding = 12) uniform sampler2D GlowMapTexture3; + +#define TILE_SIZE 16 + +struct LightSource { + vec4 Position; + vec4 Direction; + vec4 Color; + float Radius; + float Intensity; + float Falloff; + int Type; +}; + +layout (std430, binding = 1) buffer LightBuffer +{ + LightSource List[]; +} LightSources; + +struct LightGrid { + float Start; + float Amount; + vec2 Padding; +}; + +layout (std430, binding = 2) buffer LightGridBuffer +{ + LightGrid Data[]; +} LightGrids; + +layout (std430, binding = 4) buffer LightIndexBuffer +{ + float LightIndex[]; +}; + + +in VertexData{ + vec3 Position; + vec3 Normal; + vec3 Tangent; + vec3 BiTangent; + vec2 TextureCoordinate; + vec4 ExplosionColor; + float ExplosionPercentageElapsed; +}Input; + +out vec4 sceneColor; +out vec4 bloomColor; + +struct LightResult { + vec4 Diffuse; + vec4 Specular; +}; + +float CalcAttenuation(float radius, float dist, float falloff) { + return 1.0 - smoothstep(radius * 0.3, radius, dist); +} + +vec4 CalcSpecular(vec4 lightColor, vec4 viewVec, vec4 lightVec, vec4 normal) { + vec4 R = normalize( reflect(-lightVec, normal)); + float RdotV = max( dot(R, viewVec), 0.0); + return lightColor * pow(RdotV, 90.0); +} + +vec4 CalcDiffuse(vec4 lightColor, vec4 lightVec, vec4 normal) { + float power = max( dot(normal, lightVec), 0.0); + return lightColor * power; +} + +LightResult CalcPointLightSource(vec4 lightPos, float lightRadius, vec4 lightColor, float intensity, vec4 viewVec, vec4 position, vec4 normal, float falloff) +{ + vec4 L = lightPos - position; + float dist = length(L); + L = normalize(L); + + float attenuation = CalcAttenuation(lightRadius, dist, falloff); + + LightResult result; + result.Diffuse = CalcDiffuse(lightColor, L, normal) * attenuation * intensity; + result.Specular = CalcSpecular(lightColor, viewVec, L, normal) * attenuation * intensity; + return result; +} + +LightResult CalcDirectionalLightSource(vec4 direction, vec4 color, float intensity, vec4 viewVec, vec4 vertNormal) +{ + vec4 L = normalize( -vec4(direction.xyz, 0) ); + + LightResult result; + result.Diffuse = CalcDiffuse(color, L, vertNormal) * intensity; + result.Specular = CalcSpecular(color, viewVec, L, vertNormal) * intensity; + return result; +} + +vec4 CalcNormalMappedValue(vec3 normal, vec3 tangent, vec3 bitangent, vec2 textureCoordinate, sampler2D normalMap) +{ + mat3 TBN = mat3(tangent, bitangent, normal); + vec3 NormalMap = texture(normalMap, textureCoordinate).xyz * 2.0 - vec3(1.0); + return vec4(TBN * normalize(NormalMap), 0.0); +} + +vec4 CalcBlendedTexel(vec4 blendValue, sampler2D R, sampler2D G, sampler2D B, + vec2 R_TileValues, vec2 G_TileValues, vec2 B_TileValues){ + vec4 R_Channel = texture2D(R, Input.TextureCoordinate * R_TileValues); + vec4 G_Channel = texture2D(G, Input.TextureCoordinate * G_TileValues); + vec4 B_Channel = texture2D(B, Input.TextureCoordinate * B_TileValues); + + float total = blendValue.r + blendValue.g + blendValue.b; + float totalDiv = 1.0f / total; + blendValue.r = blendValue.r * totalDiv; + blendValue.g = blendValue.g * totalDiv; + blendValue.b = blendValue.b * totalDiv; + + return blendValue.r * R_Channel + + blendValue.g * G_Channel + + blendValue.b * B_Channel; +} + +vec4 CalcBlendedNormal(vec4 blendValue, sampler2D R, sampler2D G, sampler2D B, + vec2 R_TileValues, vec2 G_TileValues, vec2 B_TileValues){ + mat3 TBN = mat3(Input.Tangent, Input.BiTangent, Input.Normal); + vec3 R_Channel = texture(R, Input.TextureCoordinate * R_TileValues).xyz * 2.0 - vec3(1.0); + vec3 G_Channel = texture(G, Input.TextureCoordinate * G_TileValues).xyz * 2.0 - vec3(1.0); + vec3 B_Channel = texture(B, Input.TextureCoordinate * B_TileValues).xyz * 2.0 - vec3(1.0); + + float total = blendValue.r + blendValue.g + blendValue.b + blendValue.a; + float totalDiv = 1 / total; + blendValue.r = blendValue.r * totalDiv; + blendValue.g = blendValue.g * totalDiv; + blendValue.b = blendValue.b * totalDiv; + + vec3 Normal_result = blendValue.r * R_Channel + + blendValue.g * G_Channel + + blendValue.b * B_Channel; + + return vec4(TBN * normalize(Normal_result), 0.0); +} + +void main() +{ + vec4 splatTexel = texture2D(SplatMapTexture, Input.TextureCoordinate); + + vec4 diffuseTexel = CalcBlendedTexel(splatTexel, DiffuseTexture1, DiffuseTexture2, DiffuseTexture3, + DiffuseUVRepeat1, DiffuseUVRepeat2, DiffuseUVRepeat3); + vec4 glowTexel = CalcBlendedTexel(splatTexel, GlowMapTexture1, GlowMapTexture2, GlowMapTexture3, + GlowUVRepeat1, GlowUVRepeat2, GlowUVRepeat3); + vec4 specularTexel = CalcBlendedTexel(splatTexel, SpecularMapTexture1, SpecularMapTexture2, SpecularMapTexture3, + SpecularUVRepeat1, SpecularUVRepeat2, SpecularUVRepeat3); + vec4 position = V * M * vec4(Input.Position, 1.0); + //vec4 normal = V * CalcNormalMappedValue(Input.Normal, Input.Tangent, Input.BiTangent, Input.TextureCoordinate, SplatMapTexture); + vec4 normal = V * CalcBlendedNormal(splatTexel, NormalMapTexture1, NormalMapTexture2, NormalMapTexture3, + NormalUVRepeat1, NormalUVRepeat2, NormalUVRepeat3); + normal = normalize(normal); + //vec4 normal = normalize(V * vec4(Input.Normal, 0.0)); + vec4 viewVec = normalize(-position); + + vec2 tilePos; + tilePos.x = int(gl_FragCoord.x/TILE_SIZE); + tilePos.y = int(gl_FragCoord.y/TILE_SIZE); + + LightResult totalLighting; + totalLighting.Diffuse = vec4(AmbientColor.rgb, 1.0); + int currentTile = int(floor(gl_FragCoord.x/TILE_SIZE) + (floor(gl_FragCoord.y/TILE_SIZE) * int(ScreenDimensions.x/TILE_SIZE))); + + int start = int(LightGrids.Data[currentTile].Start); + int amount = int(LightGrids.Data[currentTile].Amount); + + for(int i = start; i < start + amount; i++) { + + int l = int(LightIndex[i]); + LightSource light = LightSources.List[l]; + + LightResult light_result; + //These if statements should be removed. + if(light.Type == 1) { // point + light_result = CalcPointLightSource(V * light.Position, light.Radius, light.Color, light.Intensity, viewVec, position, normal, light.Falloff); + } else if (light.Type == 2) { //Directional + light_result = CalcDirectionalLightSource(V * light.Direction, light.Color, light.Intensity, viewVec, normal); + } + totalLighting.Diffuse += light_result.Diffuse; + totalLighting.Specular += light_result.Specular; + } + + vec4 color_result = mix((Color * diffuseTexel * DiffuseColor), Input.ExplosionColor, Input.ExplosionPercentageElapsed); + color_result = color_result * (totalLighting.Diffuse + (totalLighting.Specular * specularTexel)); + //vec4 color_result = (DiffuseColor + Input.ExplosionColor) * (totalLighting.Diffuse + (totalLighting.Specular * specularTexel)) * diffuseTexel * Color; + + + float pos = ((P * vec4(Input.Position, 1)).y + 1.0)/2.0; + + if(pos <= FillPercentage) { + color_result += FillColor; + } + sceneColor = vec4(color_result.xyz, clamp(color_result.a, 0, 1)); + color_result += glowTexel*3; + + bloomColor = vec4(clamp(color_result.xyz - 1.0, 0, 100), 1.0); + + //Tiled Debug Code + /* + if(int(gl_FragCoord.x)%16 == 0 || int(gl_FragCoord.y)%16 == 0 ) { + sceneColor += vec4(0.5, 0, 0, 0); + } else { + sceneColor += vec4(LightGrids.Data[int(tilePos.x + tilePos.y*80)].Amount/LightSources.List.length(), 0, 0, 1); + } + */ +} + + diff --git a/src/Engine/Rendering/DrawFinalPass.cpp b/src/Engine/Rendering/DrawFinalPass.cpp index 0d08b98f..bd57df3a 100644 --- a/src/Engine/Rendering/DrawFinalPass.cpp +++ b/src/Engine/Rendering/DrawFinalPass.cpp @@ -81,7 +81,7 @@ void DrawFinalPass::InitializeShaderPrograms() m_ForwardPlusSplatMapProgram = ResourceManager::Load("#ForwardPlusSplatMapProgram"); m_ForwardPlusSplatMapProgram->AddShader(std::shared_ptr(new VertexShader("Shaders/ForwardPlus.vert.glsl"))); - m_ForwardPlusSplatMapProgram->AddShader(std::shared_ptr(new FragmentShader("Shaders/ForwardPlusSplatMap.frag.glsl"))); + m_ForwardPlusSplatMapProgram->AddShader(std::shared_ptr(new FragmentShader("Shaders/ForwardPlusSplatMapRGB.frag.glsl"))); m_ForwardPlusSplatMapProgram->Compile(); m_ForwardPlusSplatMapProgram->BindFragDataLocation(0, "sceneColor"); m_ForwardPlusSplatMapProgram->BindFragDataLocation(1, "bloomColor"); @@ -91,7 +91,7 @@ void DrawFinalPass::InitializeShaderPrograms() m_ExplosionEffectSplatMapProgram = ResourceManager::Load("#ExplosionEffectSplatMapProgram"); m_ExplosionEffectSplatMapProgram->AddShader(std::shared_ptr(new VertexShader("Shaders/ForwardPlus.vert.glsl"))); m_ExplosionEffectSplatMapProgram->AddShader(std::shared_ptr(new GeometryShader("Shaders/ExplosionEffect.geom.glsl"))); - m_ExplosionEffectSplatMapProgram->AddShader(std::shared_ptr(new FragmentShader("Shaders/ForwardPlusSplatMap.frag.glsl"))); + m_ExplosionEffectSplatMapProgram->AddShader(std::shared_ptr(new FragmentShader("Shaders/ForwardPlusSplatMapRGB.frag.glsl"))); m_ExplosionEffectSplatMapProgram->Compile(); m_ExplosionEffectSplatMapProgram->BindFragDataLocation(0, "sceneColor"); m_ExplosionEffectSplatMapProgram->BindFragDataLocation(1, "bloomColor"); @@ -119,7 +119,7 @@ void DrawFinalPass::InitializeShaderPrograms() m_ExplosionEffectSplatMapSkinnedProgram = ResourceManager::Load("#ExplosionEffectSplatMapSkinnedProgram"); m_ExplosionEffectSplatMapSkinnedProgram->AddShader(std::shared_ptr(new VertexShader("Shaders/ForwardPlusSkinned.vert.glsl"))); - m_ExplosionEffectSplatMapSkinnedProgram->AddShader(std::shared_ptr(new FragmentShader("Shaders/ForwardPlusSplatMap.frag.glsl"))); + m_ExplosionEffectSplatMapSkinnedProgram->AddShader(std::shared_ptr(new FragmentShader("Shaders/ForwardPlusSplatMapRGB.frag.glsl"))); m_ExplosionEffectSplatMapSkinnedProgram->Compile(); m_ExplosionEffectSplatMapSkinnedProgram->BindFragDataLocation(0, "sceneColor"); m_ExplosionEffectSplatMapSkinnedProgram->BindFragDataLocation(1, "bloomColor"); @@ -128,7 +128,7 @@ void DrawFinalPass::InitializeShaderPrograms() m_ForwardPlusSplatMapSkinnedProgram = ResourceManager::Load("#ForwardPlusSplatMapSkinnedProgram"); m_ForwardPlusSplatMapSkinnedProgram->AddShader(std::shared_ptr(new VertexShader("Shaders/ForwardPlusSkinned.vert.glsl"))); - m_ForwardPlusSplatMapSkinnedProgram->AddShader(std::shared_ptr(new FragmentShader("Shaders/ForwardPlusSplatMap.frag.glsl"))); + m_ForwardPlusSplatMapSkinnedProgram->AddShader(std::shared_ptr(new FragmentShader("Shaders/ForwardPlusSplatMapRGB.frag.glsl"))); m_ForwardPlusSplatMapSkinnedProgram->Compile(); m_ForwardPlusSplatMapSkinnedProgram->BindFragDataLocation(0, "sceneColor"); m_ForwardPlusSplatMapSkinnedProgram->BindFragDataLocation(1, "bloomColor"); @@ -892,7 +892,7 @@ void DrawFinalPass::BindModelTextures(GLuint shaderHandle, std::shared_ptrDiffuseTexture.size() > i && job->DiffuseTexture[i]->Texture != nullptr) { glBindTexture(GL_TEXTURE_2D, job->DiffuseTexture[i]->Texture->m_Texture); @@ -906,7 +906,7 @@ void DrawFinalPass::BindModelTextures(GLuint shaderHandle, std::shared_ptrNormalTexture.size() > i && job->NormalTexture[i]->Texture != nullptr) { glBindTexture(GL_TEXTURE_2D, job->NormalTexture[i]->Texture->m_Texture); @@ -920,7 +920,7 @@ void DrawFinalPass::BindModelTextures(GLuint shaderHandle, std::shared_ptrSpecularTexture.size() > i && job->SpecularTexture[i]->Texture != nullptr) { glBindTexture(GL_TEXTURE_2D, job->SpecularTexture[i]->Texture->m_Texture); @@ -934,7 +934,7 @@ void DrawFinalPass::BindModelTextures(GLuint shaderHandle, std::shared_ptrIncandescenceTexture.size() > i && job->IncandescenceTexture[i]->Texture != nullptr) { glBindTexture(GL_TEXTURE_2D, job->IncandescenceTexture[i]->Texture->m_Texture); From 99747c518efec59e8270caf5b410fcdc915be44a Mon Sep 17 00:00:00 2001 From: Teejoon Date: Thu, 11 Feb 2016 18:48:07 +0100 Subject: [PATCH 09/25] commit assets --- assets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets b/assets index 66e2a73b..105b22fc 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 66e2a73bdb2c385cac37476980809cc587e2e612 +Subproject commit 105b22fc67b68993db43deec3250084ed625d893 From f79649cf9a5a80eed6699581342d34516a12172d Mon Sep 17 00:00:00 2001 From: Teejoon Date: Thu, 11 Feb 2016 19:38:43 +0100 Subject: [PATCH 10/25] Fixed material file reading bug --- src/Engine/Rendering/RawModelCustom.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Engine/Rendering/RawModelCustom.cpp b/src/Engine/Rendering/RawModelCustom.cpp index 4ebf80b6..dd6a96de 100644 --- a/src/Engine/Rendering/RawModelCustom.cpp +++ b/src/Engine/Rendering/RawModelCustom.cpp @@ -277,8 +277,8 @@ void RawModelCustom::ReadMaterialTextureProperties(RawModelCustom::TextureProper throw Resource::FailedLoadingException("Reading Material texture UVTiling failed"); } memcpy(&texture.UVRepeat[0], fileData + offset, sizeof(glm::vec2)); - offset += sizeof(glm::vec2); } + offset += sizeof(glm::vec2); } void RawModelCustom::ReadAnimationFile(std::string filePath) From fee1ed6d6d4e65e51403b5da162900c5a82fb624 Mon Sep 17 00:00:00 2001 From: sippeangelo Date: Thu, 11 Feb 2016 20:00:59 +0100 Subject: [PATCH 11/25] FIXME: Temporarily removed glow from sprite shader to prevent transparent sprite from occluding other glow --- resources/Shaders/Sprite.frag.glsl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/Shaders/Sprite.frag.glsl b/resources/Shaders/Sprite.frag.glsl index a1ff3025..9ce2bbdf 100644 --- a/resources/Shaders/Sprite.frag.glsl +++ b/resources/Shaders/Sprite.frag.glsl @@ -34,7 +34,8 @@ void main() } sceneColor = vec4(color_result.xyz, clamp(color_result.a, 0, 1)); - bloomColor = vec4(clamp((glowTexel.xyz*3) - 1.0, 0, 100), 1.0); + //bloomColor = vec4(clamp((glowTexel.xyz*3) - 1.0, 0, 100), 1.0); + bloomColor = vec4(1.0, 1.0, 1.0, 0.0); } From 5e05e51309d2eae3434c0d368710b2bec776aa71 Mon Sep 17 00:00:00 2001 From: sippeangelo Date: Thu, 11 Feb 2016 20:01:23 +0100 Subject: [PATCH 12/25] Fixed EntityFirstHitByRay not returning outDistance properly --- include/Engine/Collision/Collision.h | 4 ++-- src/Engine/Collision/Collision.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/Engine/Collision/Collision.h b/include/Engine/Collision/Collision.h index 5b4150d8..546d03f5 100644 --- a/include/Engine/Collision/Collision.h +++ b/include/Engine/Collision/Collision.h @@ -90,10 +90,10 @@ boost::optional AbsoluteAABBExplosionEffect(EntityWrapper& entity); //Returns the first entity hit by the input ray. entitiesPotentiallyHitSorted needs to be sorted //by their distance to the ray, e.g. result from Octree::ObjectsPossiblyHitByRay. //Returns boost::none if none was hit. outDistance will be the distance to the intersection point if the ray intersects. -boost::optional EntityFirstHitByRay(const Ray& ray, std::vector entitiesPotentiallyHitSorted, float outDistance, glm::vec3& outIntersectPos); +boost::optional EntityFirstHitByRay(const Ray& ray, std::vector entitiesPotentiallyHitSorted, float& outDistance, glm::vec3& outIntersectPos); //Returns the first entity hit by the input ray that exists in the octree. //outDistance will be the distance to the intersection point if the ray intersects. -boost::optional EntityFirstHitByRay(const Ray& ray, Octree* octree, float outDistance, glm::vec3& outIntersectPos); +boost::optional EntityFirstHitByRay(const Ray& ray, Octree* octree, float& outDistance, glm::vec3& outIntersectPos); } diff --git a/src/Engine/Collision/Collision.cpp b/src/Engine/Collision/Collision.cpp index 7b182de1..ab2098b7 100644 --- a/src/Engine/Collision/Collision.cpp +++ b/src/Engine/Collision/Collision.cpp @@ -642,7 +642,7 @@ boost::optional AbsoluteAABBExplosionEffect(EntityWrapper& entity) return aabb; } -boost::optional EntityFirstHitByRay(const Ray& ray, std::vector entitiesPotentiallyHitSorted, float outDistance, glm::vec3& outIntersectPos) +boost::optional EntityFirstHitByRay(const Ray& ray, std::vector entitiesPotentiallyHitSorted, float& outDistance, glm::vec3& outIntersectPos) { for (EntityAABB& entityBox : entitiesPotentiallyHitSorted) { if (!entityBox.Entity.HasComponent("Model")) { @@ -667,7 +667,7 @@ boost::optional EntityFirstHitByRay(const Ray& ray, std::vector EntityFirstHitByRay(const Ray& ray, Octree* octree, float outDistance, glm::vec3& outIntersectPos) +boost::optional EntityFirstHitByRay(const Ray& ray, Octree* octree, float& outDistance, glm::vec3& outIntersectPos) { std::vector outObjects; octree->ObjectsPossiblyHitByRay(ray, outObjects); From 4a17e3c8f384dc2a998d75f55baeb5a350d978cd Mon Sep 17 00:00:00 2001 From: verysecrethero Date: Thu, 11 Feb 2016 21:42:29 +0100 Subject: [PATCH 13/25] airFriction changed to 2.0 to fix the dash ability in the air --- src/Game/Systems/PlayerMovementSystem.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Game/Systems/PlayerMovementSystem.cpp b/src/Game/Systems/PlayerMovementSystem.cpp index 93f0cd3d..bad512df 100644 --- a/src/Game/Systems/PlayerMovementSystem.cpp +++ b/src/Game/Systems/PlayerMovementSystem.cpp @@ -233,7 +233,8 @@ void PlayerMovementSystem::updateVelocity(double dt) float speed = glm::length(velocity); static float groundFriction = 7.f; ImGui::InputFloat("groundFriction", &groundFriction); - static float airFriction = 0.f; + static float airFriction = 2.f; + ImGui::InputFloat("airFriction", &airFriction); float friction = isOnGround ? groundFriction : airFriction; if (speed > 0) { From dd131e7652a93623baa0723a7a2967076b970df7 Mon Sep 17 00:00:00 2001 From: William Moberg Date: Thu, 11 Feb 2016 22:49:31 +0100 Subject: [PATCH 14/25] Respawning may work, not been tested over network yet. --- src/Game/Systems/PlayerSpawnSystem.cpp | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/src/Game/Systems/PlayerSpawnSystem.cpp b/src/Game/Systems/PlayerSpawnSystem.cpp index 0d84bb5d..65184384 100644 --- a/src/Game/Systems/PlayerSpawnSystem.cpp +++ b/src/Game/Systems/PlayerSpawnSystem.cpp @@ -78,8 +78,8 @@ bool PlayerSpawnSystem::OnInputCommand(Events::InputCommand& e) } // Team picks should be processed ONLY server-side! - // Don't make a spawn request if PlayerID is -1, i.e. we're the client. - if (e.PlayerID == -1 && m_NetworkEnabled) { + // Don't make a spawn request if we're the client. + if (!IsServer && m_NetworkEnabled) { return false; } @@ -88,11 +88,10 @@ bool PlayerSpawnSystem::OnInputCommand(Events::InputCommand& e) } //TODO: Spectating? - if (e.Player.Valid() && e.Player.HasComponent("Team")) { - ComponentWrapper cTeam = e.Player["Team"]; - if ((ComponentInfo::EnumType)e.Value == cTeam["Team"].Enum("Spectator")) { - return false; - } + //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. @@ -131,13 +130,6 @@ bool PlayerSpawnSystem::OnPlayerSpawned(Events::PlayerSpawned& e) return false; } - // Check if a player already exists - if (m_PlayerEntities.count(e.PlayerID) != 0) { - // TODO: Disallow infinite respawning here - if (m_PlayerEntities[e.PlayerID].Valid()) { - m_World->DeleteEntity(m_PlayerEntities[e.PlayerID].ID); - } - } // Set the camera to the correct entity EntityWrapper cameraEntity = e.Player.FirstChildByName("Camera"); @@ -170,6 +162,7 @@ bool PlayerSpawnSystem::OnPlayerSpawned(Events::PlayerSpawned& e) bool PlayerSpawnSystem::OnPlayerDeath(Events::PlayerDeath& e) { + //Only spawn request if network is disabled or we are server. if (!IsServer && m_NetworkEnabled) { return false; } @@ -182,7 +175,7 @@ bool PlayerSpawnSystem::OnPlayerDeath(Events::PlayerDeath& e) return false; } SpawnRequest req; - req.PlayerID = m_PlayerIDs[e.Player.ID]; + req.PlayerID = m_PlayerIDs.at(e.Player.ID); req.Team = cTeam["Team"]; m_SpawnRequests.push_back(req); } From d1213f9f59d36d25813e8a5cd90f6106edcdd322 Mon Sep 17 00:00:00 2001 From: sippeangelo Date: Thu, 11 Feb 2016 22:50:44 +0100 Subject: [PATCH 15/25] Working damage dealing, a super cool reload effect and hit markers! --- assets | 2 +- include/Engine/Core/EPlayerDamage.h | 4 +- include/Engine/Core/EShoot.h | 3 +- .../Systems/Weapon/AssaultWeaponBehaviour.h | 12 +- include/Game/Systems/Weapon/WeaponBehaviour.h | 9 +- include/Game/Systems/Weapon/WeaponSystem.h | 2 - resources/Schema/Components/AssaultWeapon.xml | 1 + resources/Schema/Components/AssaultWeapon.xsd | 3 + resources/Schema/Entities/HitMarker.xml | 20 ++ resources/Schema/Entities/MovementTest.xml | 158 ++++++++++++- resources/Schema/Entities/Player.xml | 46 +++- .../Schema/Entities/WeaponReloadEffect.xml | 31 +++ src/Engine/Core/EntityFilePreprocessor.cpp | 1 - src/Engine/Network/Client.cpp | 3 +- src/Engine/Network/Server.cpp | 3 +- src/Game/Systems/HealthSystem.cpp | 4 +- src/Game/Systems/PlayerDeathSystem.cpp | 14 +- src/Game/Systems/SoundSystem.cpp | 2 +- src/Game/Systems/SpawnerSystem.cpp | 10 +- .../Systems/Weapon/AssaultWeaponBehaviour.cpp | 218 +++++++++++++++--- src/Game/Systems/Weapon/WeaponSystem.cpp | 60 +---- src/Tests/HealthSystemTest.cpp | 2 +- 22 files changed, 473 insertions(+), 135 deletions(-) create mode 100644 resources/Schema/Entities/HitMarker.xml create mode 100644 resources/Schema/Entities/WeaponReloadEffect.xml diff --git a/assets b/assets index 8ffd0a99..4d36fdce 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 8ffd0a99b9a2e5c140307d382a25c4a470cc8f33 +Subproject commit 4d36fdced7007a594a56b7371bb26861876889aa diff --git a/include/Engine/Core/EPlayerDamage.h b/include/Engine/Core/EPlayerDamage.h index 8ba3907e..6f3f2c12 100644 --- a/include/Engine/Core/EPlayerDamage.h +++ b/include/Engine/Core/EPlayerDamage.h @@ -9,8 +9,8 @@ namespace Events struct PlayerDamage : Event { - //NOTE: this struct is missing information on what the damageSource is - EntityWrapper Player; + EntityWrapper Inflictor; + EntityWrapper Victim; double Damage; }; diff --git a/include/Engine/Core/EShoot.h b/include/Engine/Core/EShoot.h index 76821a24..28346abb 100644 --- a/include/Engine/Core/EShoot.h +++ b/include/Engine/Core/EShoot.h @@ -9,7 +9,8 @@ namespace Events struct Shoot : Event { - EntityWrapper Player; + EntityWrapper Inflictor; + double Damage; }; } diff --git a/include/Game/Systems/Weapon/AssaultWeaponBehaviour.h b/include/Game/Systems/Weapon/AssaultWeaponBehaviour.h index 58d7755f..915854ff 100644 --- a/include/Game/Systems/Weapon/AssaultWeaponBehaviour.h +++ b/include/Game/Systems/Weapon/AssaultWeaponBehaviour.h @@ -1,12 +1,15 @@ #include "Sound/EPlaySoundOnEntity.h" +#include "Collision/Collision.h" #include "Rendering/AnimationSystem.h" #include "WeaponBehaviour.h" #include "../SpawnerSystem.h" +#include "Core/EPlayerDamage.h" +#include "Core/EShoot.h" class AssaultWeaponBehaviour : public WeaponBehaviour { public: - AssaultWeaponBehaviour(SystemParams systemParams, Octree* collisionOctree, EntityWrapper weaponEntity); + AssaultWeaponBehaviour(SystemParams systemParams, IRenderer* renderer, Octree* collisionOctree, EntityWrapper weaponEntity); virtual void Fire() override; virtual void CeaseFire() override; @@ -19,16 +22,23 @@ private: // State bool m_Firing = false; bool m_Reloading = false; + double m_ReloadTimer = 0.0; + EntityWrapper m_ReloadImpersonator; double m_TimeSinceLastFire = 0.0; EventRelay m_EAnimationComplete; bool OnAnimationComplete(Events::AnimationComplete& e); + bool hasAmmo(); void fireRound(); void spawnTracer(); float traceRayDistance(glm::vec3 origin, glm::vec3 direction); void playSound(); void viewPunch(); + void finishReload(); void playShootAnimation(); void playIdleAnimation(); + void playReloadAnimation(); + bool shoot(double damage); + void showHitMarker(); }; diff --git a/include/Game/Systems/Weapon/WeaponBehaviour.h b/include/Game/Systems/Weapon/WeaponBehaviour.h index 38ab5f58..7a0b4626 100644 --- a/include/Game/Systems/Weapon/WeaponBehaviour.h +++ b/include/Game/Systems/Weapon/WeaponBehaviour.h @@ -2,16 +2,18 @@ #define WeaponBehaviour_h__ #include "Core/System.h" +#include "Rendering/IRenderer.h" #include "Core/Octree.h" #include "Collision/EntityAABB.h" class WeaponBehaviour : public System { public: - WeaponBehaviour(SystemParams systemParams, Octree* collisionOctree, EntityWrapper weaponEntity) + WeaponBehaviour(SystemParams systemParams, IRenderer* renderer, Octree* collisionOctree, EntityWrapper player) : System(systemParams) + , m_Renderer(renderer) , m_CollisionOctree(collisionOctree) - , m_Entity(weaponEntity) + , m_Player(player) { } virtual ~WeaponBehaviour() = default; @@ -24,8 +26,9 @@ public: virtual void Update(double dt) { } protected: + IRenderer* m_Renderer; Octree* m_CollisionOctree; - EntityWrapper m_Entity; + EntityWrapper m_Player; }; #endif diff --git a/include/Game/Systems/Weapon/WeaponSystem.h b/include/Game/Systems/Weapon/WeaponSystem.h index 68cf2ef3..b8278bc4 100644 --- a/include/Game/Systems/Weapon/WeaponSystem.h +++ b/include/Game/Systems/Weapon/WeaponSystem.h @@ -35,8 +35,6 @@ private: // Events EventRelay m_EPlayerSpawned; bool OnPlayerSpawned(Events::PlayerSpawned& e); - EventRelay m_EShoot; - bool OnShoot(Events::Shoot& e); EventRelay m_EInputCommand; bool OnInputCommand(Events::InputCommand& e); diff --git a/resources/Schema/Components/AssaultWeapon.xml b/resources/Schema/Components/AssaultWeapon.xml index c7dbfb0d..6c645624 100755 --- a/resources/Schema/Components/AssaultWeapon.xml +++ b/resources/Schema/Components/AssaultWeapon.xml @@ -7,4 +7,5 @@ 5 120 0.01 + 2 \ No newline at end of file diff --git a/resources/Schema/Components/AssaultWeapon.xsd b/resources/Schema/Components/AssaultWeapon.xsd index 65558db5..95df64b7 100755 --- a/resources/Schema/Components/AssaultWeapon.xsd +++ b/resources/Schema/Components/AssaultWeapon.xsd @@ -25,6 +25,9 @@ View punch in radians for each bullet fired + + Time it takes to reload the weapon in seconds + diff --git a/resources/Schema/Entities/HitMarker.xml b/resources/Schema/Entities/HitMarker.xml new file mode 100644 index 00000000..74a539d0 --- /dev/null +++ b/resources/Schema/Entities/HitMarker.xml @@ -0,0 +1,20 @@ + + + + + + 0.1 + + + Textures/Weapons/Crosshair/SmallThickHoleDot.png + false + + + + + + + + + + diff --git a/resources/Schema/Entities/MovementTest.xml b/resources/Schema/Entities/MovementTest.xml index 16a28684..84aaa03a 100644 --- a/resources/Schema/Entities/MovementTest.xml +++ b/resources/Schema/Entities/MovementTest.xml @@ -124,10 +124,14 @@ + + 600 + - + + - false + 5 @@ -138,8 +142,7 @@ - - + @@ -147,7 +150,7 @@ - + @@ -156,10 +159,9 @@ Fonts/DroidSans.ttf,100 - false - + @@ -170,6 +172,7 @@ Models/Widgets/Camera.mesh + false @@ -178,6 +181,100 @@ + + + + + + + + + + + 1 + + + + + Models/Core/UnitHexagon.mesh + + + + + + + + + + + + + + Textures/Weapons/Crosshair/SmallThickHoleDot.png + false + + + + + + + + + + + + + + Idle + 1.9569972344146196 + 1 + + + Models/Characters/Assault/FirstPerson.mesh + true + + + + + + + + R_Arm_Weapon_Joint + + + Models/Weapons/Blue/AssaultWeaponBlue.mesh + true + + + + + + + + + + + Schema/Entities/RayBlue.xml + + + + + + + + + + + + + Schema/Entities/WeaponReloadEffect.xml + + + + + + + @@ -196,15 +293,52 @@ + + Idle + 1.8055945618467364 + 1 + + + AimRifle + + + - Models/Characters/Assault/AssaultHeadless.mesh + Models/Characters/Assault/AssaultAnimations.mesh - - - + - + + + + + R_Arm_Weapon_Joint + + + Models/Weapons/Blue/AssaultWeaponBlue.mesh + false + + + + + + + + + + + Schema/Entities/RayBlue.xml + + + + + + + + + + diff --git a/resources/Schema/Entities/Player.xml b/resources/Schema/Entities/Player.xml index 4ba23a0d..9f8e0955 100644 --- a/resources/Schema/Entities/Player.xml +++ b/resources/Schema/Entities/Player.xml @@ -23,7 +23,9 @@ - + + + @@ -90,24 +92,33 @@ - - Models/Weapons/CrosshairQuad.mesh - + + Textures/Weapons/Crosshair/SmallThickHoleDot.png + false + - - + + + + + Schema/Entities/HitMarker.xml + + + + + Idle - 0.52743271827223559 + 0.1719161089749548 1 @@ -124,10 +135,11 @@ Models/Weapons/Blue/AssaultWeaponBlue.mesh + true - - + + @@ -144,6 +156,15 @@ + + + + Schema/Entities/WeaponReloadEffect.xml + + + + + @@ -166,7 +187,7 @@ Idle - 0.69666320633760392 + 1.8038469763698401 1 @@ -188,10 +209,11 @@ Models/Weapons/Blue/AssaultWeaponBlue.mesh + false - - + + diff --git a/resources/Schema/Entities/WeaponReloadEffect.xml b/resources/Schema/Entities/WeaponReloadEffect.xml new file mode 100644 index 00000000..3099b405 --- /dev/null +++ b/resources/Schema/Entities/WeaponReloadEffect.xml @@ -0,0 +1,31 @@ + + + + + + R_Arm_Weapon_Joint + + + 2 + + + true + + + true + + true + + + Models/Weapons/Blue/AssaultWeaponBlue.mesh + true + + + + + + + + + + diff --git a/src/Engine/Core/EntityFilePreprocessor.cpp b/src/Engine/Core/EntityFilePreprocessor.cpp index 86217979..a1370dd2 100644 --- a/src/Engine/Core/EntityFilePreprocessor.cpp +++ b/src/Engine/Core/EntityFilePreprocessor.cpp @@ -65,7 +65,6 @@ void EntityFilePreprocessor::parseComponentInfo() // Name compInfo.Name = XS::ToString(element->getName()); - bool brk = compInfo.Name == "HiddenForLocalPlayer"; // Known allocation compInfo.Meta->Allocation = m_ComponentCounts[compInfo.Name]; // Annotation diff --git a/src/Engine/Network/Client.cpp b/src/Engine/Network/Client.cpp index 7d2c8f92..b03aad07 100644 --- a/src/Engine/Network/Client.cpp +++ b/src/Engine/Network/Client.cpp @@ -390,8 +390,9 @@ bool Client::OnInputCommand(const Events::InputCommand & e) bool Client::OnPlayerDamage(const Events::PlayerDamage & e) { Packet packet(MessageType::OnPlayerDamage, m_SendPacketID); + packet.WritePrimitive(m_ClientIDToServerID.at(e.Inflictor.ID)); + packet.WritePrimitive(m_ClientIDToServerID.at(e.Victim.ID)); packet.WritePrimitive(e.Damage); - packet.WritePrimitive(m_ClientIDToServerID.at(e.Player.ID)); send(packet); return false; } diff --git a/src/Engine/Network/Server.cpp b/src/Engine/Network/Server.cpp index 7ad1cc76..1f0b3bc7 100644 --- a/src/Engine/Network/Server.cpp +++ b/src/Engine/Network/Server.cpp @@ -299,8 +299,9 @@ void Server::parseOnInputCommand(Packet& packet) void Server::parseOnPlayerDamage(Packet & packet) { Events::PlayerDamage e; + e.Inflictor = EntityWrapper(m_World, packet.ReadPrimitive()); + e.Victim = EntityWrapper(m_World, packet.ReadPrimitive()); e.Damage = packet.ReadPrimitive(); - e.Player = EntityWrapper(m_World, packet.ReadPrimitive()); m_EventBroker->Publish(e); //LOG_DEBUG("Server::parseOnPlayerDamage: Command is %s. Value is %f. PlayerID is %i.", e.DamageAmount, e.PlayerDamagedID, e.TypeOfDamage.c_str()); } diff --git a/src/Game/Systems/HealthSystem.cpp b/src/Game/Systems/HealthSystem.cpp index bb02ea13..29d8790d 100644 --- a/src/Game/Systems/HealthSystem.cpp +++ b/src/Game/Systems/HealthSystem.cpp @@ -15,13 +15,13 @@ void HealthSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapper& comp bool HealthSystem::OnPlayerDamaged(Events::PlayerDamage& e) { - ComponentWrapper cHealth = e.Player["Health"]; + ComponentWrapper cHealth = e.Victim["Health"]; double& health = cHealth["Health"]; health -= e.Damage; if (health <= 0.0) { Events::PlayerDeath ePlayerDeath; - ePlayerDeath.Player = e.Player; + ePlayerDeath.Player = e.Victim; m_EventBroker->Publish(ePlayerDeath); //Note: we will delete the entity in PlayerDeathSystem } diff --git a/src/Game/Systems/PlayerDeathSystem.cpp b/src/Game/Systems/PlayerDeathSystem.cpp index 29ed9832..78e20490 100644 --- a/src/Game/Systems/PlayerDeathSystem.cpp +++ b/src/Game/Systems/PlayerDeathSystem.cpp @@ -41,7 +41,9 @@ void PlayerDeathSystem::createDeathEffect(EntityWrapper player) playerEntityModel.Copy(deathEffectEW["Model"]); playerEntityAnimation.Copy(deathEffectEW["Animation"]); //freeze the animation - deathEffectEW["Animation"]["Speed"] = 0.0; + deathEffectEW["Animation"]["Speed1"] = 0.0; + deathEffectEW["Animation"]["Speed2"] = 0.0; + deathEffectEW["Animation"]["Speed3"] = 0.0; //copy the models position,orientation deathEffectEW["Transform"]["Position"] = (glm::vec3)player["Transform"]["Position"]; @@ -50,8 +52,10 @@ void PlayerDeathSystem::createDeathEffect(EntityWrapper player) //deathEffectEW["ExplosionEffect"]["ExplosionOrigin"] = glm::vec3(0, 0, 0); //camera (with lifetime) behind the player - auto cam = deathEffectEW.FirstChildByName("Camera"); - Events::SetCamera eSetCamera; - eSetCamera.CameraEntity = cam; - m_EventBroker->Publish(eSetCamera); + if (player == LocalPlayer) { + auto cam = deathEffectEW.FirstChildByName("Camera"); + Events::SetCamera eSetCamera; + eSetCamera.CameraEntity = cam; + m_EventBroker->Publish(eSetCamera); + } } diff --git a/src/Game/Systems/SoundSystem.cpp b/src/Game/Systems/SoundSystem.cpp index 10dc61f7..d6ac7dab 100644 --- a/src/Game/Systems/SoundSystem.cpp +++ b/src/Game/Systems/SoundSystem.cpp @@ -54,7 +54,7 @@ bool SoundSystem::OnInputCommand(const Events::InputCommand & e) } if (e.Command == "TakeDamage" && e.Value > 0) { Events::PlayerDamage ev; - ev.Player = LocalPlayer; + ev.Victim = LocalPlayer; ev.Damage = 1.0; m_EventBroker->Publish(ev); } diff --git a/src/Game/Systems/SpawnerSystem.cpp b/src/Game/Systems/SpawnerSystem.cpp index 99f5df93..b3c556f1 100644 --- a/src/Game/Systems/SpawnerSystem.cpp +++ b/src/Game/Systems/SpawnerSystem.cpp @@ -48,10 +48,12 @@ EntityWrapper SpawnerSystem::Spawn(EntityWrapper spawner, EntityWrapper parent / EntityFileParser parser(entityFile); EntityWrapper spawnedEntity(world, parser.MergeEntities(world, parent.ID)); - // Set its position and orientation to that of the SpawnPoint - spawnedEntity["Transform"]["Position"] = Transform::AbsolutePosition(spawnPoint.World, spawnPoint.ID); - // TODO: Quaternions, bitch - spawnedEntity["Transform"]["Orientation"] = glm::eulerAngles(Transform::AbsoluteOrientation(spawnPoint)); + if (spawnPoint != parent) { + // Set its position and orientation to that of the SpawnPoint + spawnedEntity["Transform"]["Position"] = Transform::AbsolutePosition(spawnPoint.World, spawnPoint.ID); + // TODO: Quaternions, bitch + spawnedEntity["Transform"]["Orientation"] = glm::eulerAngles(Transform::AbsoluteOrientation(spawnPoint)); + } return spawnedEntity; } diff --git a/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp b/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp index bb5a025f..724e1f2c 100644 --- a/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp +++ b/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp @@ -1,9 +1,9 @@ #include "Systems/Weapon/AssaultWeaponBehaviour.h" -AssaultWeaponBehaviour::AssaultWeaponBehaviour(SystemParams systemParams, Octree* collisionOctree, EntityWrapper weaponEntity) - : WeaponBehaviour(systemParams, collisionOctree, weaponEntity) +AssaultWeaponBehaviour::AssaultWeaponBehaviour(SystemParams systemParams, IRenderer* renderer, Octree* collisionOctree, EntityWrapper player) + : WeaponBehaviour(systemParams, renderer, collisionOctree, player) { - m_FirstPersonModel = m_Entity.FirstChildByName("Hands"); + m_FirstPersonModel = m_Player.FirstChildByName("Hands"); EVENT_SUBSCRIBE_MEMBER(m_EAnimationComplete, &AssaultWeaponBehaviour::OnAnimationComplete); } @@ -12,7 +12,6 @@ void AssaultWeaponBehaviour::Fire() m_TimeSinceLastFire = 0.0; m_Firing = true; fireRound(); - playShootAnimation(); } void AssaultWeaponBehaviour::CeaseFire() @@ -22,29 +21,48 @@ void AssaultWeaponBehaviour::CeaseFire() void AssaultWeaponBehaviour::Reload() { - ComponentWrapper& cAssaultWeapon = m_Entity["AssaultWeapon"]; + if (m_Reloading) { + return; + } - int& magAmmo = cAssaultWeapon["MagazineAmmo"]; + ComponentWrapper& cAssaultWeapon = m_Player["AssaultWeapon"]; + int magAmmo = cAssaultWeapon["MagazineAmmo"]; int magSize = cAssaultWeapon["MagazineSize"]; - int& ammo = cAssaultWeapon["Ammo"]; + int ammo = cAssaultWeapon["Ammo"]; // Don't reload if we're already fully loaded if (magAmmo == magSize) { return; } - // Throw away rounds in magazine to incentivise ammo sharing - int toLoad = glm::min(magSize, ammo); - magAmmo = toLoad; - ammo -= toLoad; + // Don't reload if we're completly out of ammo + if (ammo == 0) { + return; + } + + m_Reloading = true; + m_ReloadTimer = cAssaultWeapon["ReloadTime"]; + playReloadAnimation(); } void AssaultWeaponBehaviour::Update(double dt) { - if (m_Firing) { - m_TimeSinceLastFire += dt; + if (m_Reloading) { + m_ReloadTimer -= dt; + // Re-enable glow on reload impersonator half-way through the animation + if (m_ReloadTimer <= (double)m_Player["AssaultWeapon"]["ReloadTime"] / 2.0) { + if (m_ReloadImpersonator.Valid()) { + m_ReloadImpersonator["Model"]["GlowMap"] = true; + } + } + if (m_ReloadTimer <= 0) { + finishReload(); + } + } - ComponentWrapper& cAssaultWeapon = m_Entity["AssaultWeapon"]; + if (m_Firing && !m_Reloading) { + m_TimeSinceLastFire += dt; + ComponentWrapper& cAssaultWeapon = m_Player["AssaultWeapon"]; if (m_TimeSinceLastFire >= 1.0 / ((double)cAssaultWeapon["RPM"] / 60.0)) { fireRound(); } @@ -53,6 +71,13 @@ void AssaultWeaponBehaviour::Update(double dt) if (!m_Firing && !m_Reloading) { playIdleAnimation(); } + + // Disable glow map on weapon if it's out of ammo + // Make real first person weapon model visible again + EntityWrapper firstPersonWeaponModel = m_Player.FirstChildByName("WeaponModel"); + if (firstPersonWeaponModel.Valid()) { + firstPersonWeaponModel["Model"]["GlowMap"] = hasAmmo(); + } } bool AssaultWeaponBehaviour::OnAnimationComplete(Events::AnimationComplete& e) @@ -70,9 +95,20 @@ bool AssaultWeaponBehaviour::OnAnimationComplete(Events::AnimationComplete& e) return true; } +bool AssaultWeaponBehaviour::hasAmmo() +{ + ComponentWrapper& cAssaultWeapon = m_Player["AssaultWeapon"]; + int& magAmmo = cAssaultWeapon["MagazineAmmo"]; + return magAmmo > 0; +} + void AssaultWeaponBehaviour::fireRound() { - ComponentWrapper& cAssaultWeapon = m_Entity["AssaultWeapon"]; + if (m_Reloading) { + return; + } + + ComponentWrapper& cAssaultWeapon = m_Player["AssaultWeapon"]; int& magAmmo = cAssaultWeapon["MagazineAmmo"]; int ammo = cAssaultWeapon["Ammo"]; @@ -88,6 +124,11 @@ void AssaultWeaponBehaviour::fireRound() spawnTracer(); playSound(); viewPunch(); + playShootAnimation(); + bool hit = shoot(cAssaultWeapon["BaseDamage"]); + if (hit) { + showHitMarker(); + } m_TimeSinceLastFire = 0.0; } @@ -99,25 +140,32 @@ void AssaultWeaponBehaviour::spawnTracer() } EntityWrapper spawner; - if (m_Entity == LocalPlayer) { - spawner = m_Entity.FirstChildByName("WeaponMuzzle"); + if (m_Player == LocalPlayer) { + spawner = m_Player.FirstChildByName("WeaponMuzzle"); } else { - spawner = m_Entity.FirstChildByName("ThirdPersonWeaponMuzzle"); + spawner = m_Player.FirstChildByName("ThirdPersonWeaponMuzzle"); } if (!spawner.Valid()) { return; } - Events::SpawnerSpawn e; - e.Spawner = spawner; - m_EventBroker->Publish(e); + float distance = traceRayDistance(Transform::AbsolutePosition(spawner), Transform::AbsoluteOrientation(spawner) * glm::vec3(0, 0, -1)); + EntityWrapper ray = SpawnerSystem::Spawn(spawner); + ((glm::vec3&)ray["Transform"]["Scale"]).z = (distance / 100.f); } float AssaultWeaponBehaviour::traceRayDistance(glm::vec3 origin, glm::vec3 direction) { // TODO: Cast a ray and size tracer appropriately - return 100.f; + float distance; + glm::vec3 pos; + auto entity = Collision::EntityFirstHitByRay(Ray(origin, direction), m_CollisionOctree, distance, pos); + if (entity) { + return distance; + } else { + return 100.f; + } } void AssaultWeaponBehaviour::playSound() @@ -127,32 +175,52 @@ void AssaultWeaponBehaviour::playSound() } Events::PlaySoundOnEntity e; - e.EmitterID = m_Entity.ID; + e.EmitterID = m_Player.ID; e.FilePath = "Audio/laser/laser1.wav"; m_EventBroker->Publish(e); } void AssaultWeaponBehaviour::viewPunch() { - EntityWrapper playerCamera = m_Entity.FirstChildByName("Camera"); + EntityWrapper playerCamera = m_Player.FirstChildByName("Camera"); if (!playerCamera.Valid()) { return; } - float viewPunch = m_Entity["AssaultWeapon"]["ViewPunch"]; + float viewPunch = m_Player["AssaultWeapon"]["ViewPunch"]; ComponentWrapper cTransform = playerCamera["Transform"]; glm::vec3& orientation = cTransform["Orientation"]; orientation.x += viewPunch; } +void AssaultWeaponBehaviour::finishReload() +{ + ComponentWrapper& cAssaultWeapon = m_Player["AssaultWeapon"]; + int& magAmmo = cAssaultWeapon["MagazineAmmo"]; + int magSize = cAssaultWeapon["MagazineSize"]; + int& ammo = cAssaultWeapon["Ammo"]; + + // Throw away rounds in magazine to incentivise ammo sharing + int toLoad = glm::min(magSize, ammo); + magAmmo = toLoad; + ammo -= toLoad; + + // Make real first person weapon model visible again + EntityWrapper firstPersonWeaponModel = m_Player.FirstChildByName("WeaponModel"); + firstPersonWeaponModel["Model"]["Visible"] = true; + + m_Reloading = false; +} + void AssaultWeaponBehaviour::playShootAnimation() { - EntityWrapper firstPersonWeapon = m_Entity.FirstChildByName("Hands"); - ComponentWrapper cAnimation = firstPersonWeapon["Animation"]; - cAnimation["AnimationName1"] = "ShootRifle"; - cAnimation["Weight1"] = 1.0; - cAnimation["Time1"] = 0.0; - cAnimation["Speed1"] = 1.0; - cAnimation["Loop1"] = true; + ComponentWrapper cAnimation = m_FirstPersonModel["Animation"]; + if (cAnimation["AnimationName1"] != "ShootRifle") { + cAnimation["AnimationName1"] = "ShootRifle"; + cAnimation["Weight1"] = 1.0; + cAnimation["Time1"] = 0.0; + cAnimation["Speed1"] = 1.0; + cAnimation["Loop1"] = true; + } } void AssaultWeaponBehaviour::playIdleAnimation() @@ -168,11 +236,11 @@ void AssaultWeaponBehaviour::playIdleAnimation() std::string animationToPlay = "Idle"; double speedToSet = 1.0; - ComponentWrapper cPlayer = m_Entity["Player"]; + ComponentWrapper cPlayer = m_Player["Player"]; glm::vec3 movementDirection = cPlayer["CurrentWishDirection"]; if (glm::length2(movementDirection) > 0) { animationToPlay = "Run"; - ComponentWrapper cPhysics = m_Entity["Physics"]; + ComponentWrapper cPhysics = m_Player["Physics"]; speedToSet = glm::length((glm::vec3)cPhysics["Velocity"]) / (float)cPlayer["MovementSpeed"]; } @@ -188,3 +256,85 @@ void AssaultWeaponBehaviour::playIdleAnimation() } } +void AssaultWeaponBehaviour::playReloadAnimation() +{ + // Play animation + ComponentWrapper cAnimation = m_FirstPersonModel["Animation"]; + cAnimation["AnimationName1"] = "ReloadSwitch"; + cAnimation["Weight1"] = 1.0; + cAnimation["Time1"] = 0.0; + cAnimation["Speed1"] = 0.5; + cAnimation["Loop1"] = true; + + // Hide weapon model and spawn the exploding version + EntityWrapper firstPersonWeaponModel = m_Player.FirstChildByName("WeaponModel"); + EntityWrapper reloadSpawner = m_Player.FirstChildByName("FirstPersonReloadSpawner"); + m_ReloadImpersonator = SpawnerSystem::Spawn(reloadSpawner, reloadSpawner); + firstPersonWeaponModel["Model"].Copy(m_ReloadImpersonator["Model"]); + firstPersonWeaponModel["Model"]["Visible"] = false; +} + +bool AssaultWeaponBehaviour::shoot(double damage) +{ + // Only do shooting clientside + if (!IsClient) { + return false; + } + + // Only handle shooting for the local player + if (m_Player != LocalPlayer) { + return false; + } + + // Make sure the player isn't shooting from the grave + if (!m_Player.Valid()) { + return false; + } + + // Screen center, based on current resolution! + Rectangle screenResolution = m_Renderer->GetViewportSize(); + glm::vec2 centerScreen = glm::vec2(screenResolution.Width / 2, screenResolution.Height / 2); + + // Pick middle of screen + PickData pickData = m_Renderer->Pick(centerScreen); + if (pickData.Entity == EntityID_Invalid) { + return false; + } + + EntityWrapper victim(m_World, pickData.Entity); + + // Don't let us shoot ourselves in the foot + if (victim == LocalPlayer) { + return false; + } + + // Only care about players being hit + if (!victim.HasComponent("Player")) { + victim = victim.FirstParentWithComponent("Player"); + } + if (!victim.Valid()) { + return false; + } + + // Check for friendly fire + if ((ComponentInfo::EnumType)victim["Team"]["Team"] == (ComponentInfo::EnumType)m_Player["Team"]["Team"]) { + return false; + } + + // Deal damage! + Events::PlayerDamage ePlayerDamage; + ePlayerDamage.Victim = victim; + ePlayerDamage.Damage = damage; + m_EventBroker->Publish(ePlayerDamage); + + return true; +} + +void AssaultWeaponBehaviour::showHitMarker() +{ + // Show hit marker + EntityWrapper hitMarkerSpawner = m_Player.FirstChildByName("HitMarkerSpawner"); + if (hitMarkerSpawner.Valid()) { + SpawnerSystem::Spawn(hitMarkerSpawner, hitMarkerSpawner); + } +} diff --git a/src/Game/Systems/Weapon/WeaponSystem.cpp b/src/Game/Systems/Weapon/WeaponSystem.cpp index bdd27ea9..34d5fd43 100644 --- a/src/Game/Systems/Weapon/WeaponSystem.cpp +++ b/src/Game/Systems/Weapon/WeaponSystem.cpp @@ -8,7 +8,6 @@ WeaponSystem::WeaponSystem(SystemParams params, IRenderer* renderer, OctreeReload(); + } + } + return true; } @@ -69,7 +76,7 @@ void WeaponSystem::selectWeapon(EntityWrapper player, ComponentInfo::EnumType sl if (slot == 1) { // TODO: if class... if (m_ActiveWeapons.count(player) == 0) { - m_ActiveWeapons.insert(std::make_pair(player, std::make_shared(m_SystemParams, m_CollisionOctree, player))); + m_ActiveWeapons.insert(std::make_pair(player, std::make_shared(m_SystemParams, m_Renderer, m_CollisionOctree, player))); } else { //m_ActiveWeapons.erase(player); } @@ -87,52 +94,3 @@ bool WeaponSystem::OnPlayerSpawned(Events::PlayerSpawned& e) // TODO: Select the active one specified by player component return true; } - -bool WeaponSystem::OnShoot(Events::Shoot& eShoot) -{ - if (!eShoot.Player.Valid()) { - return false; - } - - // Only run further picking code for the local player! - if (eShoot.Player != LocalPlayer) { - return false; - } - - // Screen center, based on current resolution! - // TODO: check if player has enough ammo and if weapon has a cooldown or not - Rectangle screenResolution = m_Renderer->GetViewportSize(); - glm::vec2 centerScreen = glm::vec2(screenResolution.Width / 2, screenResolution.Height / 2); - - // TODO: check if player has enough ammo and if weapon has a cooldown or not - - // Pick middle of screen - PickData pickData = m_Renderer->Pick(centerScreen); - if (pickData.Entity == EntityID_Invalid) { - return false; - } - - EntityWrapper player(m_World, pickData.Entity); - - // Only care about players being hit - if (!player.HasComponent("Player")) { - player = player.FirstParentWithComponent("Player"); - } - if (!player.Valid()) { - return false; - } - - // Check for friendly fire - EntityWrapper shooter = eShoot.Player; - if ((ComponentInfo::EnumType)player["Team"]["Team"] == (ComponentInfo::EnumType)shooter["Team"]["Team"]) { - return false; - } - - // TODO: Weapon damage calculations etc - Events::PlayerDamage ePlayerDamage; - ePlayerDamage.Player = player; - ePlayerDamage.Damage = 100; - m_EventBroker->Publish(ePlayerDamage); - - return true; -} \ No newline at end of file diff --git a/src/Tests/HealthSystemTest.cpp b/src/Tests/HealthSystemTest.cpp index 36608f8f..8bf16024 100644 --- a/src/Tests/HealthSystemTest.cpp +++ b/src/Tests/HealthSystemTest.cpp @@ -71,7 +71,7 @@ GameHealthSystemTest::GameHealthSystemTest() //damage player with 50 Events::PlayerDamage e; e.Damage = 50.0f; - e.Player = EntityWrapper(m_World, player.EntityID); + e.Victim = EntityWrapper(m_World, player.EntityID); m_EventBroker->Publish(e); //heal some other player with 40 From 1bb1a1445ee23982189736389ed6edd6cbf094ed Mon Sep 17 00:00:00 2001 From: Teejoon Date: Thu, 11 Feb 2016 22:51:39 +0100 Subject: [PATCH 16/25] Commit assets --- assets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets b/assets index 105b22fc..4d36fdce 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 105b22fc67b68993db43deec3250084ed625d893 +Subproject commit 4d36fdced7007a594a56b7371bb26861876889aa From 44a73ef88376cf22665e4189069aa5d484ae383d Mon Sep 17 00:00:00 2001 From: sippeangelo Date: Thu, 11 Feb 2016 23:44:20 +0100 Subject: [PATCH 17/25] fixup! Merge remote-tracking branch 'origin/master' into WeaponSystem --- include/Game/Systems/DamageIndicatorSystem.h | 4 ++-- src/Game/Systems/DamageIndicatorSystem.cpp | 18 +++++++++++------- .../Systems/Weapon/AssaultWeaponBehaviour.cpp | 1 + src/Game/Systems/Weapon/WeaponSystem.cpp | 4 +--- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/include/Game/Systems/DamageIndicatorSystem.h b/include/Game/Systems/DamageIndicatorSystem.h index e70a69a9..053b196b 100644 --- a/include/Game/Systems/DamageIndicatorSystem.h +++ b/include/Game/Systems/DamageIndicatorSystem.h @@ -21,8 +21,8 @@ public: DamageIndicatorSystem(SystemParams params); private: - EventRelay m_DamageTakenFromPlayer; - bool OnPlayerDamageTaken(Events::PlayerDamage& e); + EventRelay m_EPlayerDamage; + bool OnPlayerDamage(Events::PlayerDamage& e); EventRelay m_ESetCamera; bool OnSetCamera(const Events::SetCamera& e); diff --git a/src/Game/Systems/DamageIndicatorSystem.cpp b/src/Game/Systems/DamageIndicatorSystem.cpp index 93385e48..a29309b5 100644 --- a/src/Game/Systems/DamageIndicatorSystem.cpp +++ b/src/Game/Systems/DamageIndicatorSystem.cpp @@ -3,7 +3,7 @@ DamageIndicatorSystem::DamageIndicatorSystem(SystemParams params) : System(params) { - EVENT_SUBSCRIBE_MEMBER(m_DamageTakenFromPlayer, &DamageIndicatorSystem::OnPlayerDamageTaken); + EVENT_SUBSCRIBE_MEMBER(m_EPlayerDamage, &DamageIndicatorSystem::OnPlayerDamage); //current camera EVENT_SUBSCRIBE_MEMBER(m_ESetCamera, &DamageIndicatorSystem::OnSetCamera); @@ -12,23 +12,27 @@ DamageIndicatorSystem::DamageIndicatorSystem(SystemParams params) auto entityFile = ResourceManager::Load("Schema/Entities/DamageIndicator.xml"); } -bool DamageIndicatorSystem::OnPlayerDamageTaken(Events::PlayerDamage& e) +bool DamageIndicatorSystem::OnPlayerDamage(Events::PlayerDamage& e) { - if (m_CurrentCamera == -1) { + if (m_CurrentCamera == EntityID_Invalid) { + return false; + } + + if (e.Victim != LocalPlayer) { return false; } //grab players direction - auto playerOrientation = glm::quat((glm::vec3)e.Player["Transform"]["Orientation"]); + auto playerOrientation = glm::quat((glm::vec3)e.Victim["Transform"]["Orientation"]); //get the position vectors, but ignore the y-height - auto enemyPosition = (glm::vec3) e.PlayerShooter["Transform"]["Position"]; - auto playerPosition = (glm::vec3) e.Player["Transform"]["Position"]; + auto enemyPosition = (glm::vec3)e.Inflictor["Transform"]["Position"]; + auto playerPosition = (glm::vec3)e.Victim["Transform"]["Position"]; enemyPosition.y = 0.0f; playerPosition.y = 0.0f; //calculate the enemy to player vector - auto enemyPlayerVector = glm::normalize((glm::vec3) playerPosition - enemyPosition); + auto enemyPlayerVector = glm::normalize(playerPosition - enemyPosition); //get angle from players current rotation, this angle is how much you rotate around the y-axis auto playerAngle = glm::angle(playerOrientation); diff --git a/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp b/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp index 724e1f2c..54c3a590 100644 --- a/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp +++ b/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp @@ -323,6 +323,7 @@ bool AssaultWeaponBehaviour::shoot(double damage) // Deal damage! Events::PlayerDamage ePlayerDamage; + ePlayerDamage.Inflictor = m_Player; ePlayerDamage.Victim = victim; ePlayerDamage.Damage = damage; m_EventBroker->Publish(ePlayerDamage); diff --git a/src/Game/Systems/Weapon/WeaponSystem.cpp b/src/Game/Systems/Weapon/WeaponSystem.cpp index 4a25b811..3a49ae90 100644 --- a/src/Game/Systems/Weapon/WeaponSystem.cpp +++ b/src/Game/Systems/Weapon/WeaponSystem.cpp @@ -93,6 +93,4 @@ bool WeaponSystem::OnPlayerSpawned(Events::PlayerSpawned& e) // Select primary weapon on player spawn // TODO: Select the active one specified by player component return true; -} - - ePlayerDamage.PlayerShooter = eShoot.Player; \ No newline at end of file +} \ No newline at end of file From b761439c843bb85ab189f9432b5ac1881f78683c Mon Sep 17 00:00:00 2001 From: sippeangelo Date: Thu, 11 Feb 2016 23:45:30 +0100 Subject: [PATCH 18/25] Added config flag Debug.OutOfBodyExperience that allows you to spawn and view a player from a third person perspective, without the active camera being changed. --- include/Engine/Rendering/RenderSystem.h | 4 +++ resources/DefaultConfig.ini | 2 ++ src/Engine/Rendering/RenderSystem.cpp | 40 +++++++++++++++---------- src/Game/Systems/PlayerSpawnSystem.cpp | 3 +- tools/deploy.bat | 2 ++ 5 files changed, 34 insertions(+), 17 deletions(-) diff --git a/include/Engine/Rendering/RenderSystem.h b/include/Engine/Rendering/RenderSystem.h index d73d8680..7580d654 100644 --- a/include/Engine/Rendering/RenderSystem.h +++ b/include/Engine/Rendering/RenderSystem.h @@ -18,6 +18,7 @@ #include "../Core/EPlayerSpawned.h" #include "../Core/Octree.h" #include "../Collision/EntityAABB.h" +#include "../Core/ConfigFile.h" class RenderSystem : public ImpureSystem { @@ -48,6 +49,9 @@ private: void fillDirectionalLights(std::list>& jobs, World* world); void fillLight(std::list>& jobs); void fillSprites(std::list>& jobs, World* world); + + bool isEntityVisible(EntityWrapper& entity); + bool isChildOfACamera(EntityWrapper entity); bool isChildOfCurrentCamera(EntityWrapper entity); }; diff --git a/resources/DefaultConfig.ini b/resources/DefaultConfig.ini index 12ec06c8..6911632f 100644 --- a/resources/DefaultConfig.ini +++ b/resources/DefaultConfig.ini @@ -4,6 +4,8 @@ LoadMap= ; if true -> Pool allocation is not used when calling Allocate/Free, just use regular dynamic allocation. ; if false -> Use pool allocation. DisableMemoryPool=false +EditorEnabled=false +OutOfBodyExperience=false [Editor] CameraSpeed=3 diff --git a/src/Engine/Rendering/RenderSystem.cpp b/src/Engine/Rendering/RenderSystem.cpp index 6600bc4f..7beb85db 100644 --- a/src/Engine/Rendering/RenderSystem.cpp +++ b/src/Engine/Rendering/RenderSystem.cpp @@ -47,16 +47,8 @@ void RenderSystem::fillSprites(std::list>& jobs, Worl continue; } - EntityWrapper entity(world, cSprite.EntityID); - - // Only render children of a camera if that camera is currently active - if (isChildOfACamera(entity) && !isChildOfCurrentCamera(entity)) { - continue; - } - - // Hide things parented to local player if they have the HiddenFromLocalPlayer component - if (entity.HasComponent("HiddenForLocalPlayer") && (entity == m_LocalPlayer || entity.IsChildOf(m_LocalPlayer))) { + if (!isEntityVisible(entity)) { continue; } @@ -85,6 +77,23 @@ void RenderSystem::fillSprites(std::list>& jobs, Worl } } +bool RenderSystem::isEntityVisible(EntityWrapper& entity) +{ + + // Only render children of a camera if that camera is currently active + if (isChildOfACamera(entity) && !isChildOfCurrentCamera(entity)) { + return false; + } + + // Hide things parented to local player if they have the HiddenFromLocalPlayer component + bool outOfBodyExperience = ResourceManager::Load("Config.ini")->Get("Debug.OutOfBodyExperience", false); + if (entity.HasComponent("HiddenForLocalPlayer") && (entity == m_LocalPlayer || entity.IsChildOf(m_LocalPlayer)) && !outOfBodyExperience) { + return false; + } + + return true; +} + bool RenderSystem::isChildOfACamera(EntityWrapper entity) { return entity.FirstParentWithComponent("Camera").Valid(); @@ -112,13 +121,7 @@ void RenderSystem::fillModels(RenderScene::Queues &Jobs) continue; } - // Only render children of a camera if that camera is currently active - if (isChildOfACamera(entity) && !isChildOfCurrentCamera(entity)) { - continue; - } - - // Hide things parented to local player if they have the HiddenFromLocalPlayer component - if ((entity.HasComponent("HiddenForLocalPlayer") || entity.FirstParentWithComponent("HiddenForLocalPlayer").Valid()) && (entity == m_LocalPlayer || entity.IsChildOf(m_LocalPlayer))) { + if (!isEntityVisible(entity)) { continue; } @@ -299,6 +302,11 @@ void RenderSystem::fillText(std::list>& jobs, World* continue; } + EntityWrapper entity(world, textComponent.EntityID); + if (!isEntityVisible(entity)) { + continue; + } + Font* font; try { font = ResourceManager::Load(resource); diff --git a/src/Game/Systems/PlayerSpawnSystem.cpp b/src/Game/Systems/PlayerSpawnSystem.cpp index 507ed0f5..444fc08f 100644 --- a/src/Game/Systems/PlayerSpawnSystem.cpp +++ b/src/Game/Systems/PlayerSpawnSystem.cpp @@ -88,7 +88,8 @@ bool PlayerSpawnSystem::OnPlayerSpawned(Events::PlayerSpawned& e) // Set the camera to the correct entity EntityWrapper cameraEntity = e.Player.FirstChildByName("Camera"); - if (cameraEntity.Valid()) { + bool outOfBodyExperience = ResourceManager::Load("Config.ini")->Get("Debug.OutOfBodyExperience", false); + if (cameraEntity.Valid() && !outOfBodyExperience) { Events::SetCamera e; e.CameraEntity = cameraEntity; m_EventBroker->Publish(e); diff --git a/tools/deploy.bat b/tools/deploy.bat index 29dc9e62..cd7a44bc 100755 --- a/tools/deploy.bat +++ b/tools/deploy.bat @@ -22,7 +22,9 @@ MKLINK "%DeployLocation%\Schema\" "resources\Schema" /J RMDIR /S /Q "%DeployLocation%\Shaders" MKLINK "%DeployLocation%\Shaders\" "resources\Shaders" /J :: Configuration files +DEL "%DeployLocation%\DefaultConfig.ini" MKLINK "%DeployLocation%\DefaultConfig.ini" "resources\DefaultConfig.ini" /H +DEL "%DeployLocation%\DefaultInput.ini" MKLINK "%DeployLocation%\DefaultInput.ini" "resources\DefaultInput.ini" /H :: Platform specific binaries From af30e515641711dc83e8c4ad42b3f0da68279d97 Mon Sep 17 00:00:00 2001 From: verysecrethero Date: Thu, 11 Feb 2016 23:56:40 +0100 Subject: [PATCH 19/25] Added AmmoPickupSystem with Component, Entity. Changed so PlayerDeathSystem gets updated after Health/Ammo systems, credits to William. --- include/Engine/Core/EAmmoPickup.h | 18 ++ include/Game/Systems/AmmoPickupSystem.h | 32 ++ resources/Schema/Components.xsd | 1 + resources/Schema/Components/AmmoPickup.xml | 5 + resources/Schema/Components/AmmoPickup.xsd | 21 ++ resources/Schema/Entities/AmmoPickup.xml | 18 ++ resources/Schema/Entities/AmmoPickupTest.xml | 294 +++++++++++++++++++ src/Game/Game.cpp | 4 +- src/Game/Systems/AmmoPickupSystem.cpp | 78 +++++ 9 files changed, 470 insertions(+), 1 deletion(-) create mode 100644 include/Engine/Core/EAmmoPickup.h create mode 100644 include/Game/Systems/AmmoPickupSystem.h create mode 100644 resources/Schema/Components/AmmoPickup.xml create mode 100644 resources/Schema/Components/AmmoPickup.xsd create mode 100644 resources/Schema/Entities/AmmoPickup.xml create mode 100644 resources/Schema/Entities/AmmoPickupTest.xml create mode 100644 src/Game/Systems/AmmoPickupSystem.cpp diff --git a/include/Engine/Core/EAmmoPickup.h b/include/Engine/Core/EAmmoPickup.h new file mode 100644 index 00000000..6d854d48 --- /dev/null +++ b/include/Engine/Core/EAmmoPickup.h @@ -0,0 +1,18 @@ +#ifndef EAmmoPickup_h__ +#define EAmmoPickup_h__ + +#include "EventBroker.h" +#include "../Core/EntityWrapper.h" + +namespace Events +{ + + struct AmmoPickup : Event + { + EntityWrapper Player; + int AmmoGain; + }; + +} + +#endif \ No newline at end of file diff --git a/include/Game/Systems/AmmoPickupSystem.h b/include/Game/Systems/AmmoPickupSystem.h new file mode 100644 index 00000000..a54b8495 --- /dev/null +++ b/include/Game/Systems/AmmoPickupSystem.h @@ -0,0 +1,32 @@ +#ifndef AmmoPickupSystem_h__ +#define AmmoPickupSystem_h__ + +#include "Core/System.h" +#include "Core/Transform.h" +#include "Core/ResourceManager.h" +#include "Core/EntityFileParser.h" +#include "Core/EPickupSpawned.h" +#include "Core/EAmmoPickup.h" +#include "Engine/Collision/ETrigger.h" +#include "Common.h" + +class AmmoPickupSystem : public ImpureSystem +{ +public: + AmmoPickupSystem(SystemParams params); + + virtual void Update(double dt) override; + +private: + EventRelay m_ETriggerTouch; + bool OnTriggerTouch(Events::TriggerTouch& e); + + struct NewAmmoPickup { + glm::vec3 Pos; + double AmmoGain; + double RespawnTimer; + double DecreaseThisRespawnTimer; + }; + std::vector m_ETriggerTouchVector; +}; +#endif diff --git a/resources/Schema/Components.xsd b/resources/Schema/Components.xsd index f950e8c8..53e666de 100644 --- a/resources/Schema/Components.xsd +++ b/resources/Schema/Components.xsd @@ -32,6 +32,7 @@ + diff --git a/resources/Schema/Components/AmmoPickup.xml b/resources/Schema/Components/AmmoPickup.xml new file mode 100644 index 00000000..6da0b6fa --- /dev/null +++ b/resources/Schema/Components/AmmoPickup.xml @@ -0,0 +1,5 @@ + + + 3 + 30 + \ No newline at end of file diff --git a/resources/Schema/Components/AmmoPickup.xsd b/resources/Schema/Components/AmmoPickup.xsd new file mode 100644 index 00000000..1970eb78 --- /dev/null +++ b/resources/Schema/Components/AmmoPickup.xsd @@ -0,0 +1,21 @@ + + + + + + + + An Ammo Pickup + + + + + The respawn timer for a ammo pickup + + + How much percent ammo gain the player will get + + + + + diff --git a/resources/Schema/Entities/AmmoPickup.xml b/resources/Schema/Entities/AmmoPickup.xml new file mode 100644 index 00000000..534b76e2 --- /dev/null +++ b/resources/Schema/Entities/AmmoPickup.xml @@ -0,0 +1,18 @@ + + + + + + + + Models/Core/UnitSphere.mesh + + + + + + + + + + diff --git a/resources/Schema/Entities/AmmoPickupTest.xml b/resources/Schema/Entities/AmmoPickupTest.xml new file mode 100644 index 00000000..22690c65 --- /dev/null +++ b/resources/Schema/Entities/AmmoPickupTest.xml @@ -0,0 +1,294 @@ + + + + + + + + + + + + Models/LevelBase/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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + 22 + + + Models/Core/UnitSphere.mesh + + + + + + + + + + + + + 1 + 22 + + + Models/Core/UnitSphere.mesh + + + + + + + + + + + + + 4 + 44 + + + Models/Core/UnitSphere.mesh + + + + + + + + + + + diff --git a/src/Game/Game.cpp b/src/Game/Game.cpp index 8ee6dbed..e555923c 100644 --- a/src/Game/Game.cpp +++ b/src/Game/Game.cpp @@ -14,6 +14,7 @@ #include "Game/Systems/CapturePointSystem.h" #include "Game/Systems/CapturePointHUDSystem.h" #include "Game/Systems/PickupSpawnSystem.h" +#include "Game/Systems/AmmoPickupSystem.h" #include "Game/Systems/DamageIndicatorSystem.h" #include "Game/Systems/WeaponSystem.h" #include "Rendering/AnimationSystem.h" @@ -118,12 +119,12 @@ 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_Renderer, m_OctreeCollision); m_SystemPipeline->AddSystem(updateOrderLevel); m_SystemPipeline->AddSystem(updateOrderLevel); m_SystemPipeline->AddSystem(updateOrderLevel); m_SystemPipeline->AddSystem(updateOrderLevel); + m_SystemPipeline->AddSystem(updateOrderLevel); m_SystemPipeline->AddSystem(updateOrderLevel); // Populate Octree with collidables ++updateOrderLevel; @@ -132,6 +133,7 @@ Game::Game(int argc, char* argv[]) m_SystemPipeline->AddSystem(updateOrderLevel, m_OctreeFrustrumCulling); m_SystemPipeline->AddSystem(updateOrderLevel); m_SystemPipeline->AddSystem(updateOrderLevel); + m_SystemPipeline->AddSystem(updateOrderLevel); m_SystemPipeline->AddSystem(updateOrderLevel); // Collision and TriggerSystem should update after player. ++updateOrderLevel; diff --git a/src/Game/Systems/AmmoPickupSystem.cpp b/src/Game/Systems/AmmoPickupSystem.cpp new file mode 100644 index 00000000..f6778fe4 --- /dev/null +++ b/src/Game/Systems/AmmoPickupSystem.cpp @@ -0,0 +1,78 @@ +#include "Systems/AmmoPickupSystem.h" + +AmmoPickupSystem::AmmoPickupSystem(SystemParams params) + : System(params) +{ + EVENT_SUBSCRIBE_MEMBER(m_ETriggerTouch, &AmmoPickupSystem::OnTriggerTouch); +} + +void AmmoPickupSystem::Update(double dt) +{ + 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 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) + Events::PickupSpawned ePickupSpawned; + ePickupSpawned.Pickup = EntityWrapper(m_World, ammoPickupID); + m_EventBroker->Publish(ePickupSpawned); + + //set 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; + + //erase the current element (AmmoPickupPosition) + m_ETriggerTouchVector.erase(it); + break; + } + } +} + + +bool AmmoPickupSystem::OnTriggerTouch(Events::TriggerTouch& e) +{ + if (e.Entity != LocalPlayer) { + return false; + } + //TODO: add other weapontypes + if (!e.Entity.HasComponent("AssaultWeapon")) { + return false; + } + 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) { + 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({ (glm::vec3)e.Trigger["Transform"]["Position"] ,e.Trigger["AmmoPickup"]["AmmoGain"], + e.Trigger["AmmoPickup"]["RespawnTimer"],e.Trigger["AmmoPickup"]["RespawnTimer"] }); + + //delete the ammopickup + m_World->DeleteEntity(e.Trigger.ID); + return true; +} From f1c2413cf930c7d05601bda62d6bee0deb4072a4 Mon Sep 17 00:00:00 2001 From: William Moberg Date: Fri, 12 Feb 2016 00:39:27 +0100 Subject: [PATCH 20/25] Respawning and team picking seems to be working well. --- src/Game/Systems/DamageIndicatorSystem.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Game/Systems/DamageIndicatorSystem.cpp b/src/Game/Systems/DamageIndicatorSystem.cpp index a29309b5..8d586ac1 100644 --- a/src/Game/Systems/DamageIndicatorSystem.cpp +++ b/src/Game/Systems/DamageIndicatorSystem.cpp @@ -22,6 +22,10 @@ bool DamageIndicatorSystem::OnPlayerDamage(Events::PlayerDamage& e) return false; } + if (!e.Inflictor.Valid() || !e.Victim.Valid()) { + return false; + } + //grab players direction auto playerOrientation = glm::quat((glm::vec3)e.Victim["Transform"]["Orientation"]); From 40ae2b8cbbe5bb72d5ed24578930ad6ef396e5e2 Mon Sep 17 00:00:00 2001 From: William Moberg Date: Fri, 12 Feb 2016 00:52:58 +0100 Subject: [PATCH 21/25] DefaultInput key 'K' to kill player, since we can't respawn when alive. Also moved TakeDamage InputCommand to HealthSystem. --- include/Game/Systems/HealthSystem.h | 5 ++++- resources/DefaultInput.ini | 3 ++- src/Game/Systems/HealthSystem.cpp | 12 ++++++++++++ src/Game/Systems/SoundSystem.cpp | 6 ------ 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/include/Game/Systems/HealthSystem.h b/include/Game/Systems/HealthSystem.h index b66d8eb0..21a52330 100644 --- a/include/Game/Systems/HealthSystem.h +++ b/include/Game/Systems/HealthSystem.h @@ -9,6 +9,7 @@ #include "Core/EPlayerDamage.h" #include "Core/EPlayerHealthPickup.h" #include "Core/EPlayerDeath.h" +#include "../Engine/Input/EInputCommand.h" #include #include @@ -28,7 +29,9 @@ private: bool HealthSystem::OnPlayerDamaged(Events::PlayerDamage& e); EventRelay m_EPlayerHealthPickup; bool HealthSystem::OnPlayerHealthPickup(Events::PlayerHealthPickup& e); - + EventRelay m_InputCommand; + bool HealthSystem::OnInputCommand(Events::InputCommand& e); + //vector which will keep track of health changes std::vector> m_DeltaHealthVector; diff --git a/resources/DefaultInput.ini b/resources/DefaultInput.ini index 683d48e2..d5489c3a 100644 --- a/resources/DefaultInput.ini +++ b/resources/DefaultInput.ini @@ -24,4 +24,5 @@ F1=ToggleEditor C=ConnectToServer N=SwitchToServer M=SwitchToClient -P=SwitchToPlayer \ No newline at end of file +P=SwitchToPlayer +K=TakeDamage,1500 \ No newline at end of file diff --git a/src/Game/Systems/HealthSystem.cpp b/src/Game/Systems/HealthSystem.cpp index 29d8790d..0fc113b9 100644 --- a/src/Game/Systems/HealthSystem.cpp +++ b/src/Game/Systems/HealthSystem.cpp @@ -7,6 +7,7 @@ HealthSystem::HealthSystem(SystemParams params) //subscribe/listenTo playerdamage,healthpickup events (using the eventBroker) EVENT_SUBSCRIBE_MEMBER(m_EPlayerDamage, &HealthSystem::OnPlayerDamaged); EVENT_SUBSCRIBE_MEMBER(m_EPlayerHealthPickup, &HealthSystem::OnPlayerHealthPickup); + EVENT_SUBSCRIBE_MEMBER(m_InputCommand, &HealthSystem::OnInputCommand); } void HealthSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapper& component, double dt) @@ -29,6 +30,17 @@ bool HealthSystem::OnPlayerDamaged(Events::PlayerDamage& e) return true; } +bool HealthSystem::OnInputCommand(Events::InputCommand& e) +{ + if (e.Command == "TakeDamage" && e.Value > 0 && LocalPlayer.Valid()) { + Events::PlayerDamage ev; + ev.Victim = LocalPlayer; + ev.Damage = e.Value; + m_EventBroker->Publish(ev); + } + return true; +} + bool HealthSystem::OnPlayerHealthPickup(Events::PlayerHealthPickup& e) { ComponentWrapper cHealth = e.Player["Health"]; diff --git a/src/Game/Systems/SoundSystem.cpp b/src/Game/Systems/SoundSystem.cpp index db3575ab..59fd4a7f 100644 --- a/src/Game/Systems/SoundSystem.cpp +++ b/src/Game/Systems/SoundSystem.cpp @@ -52,12 +52,6 @@ bool SoundSystem::OnInputCommand(const Events::InputCommand & e) return true; } } - if (e.Command == "TakeDamage" && e.Value > 0 && LocalPlayer.Valid()) { - Events::PlayerDamage ev; - ev.Victim = LocalPlayer; - ev.Damage = e.Value; - m_EventBroker->Publish(ev); - } return false; } From 3e42c067ab02723e16b22203e96c855cd1cdacc6 Mon Sep 17 00:00:00 2001 From: antc13 Date: Fri, 12 Feb 2016 01:43:20 +0100 Subject: [PATCH 22/25] New Map with meshes WIP Update. --- resources/Schema/Entities/NewMap.xml | 3587 ++++++++++++++++++++++---- 1 file changed, 3096 insertions(+), 491 deletions(-) diff --git a/resources/Schema/Entities/NewMap.xml b/resources/Schema/Entities/NewMap.xml index a79fee7b..e0fcf912 100644 --- a/resources/Schema/Entities/NewMap.xml +++ b/resources/Schema/Entities/NewMap.xml @@ -104,6 +104,100 @@ + + + + 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 + + + + + + + @@ -116,8 +210,7 @@ - Models/Props/Pillars/SciFiPillar1.mesh - + Models/Props/Pillars/SciFiPillar1Blue.mesh @@ -130,12 +223,11 @@ - Models/Props/Pillars/SciFiPillar1.mesh - + Models/Props/Pillars/SciFiPillar1Red.mesh - - + + @@ -169,7 +261,7 @@ - Models/Props/Pillars/SciFiPillar2.mesh + Models/Props/Pillars/SciFiPillar2Red.mesh @@ -182,7 +274,7 @@ - Models/Props/Pillars/SciFiPillar3.mesh + Models/Props/Pillars/SciFiPillar3Blue.mesh @@ -196,10 +288,10 @@ - Models/Props/Pillars/SciFiPillar1.mesh + Models/Props/Pillars/SciFiPillar1Blue.mesh - + @@ -210,10 +302,10 @@ - Models/Props/Pillars/SciFiPillar1.mesh + Models/Props/Pillars/SciFiPillar1Red.mesh - + @@ -224,7 +316,7 @@ - Models/Props/Pillars/SciFiPillar3.mesh + Models/Props/Pillars/SciFiPillar3Red.mesh @@ -266,8 +358,8 @@ Models/Props/Pillars/StonePillar.mesh - - + + @@ -292,7 +384,7 @@ Models/Props/Pillars/SciFiPillar2.mesh - + @@ -324,6 +416,141 @@ + + + + + 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 + + + + + + + + @@ -338,7 +565,7 @@ Models/Props/Walls/BigWall.mesh - + @@ -349,6 +576,7 @@ Models/Props/Walls/BigWall.mesh + @@ -363,7 +591,7 @@ Models/Props/Walls/BigWall.mesh - + @@ -388,7 +616,8 @@ Models/Props/Walls/BigWall.mesh - + + @@ -399,6 +628,7 @@ Models/Props/Walls/BigWall.mesh + @@ -413,7 +643,8 @@ Models/Props/Walls/BigWall.mesh - + + @@ -424,7 +655,8 @@ Models/Props/Walls/BigWall.mesh - + + @@ -438,7 +670,7 @@ Models/Props/Walls/BigWall.mesh - + @@ -450,7 +682,7 @@ Models/Props/Walls/BigWall.mesh - + @@ -464,7 +696,7 @@ Models/Props/Walls/BigWall.mesh - + @@ -480,7 +712,7 @@ Models/Props/Walls/BigWall.mesh - + @@ -492,7 +724,7 @@ Models/Props/Walls/BigWall.mesh - + @@ -505,7 +737,7 @@ Models/Props/Walls/BigWall.mesh - + @@ -585,8 +817,8 @@ Models/Props/Walls/SmallWall2.mesh - - + + @@ -710,11 +942,11 @@ - Models/Props/Walls/MediumWall3.mesh + Models/Props/Walls/MediumWall1.mesh - - + + @@ -722,10 +954,10 @@ - Models/Props/Walls/MediumWall3.mesh + Models/Props/Walls/MediumWall1.mesh - + @@ -734,10 +966,10 @@ - Models/Props/Walls/MediumWall3.mesh + Models/Props/Walls/MediumWall1.mesh - + @@ -751,7 +983,7 @@ Models/Props/Walls/BigWall.mesh - + @@ -762,7 +994,7 @@ Models/Props/Walls/BigWall.mesh - + @@ -774,7 +1006,7 @@ Models/Props/Walls/BigWall.mesh - + @@ -801,7 +1033,8 @@ Models/Props/Walls/BigWall.mesh - + + @@ -813,7 +1046,7 @@ Models/Props/Walls/BigWall.mesh - + @@ -827,7 +1060,7 @@ Models/Props/Walls/BigWall.mesh - + @@ -838,7 +1071,7 @@ Models/Props/Walls/BigWall.mesh - + @@ -850,7 +1083,7 @@ Models/Props/Walls/BigWall.mesh - + @@ -876,7 +1109,7 @@ Models/Props/Walls/BigWall.mesh - + @@ -966,7 +1199,8 @@ Models/Props/Walls/BigWall.mesh - + + @@ -977,7 +1211,7 @@ Models/Props/Walls/BigWall.mesh - + @@ -988,6 +1222,7 @@ Models/Props/Walls/BigWall.mesh + @@ -1016,7 +1251,7 @@ Models/Props/Walls/SmallWall2.mesh - + @@ -1027,7 +1262,7 @@ Models/Props/Walls/BigWall.mesh - + @@ -1054,7 +1289,7 @@ Models/Props/Walls/BigWall.mesh - + @@ -1065,7 +1300,7 @@ Models/Props/Walls/BigWall.mesh - + @@ -1077,7 +1312,7 @@ Models/Props/Walls/BigWall.mesh - + @@ -1089,7 +1324,7 @@ Models/Props/Walls/BigWall.mesh - + @@ -1103,7 +1338,7 @@ Models/Props/Walls/BigWall.mesh - + @@ -1115,7 +1350,7 @@ Models/Props/Walls/BigWall.mesh - + @@ -1130,8 +1365,479 @@ Models/Props/Walls/MediumWall3.mesh - - + + + + + + + + + + + Models/Props/Walls/BigWall.mesh + + + + + + + + + + + Models/Props/Walls/BigWall.mesh + + + + + + + + + + + + Models/Props/Walls/BigWall.mesh + + + + + + + + + + + + + + Models/Props/Walls/BigWall.mesh + + + + + + + + + + + + Models/Props/Walls/BigWall.mesh + + + + + + + + + + + + + + Models/Props/Walls/BigWall.mesh + + + + + + + + + + + + Models/Props/Walls/BigWall.mesh + + + + + + + + + + + + Models/Props/Walls/SmallWall2.mesh + + + + + + + + + + + + Models/Props/Walls/BigWall.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 + + + + + @@ -1150,9 +1856,9 @@ Models/Props/Bridges/WoodenBridge.mesh - + - + @@ -1164,9 +1870,9 @@ Models/Props/Bridges/WoodenBridge.mesh - - - + + + @@ -1178,8 +1884,8 @@ Models/Props/Bridges/WoodenBridge.mesh - - + + @@ -1191,12 +1897,117 @@ Models/Props/Bridges/SciFiBridge.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 + + + + + + + + + + + + + + @@ -1205,23 +2016,209 @@ Models/Props/Bridges/SciFiBridge.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/Flora/TreeLog.mesh + Models/Props/Bridges/SciFiBridge.mesh - - - + + + + + + + + + + + Models/Props/Bridges/SciFiBridge.mesh + + + + + + + + + + + + + Models/Props/Pillars/SciFiBridgePillar1.mesh + + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridge.mesh + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridge.mesh + + + + + + + + + + + + + Models/Props/Bridges/WoodenBridge.mesh + + + + + @@ -1240,9 +2237,9 @@ Models/Props/Pillars/SciFiBridgePillar1.mesh - + - + @@ -1254,7 +2251,7 @@ Models/Props/Pillars/SciFiBridgePillar1.mesh - + @@ -1319,8 +2316,7 @@ Models/Props/Pillars/SciFiBridgePillar1.mesh - - + @@ -1347,8 +2343,8 @@ Models/Props/Walls/MediumWall1.mesh - - + + @@ -1431,6 +2427,93 @@ + + + + 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 + + + + + + + + + @@ -1445,59 +2528,11 @@ 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 - - - - - - - - + @@ -1506,7 +2541,7 @@ true - + @@ -1517,7 +2552,7 @@ true - + @@ -1529,7 +2564,7 @@ true - + @@ -1541,7 +2576,7 @@ true - + @@ -1553,7 +2588,7 @@ true - + @@ -1565,7 +2600,7 @@ true - + @@ -1605,13 +2640,444 @@ 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 + + + + + + + + @@ -1636,28 +3102,15 @@ - Models/Props/Stones/BigStone.mesh + Models/Props/Stones/MediumStone2.mesh - - + + + - - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - - + @@ -1672,161 +3125,6 @@ - - - - - Models/Props/Stones/MediumStone1.mesh - - - - - - - - - - - - Models/Props/Stones/MediumStone1.mesh - - - - - - - - - - - - - Models/Props/Stones/MediumStone1.mesh - - - - - - - - - - - - - Models/Props/Stones/MediumStone1.mesh - - - - - - - - - - - - - Models/Props/Stones/MediumStone1.mesh - - - - - - - - - - - - - Models/Props/Stones/MediumStone1.mesh - - - - - - - - - - - - - Models/Props/Stones/MediumStone1.mesh - - - - - - - - - - - - Models/Props/Stones/MediumStone1.mesh - - - - - - - - - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - - - - - - Models/Props/Stones/MediumStone1.mesh - - - - - - - - - - - - Models/Props/Stones/MediumStone1.mesh - - - - - - - - - - - - - Models/Props/Stones/MediumStone1.mesh - - - - - - - - - - @@ -1834,8 +3132,9 @@ Models/Props/Stones/BigStone.mesh - - + + + @@ -1888,8 +3187,8 @@ Models/Props/Stones/BigStone.mesh - - + + @@ -1901,8 +3200,9 @@ Models/Props/Stones/MediumStone1.mesh - - + + + @@ -1911,11 +3211,12 @@ - Models/Props/Stones/MediumStone1.mesh + Models/Props/Stones/SmallStone1.mesh - - + + + @@ -1967,91 +3268,12 @@ Models/Props/Stones/MediumStone1.mesh - - + + + - - - - - - Models/Props/Stones/MediumStone1.mesh - - - - - - - - - - - - - - - Models/Props/Stones/MediumStone1.mesh - - - - - - - - - - - - Models/Props/Stones/MediumStone1.mesh - - - - - - - - - - - - - Models/Props/Stones/MediumStone1.mesh - - - - - - - - - - - - - Models/Props/Stones/MediumStone1.mesh - - - - - - - - - - - - Models/Props/Stones/MediumStone1.mesh - - - - - - - - - - + @@ -2060,7 +3282,7 @@ Models/Props/Stones/BigStone.mesh - + @@ -2072,8 +3294,8 @@ Models/Props/Stones/BigStone.mesh - - + + @@ -2085,14 +3307,683 @@ 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/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 + + + + + + + + + @@ -2107,9 +3998,9 @@ Models/Props/PickUps/PickUpHolder.mesh - - - + + + @@ -2121,9 +4012,9 @@ Models/Props/PickUps/PickUpHolder.mesh - - - + + + @@ -2136,7 +4027,7 @@ - + @@ -2149,8 +4040,58 @@ Models/Props/PickUps/PickUpHolder.mesh - - + + + + + + + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + Models/Props/PickUps/HealthPickUp.mesh + + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + @@ -2162,9 +4103,9 @@ Models/Props/PickUps/PickUpHolder.mesh - - - + + + @@ -2176,8 +4117,547 @@ 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 + + + + + @@ -2193,107 +4673,177 @@ - - - - - - - - + - Models/Props/CapturePoint.mesh - + Models/Props/CapturePoint/CapturePointBlue.mesh - - - - - - + - - + + + + + + + + + + Models/Core/UnitCylinder.mesh + + true + + + + + + + + + + + + + + + - - - 1 - + - Models/Props/CapturePoint.mesh - + Models/Props/CapturePoint/CapturePointNeutral.mesh - - + - - + + + + + 1 + + + Models/Core/UnitCylinder.mesh + + true + + + + + + + + + + + - - - 2 - + - Models/Props/CapturePoint.mesh + Models/Props/CapturePoint/CapturePointNeutral.mesh - - + - - + + + + + 2 + + + Models/Core/UnitCylinder.mesh + + true + + + + + + + + + + + - - - 3 - + - Models/Props/CapturePoint.mesh - + Models/Props/CapturePoint/CapturePointNeutral.mesh - - + - - + + + + + 1.5498908015879351 + 3 + + + Models/Core/UnitCylinder.mesh + + true + + + + + + + + + + + - - - - - - 4 - + - Models/Props/CapturePoint.mesh - + Models/Props/CapturePoint/CapturePointRed.mesh - - - - - - + - - + + + + + + + + 4 + + + Models/Core/UnitCylinder.mesh + + true + + + + + + + + + + + + + + + @@ -2373,23 +4923,78 @@ 1 - + - + - - Models/Characters/Assault/AssaultTPose.mesh - + + + Schema/Entities/Player.xml + + + + + + - + - + + + + + + Models/Characters/Assault/AssaultTPose.mesh + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + + + + + + + + From 241717591430c5c871ac29f2c6876bd6b380eec3 Mon Sep 17 00:00:00 2001 From: antc13 Date: Fri, 12 Feb 2016 02:06:52 +0100 Subject: [PATCH 23/25] New Map with Meshes WIP. Probably final for Playtest. --- assets | 2 +- resources/Schema/Entities/NewMap.xml | 99 +++++++++++++--------------- 2 files changed, 46 insertions(+), 55 deletions(-) diff --git a/assets b/assets index 4d36fdce..078e014f 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 4d36fdced7007a594a56b7371bb26861876889aa +Subproject commit 078e014f3d24a100c4cb544ac6807aa2b54149b2 diff --git a/resources/Schema/Entities/NewMap.xml b/resources/Schema/Entities/NewMap.xml index e0fcf912..d67540da 100644 --- a/resources/Schema/Entities/NewMap.xml +++ b/resources/Schema/Entities/NewMap.xml @@ -562,7 +562,7 @@ - Models/Props/Walls/BigWall.mesh + Models/Props/Walls/BigWallBlue.mesh @@ -573,7 +573,7 @@ - Models/Props/Walls/BigWall.mesh + Models/Props/Walls/BigWallBlue.mesh @@ -588,7 +588,7 @@ - Models/Props/Walls/BigWall.mesh + Models/Props/Walls/BigWallBlue.mesh @@ -599,7 +599,7 @@ - Models/Props/Walls/BigWall.mesh + Models/Props/Walls/BigWallBlue.mesh @@ -613,7 +613,7 @@ - Models/Props/Walls/BigWall.mesh + Models/Props/Walls/BigWallRed.mesh @@ -625,7 +625,7 @@ - Models/Props/Walls/BigWall.mesh + Models/Props/Walls/BigWallRed.mesh @@ -640,7 +640,7 @@ - Models/Props/Walls/BigWall.mesh + Models/Props/Walls/BigWallRed.mesh @@ -652,7 +652,7 @@ - Models/Props/Walls/BigWall.mesh + Models/Props/Walls/BigWallRed.mesh @@ -667,7 +667,7 @@ - Models/Props/Walls/BigWall.mesh + Models/Props/Walls/BigWallRed.mesh @@ -679,7 +679,7 @@ - Models/Props/Walls/BigWall.mesh + Models/Props/Walls/BigWallRed.mesh @@ -693,7 +693,7 @@ - Models/Props/Walls/BigWall.mesh + Models/Props/Walls/BigWallRed.mesh @@ -709,7 +709,7 @@ - Models/Props/Walls/BigWall.mesh + Models/Props/Walls/BigWallBlue.mesh @@ -721,7 +721,7 @@ - Models/Props/Walls/BigWall.mesh + Models/Props/Walls/BigWallBlue.mesh @@ -734,7 +734,7 @@ - Models/Props/Walls/BigWall.mesh + Models/Props/Walls/BigWallBlue.mesh @@ -980,7 +980,7 @@ - Models/Props/Walls/BigWall.mesh + Models/Props/Walls/BigWallRed.mesh @@ -991,7 +991,7 @@ - Models/Props/Walls/BigWall.mesh + Models/Props/Walls/BigWallRed.mesh @@ -1003,7 +1003,7 @@ - Models/Props/Walls/BigWall.mesh + Models/Props/Walls/BigWallRed.mesh @@ -1014,7 +1014,7 @@ - Models/Props/Walls/BigWall.mesh + Models/Props/Walls/BigWallRed.mesh @@ -1030,7 +1030,7 @@ - Models/Props/Walls/BigWall.mesh + Models/Props/Walls/BigWallRed.mesh @@ -1043,7 +1043,7 @@ - Models/Props/Walls/BigWall.mesh + Models/Props/Walls/BigWallRed.mesh @@ -1057,7 +1057,7 @@ - Models/Props/Walls/BigWall.mesh + Models/Props/Walls/BigWallBlue.mesh @@ -1068,7 +1068,7 @@ - Models/Props/Walls/BigWall.mesh + Models/Props/Walls/BigWallBlue.mesh @@ -1080,7 +1080,7 @@ - Models/Props/Walls/BigWall.mesh + Models/Props/Walls/BigWallBlue.mesh @@ -1092,7 +1092,7 @@ - Models/Props/Walls/BigWall.mesh + Models/Props/Walls/BigWallBlue.mesh @@ -1106,7 +1106,7 @@ - Models/Props/Walls/BigWall.mesh + Models/Props/Walls/BigWallBlue.mesh @@ -1196,7 +1196,7 @@ - Models/Props/Walls/BigWall.mesh + Models/Props/Walls/BigWallBlue.mesh @@ -1208,7 +1208,7 @@ - Models/Props/Walls/BigWall.mesh + Models/Props/Walls/BigWallBlue.mesh @@ -1219,7 +1219,7 @@ - Models/Props/Walls/BigWall.mesh + Models/Props/Walls/BigWallBlue.mesh @@ -1259,7 +1259,7 @@ - Models/Props/Walls/BigWall.mesh + Models/Props/Walls/BigWallBlue.mesh @@ -1270,7 +1270,7 @@ - Models/Props/Walls/BigWall.mesh + Models/Props/Walls/BigWallBlue.mesh @@ -1286,7 +1286,7 @@ - Models/Props/Walls/BigWall.mesh + Models/Props/Walls/BigWallBlue.mesh @@ -1297,7 +1297,7 @@ - Models/Props/Walls/BigWall.mesh + Models/Props/Walls/BigWallBlue.mesh @@ -1309,7 +1309,7 @@ - Models/Props/Walls/BigWall.mesh + Models/Props/Walls/BigWallBlue.mesh @@ -1321,7 +1321,7 @@ - Models/Props/Walls/BigWall.mesh + Models/Props/Walls/BigWallBlue.mesh @@ -1335,7 +1335,7 @@ - Models/Props/Walls/BigWall.mesh + Models/Props/Walls/BigWallBlue.mesh @@ -1347,7 +1347,7 @@ - Models/Props/Walls/BigWall.mesh + Models/Props/Walls/BigWallBlue.mesh @@ -1375,7 +1375,7 @@ - Models/Props/Walls/BigWall.mesh + Models/Props/Walls/BigWallRed.mesh @@ -1386,7 +1386,7 @@ - Models/Props/Walls/BigWall.mesh + Models/Props/Walls/BigWallRed.mesh @@ -1398,7 +1398,7 @@ - Models/Props/Walls/BigWall.mesh + Models/Props/Walls/BigWallRed.mesh @@ -1412,7 +1412,7 @@ - Models/Props/Walls/BigWall.mesh + Models/Props/Walls/BigWallRed.mesh @@ -1424,7 +1424,7 @@ - Models/Props/Walls/BigWall.mesh + Models/Props/Walls/BigWallRed.mesh @@ -1438,7 +1438,7 @@ - Models/Props/Walls/BigWall.mesh + Models/Props/Walls/BigWallRed.mesh @@ -1450,7 +1450,7 @@ - Models/Props/Walls/BigWall.mesh + Models/Props/Walls/BigWallRed.mesh @@ -1474,7 +1474,7 @@ - Models/Props/Walls/BigWall.mesh + Models/Props/Walls/BigWallRed.mesh @@ -1611,16 +1611,7 @@ - - - - - - - - - - + From e1196204eb381673f06dd22c38ef58573ccf2cd1 Mon Sep 17 00:00:00 2001 From: Tleety Date: Fri, 12 Feb 2016 02:20:40 +0100 Subject: [PATCH 24/25] asdfsdaferf --- src/Engine/Rendering/PickingPass.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Engine/Rendering/PickingPass.cpp b/src/Engine/Rendering/PickingPass.cpp index fa1b3ca3..33649b3a 100644 --- a/src/Engine/Rendering/PickingPass.cpp +++ b/src/Engine/Rendering/PickingPass.cpp @@ -125,7 +125,7 @@ void PickingPass::Draw(RenderScene& scene) } } - for (auto &job : scene.Jobs.TransparentObjects) { + /* for (auto &job : scene.Jobs.TransparentObjects) { auto modelJob = std::dynamic_pointer_cast(job); int pickColor[2] = { m_ColorCounter[0], m_ColorCounter[1] }; @@ -178,7 +178,7 @@ void PickingPass::Draw(RenderScene& scene) glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, modelJob->Model->ElementBuffer); glDrawElements(GL_TRIANGLES, modelJob->EndIndex - modelJob->StartIndex + 1, GL_UNSIGNED_INT, (void*)(modelJob->StartIndex * sizeof(unsigned int))); } - } + }*/ for (auto &job : scene.Jobs.OpaqueShieldedObjects) { auto modelJob = std::dynamic_pointer_cast(job); @@ -236,7 +236,7 @@ void PickingPass::Draw(RenderScene& scene) } } - for (auto &job : scene.Jobs.TransparentShieldedObjects) { + /* for (auto &job : scene.Jobs.TransparentShieldedObjects) { auto modelJob = std::dynamic_pointer_cast(job); if (modelJob) { @@ -300,7 +300,7 @@ void PickingPass::Draw(RenderScene& scene) glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, modelJob->Model->ElementBuffer); glDrawElements(GL_TRIANGLES, modelJob->EndIndex - modelJob->StartIndex + 1, GL_UNSIGNED_INT, (void*)(modelJob->StartIndex * sizeof(unsigned int))); } - } + }*/ m_PickingBuffer.Unbind(); GLERROR("PickingPass Error"); From 4f7a17ff620d44b9893505d440c182a55f7bfb29 Mon Sep 17 00:00:00 2001 From: Tleety Date: Fri, 12 Feb 2016 02:38:36 +0100 Subject: [PATCH 25/25] ColorFix --- src/Game/Systems/CapturePointHUDSystem.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Game/Systems/CapturePointHUDSystem.cpp b/src/Game/Systems/CapturePointHUDSystem.cpp index 21737fbe..3ca4601d 100644 --- a/src/Game/Systems/CapturePointHUDSystem.cpp +++ b/src/Game/Systems/CapturePointHUDSystem.cpp @@ -39,14 +39,14 @@ void CapturePointHUDSystem::Update(double dt) } //Color hud with team color auto capturePointTeam = (int)teamComponent["Team"]; - entityHUDparent["Sprite"]["Color"] = capturePointTeam == blueTeam ? glm::vec4(0, 0.2f, 1, 0.7) : capturePointTeam == redTeam ? glm::vec4(1, 0.2f, 0, 0.7) : glm::vec4(1, 1, 1, 0.3); + 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.2f, 0, 0.7) : glm::vec4(0, 0.2f, 1, 0.7); + 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; }