Compare commits

...

291 Commits

Author SHA1 Message Date
verysecrethero a20ef0504a Revert "Merge remote-tracking branch 'origin/master' into SniperSprint"
This reverts commit 62653cf65d, reversing
changes made to b81bb9eeea.
2016-03-02 16:58:24 +01:00
verysecrethero 4e68f9063b Revert "Merge remote-tracking branch 'origin/master' into SniperSprint"
This reverts commit dbef995627, reversing
changes made to 62653cf65d.
2016-03-02 16:55:56 +01:00
verysecrethero dbef995627 Merge remote-tracking branch 'origin/master' into SniperSprint 2016-03-02 16:50:09 +01:00
Joachim Pettersson f8f4b4d939 Merge pull request #151 from teamfisk/CPArrow
CapturePoint indicator HUD
2016-03-02 16:48:52 +01:00
verysecrethero 62653cf65d Merge remote-tracking branch 'origin/master' into SniperSprint
# Conflicts:
#	include/Engine/Input/FirstPersonInputController.h
#	src/Game/Game.cpp
2016-03-02 16:47:43 +01:00
Tleety 78835f95d8 Removed comment 2016-03-02 16:47:30 +01:00
Tobias Dahl 8a66b1e5c8 Merge pull request #119 from teamfisk/AssaultBoost
BoostSystem
2016-03-02 16:44:49 +01:00
verysecrethero 3c8df35be9 Merge remote-tracking branch 'origin/master' into AssaultBoost
# Conflicts:
#	src/Game/Game.cpp
2016-03-02 15:59:16 +01:00
Joachim Pettersson f761416e20 Merge pull request #152 from teamfisk/PickupBranch
Added the already-at-maxammo/health-savetrigger for the PickupSystems
2016-03-02 15:41:44 +01:00
Jocke 9161c11764 Changed m_ETriggerTouchVector for-loop so it wont break when an item triggers the condition. This is done to update all somePickup.DecreaseThisRespawnTimer's. 2016-03-02 15:31:42 +01:00
Tleety a2b938d8f6 Merge branch 'master' into CPArrow
# Conflicts:
#	resources/Schema/Entities/Player.xml
#	resources/Schema/Entities/PlayerRed.xml
2016-03-02 13:58:44 +01:00
Tleety ab7fd89546 Should now correctly track if another player takes your last capture point 2016-03-02 13:56:35 +01:00
Tleety 6968e71e07 Arrow should now correctly track the next point no matter when you join the game 2016-03-02 13:36:24 +01:00
Tobias Dahl 2fb3bb2a39 Merge pull request #153 from teamfisk/RenderSetingsV2
Shield and stuff
2016-03-02 13:15:52 +01:00
Tleety 6540848392 WIP 2016-03-02 11:59:56 +01:00
Teejoon de9657700b Fixed draw final pass with shided objects having to many if-statments.
Shields is working with transparancy

Player cameras should have nearclip fater away and far clip nearer.

Defaultconfig push
2016-03-02 11:59:48 +01:00
verysecrethero 4652cd7861 Added the already-at-maxammo/health-save-trigger for the PickupSystems 2016-03-02 11:53:04 +01:00
verysecrethero 03a35d0f5e Merge pull request #149 from teamfisk/FixNetworkBugs
Seems OK
2016-03-02 10:11:52 +01:00
Tobias Dahl e4e9af5d9c Merge pull request #148 from teamfisk/DashFixBranch
Moved the Dash CoolDown (CoolDownTimer) to the component (DashAbility…
2016-03-02 10:05:02 +01:00
Tleety 96768e66de Redplayer arrow fix 2016-03-02 09:57:41 +01:00
Teejoon ef66f3ebe5 Transparancy with shild fix 2016-03-01 23:14:23 +01:00
Tleety 799990f44d Next CP indicator should now be fully working. 2016-03-01 22:54:13 +01:00
Jace 39369aa3e5 Merge pull request #150 from teamfisk/EditorCameraSpeedFix
Fixed editor camera speed changing when scrolling on UI elements
2016-03-01 22:51:16 +01:00
Jace 6eb0b83d6b Fixed editor camera speed changing when scrolling on UI elements 2016-03-01 22:47:43 +01:00
Tleety ab40fa715b The arrow should now track CapturePoints correctly at start and when they are captured. 2016-03-01 21:57:30 +01:00
Tleety a38c18fd3a Merge remote-tracking branch 'origin/master' into CPArrow 2016-03-01 20:33:30 +01:00
Tobias Dahl 9747a201b7 Merge pull request #147 from teamfisk/CapturePointFixBranch
ECaptured: added NextCapturePoint entitywrapper. Changed CapturePoint…
2016-03-01 20:33:10 +01:00
Tleety 6281e20000 Arrow should now track the CapturePoint specified in the Component. 2016-03-01 20:31:09 +01:00
verysecrethero f147929aa9 Moved the Dash CoolDown (CoolDownTimer) to the component (DashAbility). Fixed 2 warnings 2016-03-01 17:57:18 +01:00
Jocke aadfdfdd90 AmmoPickups and HealthPickups will only spawn on the server. When a ammo pickup is taken the Server will send an Event to that
Client and it will update its ammo.
2016-03-01 17:55:00 +01:00
verysecrethero bba002dea9 Removed DebugCode 2016-03-01 17:37:30 +01:00
verysecrethero 15195964da ECaptured: added NextCapturePoint entitywrapper. Changed CapturePointID to CapturePointTakenID. Fixed so CapturePoints works in singleplayer again. Captured event is now sent in the next Update, since the information for NextCapturePoint is needed 2016-03-01 17:34:30 +01:00
Tleety b0a66f9e83 Components for CapturePoint arrow HUD element and a system skeleton 2016-03-01 16:19:59 +01:00
Tleety 7ba5e01560 CapturePointArrow component files 2016-03-01 15:37:28 +01:00
Jocke 6d68486c05 Merge remote-tracking branch 'origin/master' into FixNetworkBugs 2016-03-01 15:07:06 +01:00
Jace c60e1ba7e4 Merge pull request #144 from teamfisk/RenderSetingsV2
Render settings
2016-03-01 13:49:38 +01:00
Tobias Dahl 63d205f56a Merge pull request #146 from teamfisk/EditorKeyboardFix
Fixed editor keyboard shortcuts getting mixed up with GUI input actions
2016-03-01 13:46:01 +01:00
Jace 36f6ade87a Fixed editor keyboard shortcuts getting mixed up with GUI input actions 2016-03-01 13:38:51 +01:00
Teejoon 724d7b1586 Merge remote-tracking branch 'origin/master' into RenderSetingsV2
Conflicts:
	src/Engine/Rendering/DrawFinalPass.cpp
2016-03-01 12:56:00 +01:00
Teejoon 8cda614de4 Added transparent object that disappeared from the merge 2016-03-01 12:54:01 +01:00
Teejoon 77eaa45702 Merge remote-tracking branch 'origin/master' into HEAD
Conflicts:
	src/Engine/Rendering/CubeMapPass.cpp
	src/Engine/Rendering/DrawFinalPass.cpp
2016-03-01 12:11:27 +01:00
Tobias Dahl dfa224b4dd Merge pull request #142 from teamfisk/Respawning
Added CapturePointGameMode component with RespawnTime
2016-03-01 11:28:56 +01:00
Jace 86df8f14f4 Merge pull request #143 from teamfisk/Transparency-fix
Transparency fix
2016-03-01 11:26:26 +01:00
Tleety eaea645068 Reflectance should now work as an inverse of the specular alpha value. 2016-03-01 11:19:44 +01:00
Tleety 21bf7f4df3 Glow should now legit be working through transparency. 2016-03-01 11:03:16 +01:00
William Moberg e2b7e5400d Check so CapturePointGameMode pool exists and has a size. 2016-03-01 10:20:52 +01:00
William Moberg 658eace093 Added component CapturePointGameMode that contains respawntime. 2016-02-29 18:20:14 +01:00
Joachim Pettersson c106768939 Merge pull request #135 from teamfisk/JumpHeightAdjustment
Player jump speed can be adjusted
2016-02-29 17:37:25 +01:00
William Moberg c7dad79e72 Merge branch 'master' into JumpHeightAdjustment
# Conflicts:
#	resources/Schema/Components.xsd
#	resources/Schema/Entities/Player.xml
#	resources/Schema/Entities/PlayerRed.xml
#	src/Game/Systems/PlayerMovementSystem.cpp
2016-02-29 17:28:40 +01:00
Joachim Pettersson d37f8cc350 Merge pull request #141 from teamfisk/BoxModelCollision
Collision jittering + disappearing weapon
2016-02-29 17:13:34 +01:00
William Moberg 3c35c0a956 Frustum culling octree updates after collisions, no more disappearing weapons. 2016-02-29 15:50:26 +01:00
William Moberg d47a806c64 Made a easy hack to solve jittering when standing still. Jittering should still be present when moving, but at least it is less prominent when moving. 2016-02-29 15:49:23 +01:00
William Moberg 8e21c5a5e4 Reverts last WIP since it probably added code without improving anything.
Revert "WIP, should take shortest resolution even if forced upwards because of slopes, not solving the jittering problem though. + debug code."

This reverts commit db5170c699.
2016-02-29 15:38:36 +01:00
Teejoon df7ace6626 We only uses one depth buffer now 2016-02-29 11:44:29 +01:00
Jocke bef79d116b Merge remote-tracking branch 'origin/master' into FixNetworkBugs 2016-02-29 10:15:16 +01:00
William Moberg db5170c699 WIP, should take shortest resolution even if forced upwards because of slopes, not solving the jittering problem though. + debug code. 2016-02-29 09:37:51 +01:00
Jace bb76c9d248 WIP multi-weapon behaviours 2016-02-29 06:58:57 +01:00
Teejoon 9cbc6f7755 Added GenerateTexture, GenerateMipMapTexture and DeleteTexture to CommonFunctions 2016-02-28 16:16:22 +01:00
Teejoon d3a245606a SSAO and Glow is no longe conflicting with each other.
Texture should get the id = 0 when they are deleted and not assigned a new texture after. Else they will start to conflict with each other.
2016-02-28 15:02:40 +01:00
Teejoon b320d8d1e4 WIP 2016-02-26 18:01:38 +01:00
Jocke afddd276a4 Merge remote-tracking branch 'origin/master' into FixNetworkBugs 2016-02-26 16:54:09 +01:00
Jocke a48e1b567a Removed comments 2016-02-26 16:49:25 +01:00
Teejoon 62e22d3821 Fix 2016-02-26 13:32:16 +01:00
Teejoon 0805375483 Deleted SSAO sliders except Quality 2016-02-26 13:25:19 +01:00
Jace 0c60b637c3 Who's merging without compiling? 2016-02-26 12:52:10 +01:00
William Moberg d411de894f Merge pull request #140 from teamfisk/FixNetworkBugs
Death explosion should always get triggered now.
2016-02-26 12:01:19 +01:00
Teejoon f56705d921 You can now change the quality of SSAO by sliding the SSAO Quality 2016-02-26 11:51:20 +01:00
Jocke 18450ff4f3 Death explosion should always get triggered now. (I hope) 2016-02-26 11:08:05 +01:00
William Moberg 22b473a0b6 Merge pull request #139 from teamfisk/EditorCopyPaste
Editor copy paste
2016-02-26 11:01:18 +01:00
Jace f161fce719 Merge pull request #138 from teamfisk/PlayerAtOriginFix
Teleporting to origin on spawn fixed.
2016-02-25 17:55:03 +01:00
Jace 0343683678 Fixed cubemaps being generated over and over again each frame. 2016-02-25 17:51:40 +01:00
Jace 9e6c67596d Basic editor copy and paste. Doesn't actually copy the entity until you paste it. 2016-02-25 17:51:28 +01:00
William Moberg 89d0d5753f Fix for player teleporting to (0,0,0). Saves player previous position in CollisionSystem instead of Physics component so it won't be saved when editing Players. 2016-02-25 16:16:24 +01:00
Adam Byléhn 748a178801 Merge pull request #136 from teamfisk/FixNetworkBugs
Fix network bugs
2016-02-25 16:09:08 +01:00
Jocke eac9a9daf6 Pull request #136 Merge remote-tracking branch 'origin/master' into FixNetworkBugs
# Conflicts:
#	src/Engine/Network/Client.cpp
2016-02-25 16:07:06 +01:00
Jocke 059fe5c6c0 Fixed typo m_EPDoubleJump to m_EDoubleJump. 2016-02-25 16:04:27 +01:00
Joachim Pettersson fb465ede81 Merge pull request #134 from teamfisk/HUDDesync
Good job! 👍
2016-02-25 15:53:07 +01:00
Jocke f66fa7a183 Merge remote-tracking branch 'origin/master' into FixNetworkBugs
# Conflicts:
#	include/Engine/Network/Client.h
#	include/Engine/Network/MessageType.h
#	include/Engine/Network/Server.h
#	include/Engine/Network/TCPServer.h
#	src/Engine/Network/Client.cpp
#	src/Engine/Network/TCPServer.cpp
2016-02-25 15:13:11 +01:00
Jocke 508d8a6f00 Fixed memory leak in TCPServer::AcceptNewConnections caused by acceptor->async_accept().
Fixed some formating and comments.
2016-02-25 14:24:38 +01:00
William Moberg cd315bbaa0 Added DoubleJump component and JumpSpeed in Player component so jumpheight can be adjusted for regular jump and double jump. 2016-02-25 12:12:44 +01:00
stiffly 8ce6308649 In snapshot: now sends player information and also CP information. Now it is no longer true that they will arrive in pre order. Appropriate actions were therefor implemented. 2016-02-25 11:56:40 +01:00
stiffly f10958c268 Capturepoint logic is now purely done on the serverside. 2016-02-25 11:50:29 +01:00
William Moberg da1c7b3093 Merge pull request #133 from teamfisk/AndersTest
Ammo,HealthPickup now takes in account for possible parenting/childin…
2016-02-25 09:58:14 +01:00
verysecrethero ef87102d1f Ammo,HealthPickup now takes in account for possible parenting/childing of the pickup. Also saved the xml files with the new scaling 2016-02-24 17:53:37 +01:00
Jace 9a41bda4cf Merge pull request #132 from teamfisk/CubeMap
Cube map
2016-02-24 16:03:49 +01:00
Tleety fc18932068 Merge remote-tracking branch 'origin/master' into CubeMap
# Conflicts:
#	src/Engine/Rendering/Renderer.cpp
2016-02-24 15:45:30 +01:00
Tobias Dahl b874ea8641 Merge pull request #131 from teamfisk/ResizeWindowFixFromSSAOMerge
Have fix the resizing errors
2016-02-24 15:22:12 +01:00
Tobias Dahl 2609a0253d Merge pull request #129 from teamfisk/HUDDesync
Networking improvements
2016-02-24 15:22:01 +01:00
William Moberg de309d3b9d Merge pull request #130 from teamfisk/AndersTest
CapturePointSystem fix, DamageIndicatorSystem fix
2016-02-24 15:17:36 +01:00
Tobias Dahl f7ef6707a7 Merge pull request #116 from teamfisk/SeeTeamMates
See team mates
2016-02-24 15:05:19 +01:00
Tleety feeff5b164 Debug tool for different CubeMap
changed cubemap influence.
2016-02-24 14:47:47 +01:00
stiffly 7394436e7a Removed unnecessary comment. 2016-02-24 14:23:54 +01:00
Tleety f41e0b29be assets 2016-02-24 14:21:48 +01:00
Tleety 607e83134d Cubemaps working 2016-02-24 14:16:49 +01:00
verysecrethero 5af4f9d8e7 Removed a comment originating from HUDDesynch branch 2016-02-24 14:06:41 +01:00
verysecrethero af68236e71 now using a define INDICATOR_TEST to activate the DamageIndicatorSystem test. 2016-02-24 13:58:05 +01:00
Tleety 6f9ce8a0c1 WIP 2016-02-24 13:57:54 +01:00
Teejoon 6465fe6ed6 Have fix the resizing errors 2016-02-24 13:22:41 +01:00
Jocke fa13c1d065 Double jump is now working. 2016-02-23 18:24:46 +01:00
verysecrethero e2831c5593 CapturePointSystem fix, DamageIndicatorSystem fix 2016-02-23 17:29:33 +01:00
Tleety 8d23c531af Cubemaps kinda functioning, still somthing wierd with the vectors. 2016-02-23 17:17:50 +01:00
Tleety 91b0ac5fbd Some groundwork for cubemaps. 2016-02-23 16:00:43 +01:00
stiffly d77119bb2d Fixed print for serverlist. 2016-02-23 11:47:44 +01:00
stiffly 27669b7383 Merge remote-tracking branch 'origin/master' into HUDDesync 2016-02-23 11:09:44 +01:00
stiffly fc7d62a5ad Various clean ups. 2016-02-23 11:07:56 +01:00
stiffly c42e1e0967 SoundSystem Fix. Now subscribes to an event that was thought to be listened to. 2016-02-23 11:07:41 +01:00
stiffly fe9dbf0b0f Serverlist fix. 2016-02-23 10:33:20 +01:00
Tleety 4ffb03fdd5 Merge remote-tracking branch 'origin/master' into SmallFixes-Tobias
# Conflicts:
#	src/Engine/Rendering/DrawFinalPass.cpp
2016-02-23 10:02:53 +01:00
Teejoon fe3e0bac5b Changed SpritIndicator values on player 2016-02-22 18:45:02 +01:00
Teejoon fa4f007604 Changed name from Indicator to SpriteIndicator. Can now be an indicator for a single team or every one 2016-02-22 18:35:00 +01:00
stiffly e5ff88d3c9 SoundSystem bug fix 2016-02-22 17:41:14 +01:00
stiffly 845a30ed0f Merge remote-tracking branch 'origin/DynamicPacketBuffer' into HUDDesync
# Conflicts:
#	include/Engine/Network/TCPServer.h
#	src/Engine/Network/TCPServer.cpp
2016-02-22 17:39:48 +01:00
Jocke 34a71b0767 Fixed linking issue. 2016-02-22 17:24:35 +01:00
stiffly 833006744a WIP 2016-02-22 17:00:25 +01:00
Jocke b2d8cddfb7 WE now send the map on connect after that only player information. 2016-02-22 16:46:31 +01:00
Teejoon 6fab971734 Merge branch 'master' of https://github.com/teamfisk/TacticalZ into SeeTeamMates
Conflicts:
	include/Engine/Rendering/SpriteJob.h
	resources/Schema/Components.xsd
	resources/Schema/Entities/Player.xml
	resources/Schema/Entities/PlayerRed.xml
2016-02-22 16:43:18 +01:00
Viktor Ljung 2c18068059 Merge pull request #126 from teamfisk/SSAO
SSAO
2016-02-22 16:40:11 +01:00
Teejoon 09aec08d0e Pull request fixes 2016-02-22 16:38:20 +01:00
Jocke ed9149fe63 Network buffer should now dynamically increase when needed. 2016-02-22 16:04:27 +01:00
Teejoon 4cf8c3d8d7 Fixed PerformanceTimer start and stop in Renderer.cpp since I have changed a little code there 2016-02-22 15:02:20 +01:00
Teejoon 37414ce124 Merge branch 'master' of https://github.com/teamfisk/TacticalZ into SSAO
Conflicts:
	include/Engine/Rendering/Renderer.h
	src/Engine/Rendering/Renderer.cpp
2016-02-22 14:51:42 +01:00
Teejoon adceccf402 SSAO now working. Changed in DrawFinalePass so that th AOTexture is on texture position 0 and only get binded once.
Changed so that the picking pass get drawn once in the beginning so that the AO shatde could calculate AO from the depthbuffer generated during pthe pickingpass.

In the ImGUI debugg window there is now sliders to change the behavior of the AO shader. Only the minimum ambient lightning is HardCoded in to the frowardPlus fragmentshaders with a define in the begining.
2016-02-22 14:48:20 +01:00
stiffly 4c1a284636 Server now does Capture point logic too. 2016-02-22 11:30:31 +01:00
stiffly 23dc8e07b2 Will this do the trick? Now tells the server to send HUD entities too. 2016-02-22 10:41:37 +01:00
stiffly c7d31cac2d Merge remote-tracking branch 'origin/master' into FriendlyHost/Join
# Conflicts:
#	src/Engine/Network/Client.cpp
2016-02-22 10:19:48 +01:00
stiffly a1e932d261 Merge remote-tracking branch 'origin/master' into FriendlyHost/Join 2016-02-22 10:06:51 +01:00
stiffly 070f1bd394 Merge remote-tracking branch 'origin/FriendlyHost/Join' into FriendlyHost/Join
# Conflicts:
#	src/Engine/Network/Client.cpp
2016-02-22 10:06:25 +01:00
stiffly 993d804cef Added an event to search for servers.
Client now broadcasts a serverlistrequest.
An active server will then answer the request and send info about the server.
The client saves this data to a list and presents it to the user.
2016-02-22 10:05:47 +01:00
Teejoon 201480b17f SSAO is working, but is kinda crappy. You can change shade variables in the debug window. 2016-02-19 16:50:04 +01:00
William Moberg bac23f6e8c Merge pull request #124 from teamfisk/FixNetworkBugs
Test text here. Good work Jocke.
2016-02-19 16:47:34 +01:00
Jocke 68f2d5327d added extra check in HealthSystem 2016-02-19 16:37:26 +01:00
Jocke 2263fd2ad6 Fixed crash in Client::parsePlayerDamage. 2016-02-19 16:18:16 +01:00
stiffly 2f259c3773 Added an event to search for servers.
Client now broadcasts a serverlistrequest.
An active server will then answer the request and send info about the server.
The client saves this data to a list and presents it to the user.
2016-02-19 15:38:09 +01:00
William Moberg 8cc928b5f4 Merge pull request #122 from teamfisk/WorldSnapshots
World snapshots
2016-02-19 15:12:31 +01:00
Jace 881ce7b02f Proper string handling without nasty memory leaks. PHEW. 2016-02-19 15:11:10 +01:00
Jace c130fdda5e Merge pull request #123 from teamfisk/BoxModelCollision
Falling through ground + dash fix.
2016-02-19 14:53:37 +01:00
Tleety 97fcdb342d Bloom should now show behind transparent objects. 2016-02-19 14:23:40 +01:00
William Moberg 4c87ca10b9 Merge branch 'master' into BoxModelCollision 2016-02-19 14:17:17 +01:00
William Moberg 22664848dc You should not be able to fall through ground or dash thru walls. Very thin objects may still be possible to go through, e.g. the grid border walls in GameMap.xml. 2016-02-19 14:16:22 +01:00
Tleety d135ea2da6 Small fix 2016-02-19 13:53:43 +01:00
Tleety 949ee76f55 Fallow and name fix 2016-02-19 13:52:16 +01:00
Jace 844825813b Merge pull request #121 from teamfisk/ResolutionChange
Resolution change
2016-02-19 13:31:06 +01:00
Tleety 722b795d37 Fixed spelling 2016-02-19 13:30:41 +01:00
Tleety cf2bf4e14d Merge remote-tracking branch 'origin/master' into ResolutionChange 2016-02-19 13:17:31 +01:00
Jace 2ac584bafb Merge pull request #113 from teamfisk/Menu-Tobias
Menu tobias
2016-02-19 13:16:50 +01:00
Tleety 6e5335a266 Release now return name and entity of the entity that was previously klicked. 2016-02-19 13:16:26 +01:00
Tleety fc5d054cb2 Entity is now sent with the click events.
Fixed small things
2016-02-19 12:49:07 +01:00
Tleety 8c9f4bb84b Resize should now be working correctly. 2016-02-19 11:42:52 +01:00
Tleety e15a7b9485 You can now change resolution without any apparent bugs. 2016-02-18 18:00:26 +01:00
William Moberg a141da3d8c Merge pull request #118 from teamfisk/AndersTest
Test fixes
2016-02-18 15:29:33 +01:00
verysecrethero b81bb9eeea Changed SprintAbility to take StrengthOfEffect. PlayerMovementSystem: if Sniper is sprinting he will now move faster. 2016-02-18 15:17:19 +01:00
Jace ca907b912e Copy constructor for deep copy of World. 2016-02-18 13:54:32 +01:00
verysecrethero b2304a95f8 Fixed some XML documentation 2016-02-18 13:49:22 +01:00
verysecrethero 8c92b7ceb6 Small cleanup. Clarified a few comments 2016-02-18 13:40:17 +01:00
Jace 97499f1c28 Made ComponentPool copyable by making sure string fields are handled properly 2016-02-18 11:37:03 +01:00
verysecrethero 64610e3c03 Fixed so some of the tests are working again. Also removed the test errors 2016-02-18 11:27:07 +01:00
verysecrethero 7f489b3569 Added Assault,Defender,Sniper Components,Entities. Added ShieldAbility,Sprintability-Component (not implemented). Changed BoostSystem to use a childed Boost to the player. All friendly fire is 0 damage. 2016-02-18 10:40:09 +01:00
Jace 5dd85d2748 Merge pull request #110 from teamfisk/PerformanceTiming
Performance timing
2016-02-18 10:33:24 +01:00
Jace 261c2e021e Merge pull request #115 from teamfisk/Respawning
Spawn blocking fix
2016-02-18 10:26:08 +01:00
William Moberg 581a7b470c Merge pull request #94 from teamfisk/AndersTest
Added 3 PickupSpawnSystem test
2016-02-18 10:21:37 +01:00
verysecrethero c3ed429377 Added BoostSystem, Added BoostAssault entity XML 2016-02-17 18:11:36 +01:00
Teejoon c4d3c515e4 Marge with Master 2016-02-17 18:04:49 +01:00
Teejoon 7cc58dc94c Merge branch 'master' of https://github.com/teamfisk/TacticalZ into SeeTeamMates 2016-02-17 18:00:30 +01:00
Teejoon 5e3af7ac5d Player Indicator now working OK. Scaling depending on how far away you are makes the Indicator to hide players head behind it. Shields are making indicators to disappear. 2016-02-17 17:58:01 +01:00
Tleety 3e7936ef00 You can now change resolution by pressing buttons. 2016-02-17 17:44:33 +01:00
stiffly 46987beefb Updated the serverlist, now prints adress and port of the server. 2016-02-17 17:05:10 +01:00
verysecrethero 8845054965 Merge remote-tracking branch 'origin/master' into PerformanceTiming
# Conflicts:
#	resources/Schema/Entities/NewMap.xml
2016-02-17 16:59:26 +01:00
Tleety 7dfd68467e Merge branch 'Menu-Tobias' into ResolutionChange 2016-02-17 16:54:06 +01:00
Teejoon 4fd0108443 Working billbording 2016-02-17 16:50:24 +01:00
verysecrethero 56bc1fee3d Added LifeTimeOfEffect in BoostAssault,BoostDefender components. 2016-02-17 16:43:38 +01:00
William Moberg 52355a63e2 Merge branch 'master' into Respawning 2016-02-17 16:08:00 +01:00
William Moberg 72db672dbf Ray will not hit objects in octree if they are transparent or invisible. 2016-02-17 16:06:35 +01:00
verysecrethero 1c9a1a9904 playerMovementSpeed,playerCrouchSpeed in the player component now also gets AssaultBoosted. 2016-02-17 16:04:44 +01:00
stiffly 950ecba1c0 Merge remote-tracking branch 'origin/master' into FriendlyHost/Join 2016-02-17 15:52:58 +01:00
stiffly fdc8f753cb Implemented primitive server "heartbeat" logic, which sends server info from server to client without being connected. 2016-02-17 15:51:26 +01:00
verysecrethero e8aff02c4e Merge remote-tracking branch 'origin/master' into AssaultBoost 2016-02-17 14:58:28 +01:00
Tobias Dahl 0d665c10fe Merge pull request #114 from teamfisk/HealthPickup
The rotation of the Pickups are now also included in the AmmoPickup.x…
2016-02-17 14:56:45 +01:00
William Moberg 23bb1a6405 Cannot respawn inside other players, unless all are blocked. 2016-02-17 14:54:59 +01:00
verysecrethero b8222c7b2e The rotation of the Pickups are now also included in the AmmoPickup.xml, HealthPickup.xml 2016-02-17 14:54:42 +01:00
Tobias Dahl 43bbc063cf Merge pull request #111 from teamfisk/HealthPickup
Fixed RespawnModel of Pickups
2016-02-17 14:39:09 +01:00
verysecrethero f7303ad787 Merge remote-tracking branch 'origin/master' into AssaultBoost 2016-02-17 14:38:04 +01:00
verysecrethero 3e4b87da7c Merge remote-tracking branch 'origin/master' into HealthPickup
# Conflicts:
#	resources/Schema/Entities/NewMap.xml
2016-02-17 14:32:59 +01:00
verysecrethero ac9ce8ea83 Merge remote-tracking branch 'origin/master' into HealthPickup 2016-02-17 14:30:31 +01:00
Tobias Dahl 99643fd748 Merge pull request #112 from teamfisk/AssaultDash
You can now AssaultDash in the air
2016-02-17 14:24:58 +01:00
Tleety a6c30100af FrameWork for menu buttons 2016-02-17 14:16:17 +01:00
verysecrethero 833015f45e Small code cleanup for PerformanceTimer 2016-02-17 13:44:41 +01:00
Tleety 657125b469 Moved menu code into GUI
Button events are now sent when you click.
2016-02-17 13:44:11 +01:00
verysecrethero 456cd35a12 Merge remote-tracking branch 'origin/master' into AssaultBoost
# Conflicts:
#	resources/Schema/Components.xsd
2016-02-17 11:52:06 +01:00
verysecrethero 8f28c760dd You can now AssaultDash in the air 2016-02-17 11:47:10 +01:00
verysecrethero b13362360a Fixed RespawnModel of Pickups 2016-02-17 11:22:42 +01:00
Jace 0af9edc6e5 Editor is properly disabled when disabled in config 2016-02-17 10:53:20 +01:00
verysecrethero ec10ef3ffc Merge remote-tracking branch 'origin/master' into HealthPickup 2016-02-17 10:32:35 +01:00
Jocke 4432891437 Fixed crash in Client::parsePlayerDamage. 2016-02-17 10:21:50 +01:00
verysecrethero b2a437731e Small cleanup in the code 2016-02-16 17:58:27 +01:00
verysecrethero 42b49f9dba Added more timers to Rendering. 2016-02-16 17:51:39 +01:00
verysecrethero 4b8f1d95a3 Added static class PerformanceTimer. Changed CMakeLists for engine to include boost timer. Added F2,F3 functions in editor. Added some timing, more to be added 2016-02-16 16:57:46 +01:00
Tleety 8f84a5ddd6 Buttons are now clickable 2016-02-16 16:28:19 +01:00
Jocke a006db9e63 WIP Fix dsync 2016-02-16 16:06:17 +01:00
Teejoon 17da9a8036 WIP 2016-02-16 15:56:58 +01:00
Tleety 6bc7131290 Glow Intencity can now be changed in the model component. 2016-02-16 14:57:21 +01:00
Tleety 4214bf10a1 Components for menu/buttons 2016-02-16 14:05:57 +01:00
Jocke 717af2c4a4 Fixed bug in Client::parsePlayerDamage() 2016-02-16 10:22:15 +00:00
Jace 969e7cb0d5 Merge remote-tracking branch 'origin/FixNetworkToPlayTest' 2016-02-12 09:18:32 +01:00
Jace 47a365a8fc Inverted capture point numbers to fix HUD 2016-02-12 09:17:39 +01:00
Jace 71c03326aa Debug.EditorEnabled 2016-02-12 09:17:28 +01:00
Jocke ba69c79821 Fixed bug in Server. 2016-02-12 09:13:43 +01:00
Jace 0a31fa3dfd Merge branch 'master' of github.com:teamfisk/TacticalZ 2016-02-12 09:08:17 +01:00
Jace ca457d9c00 Player names 2016-02-12 09:07:59 +01:00
antc13 a08e54a147 Blocked up a path in the Spawns a bit more. 2016-02-12 08:44:40 +01:00
Jocke 2c3122bbdb increased Network buffer size, fixed 2 crashes and re-added the ability to kill oneself with the use of a key bound to TakeDamage,Value. 2016-02-12 08:39:20 +01:00
Jace 10846be820 Merge pull request #109 from teamfisk/Sound
Added weapon sounds.
2016-02-12 08:23:30 +01:00
stiffly 9df7b32ca1 Merge remote-tracking branch 'origin/master' into Sound 2016-02-12 08:20:01 +01:00
stiffly 3d4a7de59d MiniDump.cpp was not added to CMakeLists.txt. 2016-02-12 08:19:47 +01:00
stiffly 1cdcbf9b32 Merge remote-tracking branch 'origin/master' into Sound
# Conflicts:
#	src/Game/Systems/PlayerSpawnSystem.cpp
#	src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp
2016-02-12 08:19:29 +01:00
antc13 9e8d2b99df Merge branch 'master' of https://github.com/teamfisk/TacticalZ 2016-02-12 08:16:23 +01:00
antc13 ba4877c3f7 Moved Spawn locations and added ammo/health pickups around the map. 2016-02-12 08:16:12 +01:00
stiffly af39b892cd Now plays a "Empty sound", "reload sound" and "hit mark sound" on appropriate occasions. 2016-02-12 08:05:35 +01:00
Jace 1ed5107d9b Merge pull request #108 from teamfisk/MiniDump
Minidump on crash
2016-02-12 08:04:25 +01:00
antc13 2ce7179d19 Merge branch 'master' of https://github.com/teamfisk/TacticalZ 2016-02-12 07:49:58 +01:00
Jace eb7b22c757 Latest assets 2016-02-12 07:48:26 +01:00
Jace b48d491ad7 Complete blue and red player entities 2016-02-12 07:45:51 +01:00
Jocke 7d732c75ca Server now removes players that have disconnected. 2016-02-12 07:42:01 +01:00
Jace 47f4711b85 Merge remote-tracking branch 'origin/Menu' into WeaponSystem
# Conflicts:
#	resources/Schema/Entities/Player.xml
#	resources/Schema/Types/Entity.xsd
#	src/Game/Systems/PlayerSpawnSystem.cpp
2016-02-12 07:18:20 +01:00
Jace 78e318c032 Proper snapshot filtering 2016-02-12 07:14:36 +01:00
Jace bb66f95d43 Enabled server broadcasting PlayerDamage events to other players to make damage indicators work 2016-02-12 07:03:14 +01:00
Jace cc422cf73a Fixed PlayerDeath being fired multiple times per frame on the server, causing multiple spawns and other weirdness 2016-02-12 06:30:19 +01:00
Jace 2e5ee633ce Fixed bug when client would recieve input command from an entity that the client didn't know about 2016-02-12 06:10:20 +01:00
Tleety 1e04244590 Fixed network bug sorta 2016-02-12 06:00:42 +01:00
viktorljung f146971db0 Fixed size 2016-02-12 05:45:17 +01:00
viktorljung 60b2c9bc9b KillFeed 2016-02-12 05:41:05 +01:00
Tleety d357e365cb Merge remote-tracking branch 'origin/TCPConnections' into WeaponSystem
# Conflicts:
#	include/Engine/Network/Server.h
#	src/Engine/Network/Client.cpp
#	src/Engine/Network/Server.cpp
2016-02-12 05:21:00 +01:00
Tleety a8a3366e8a Hopeless attempts to fix network bugs 2016-02-12 05:17:09 +01:00
Jocke 7de76376cf Merge remote-tracking branch 'origin/master' into TCPConnections
# Conflicts:
#	src/Engine/Network/Client.cpp
#	src/Engine/Network/Server.cpp
#	src/Engine/Rendering/PickingPass.cpp
#	src/Game/Systems/PlayerSpawnSystem.cpp
2016-02-12 05:16:30 +01:00
William Moberg 422bedb844 MiniDump name now depends on time e.g. TacticalZ Fri 04-20-49. 2016-02-12 04:22:11 +01:00
stiffly 1da432ba23 WIP sounds 2016-02-12 04:03:35 +01:00
Jace 787eecce26 WIP 2016-02-12 04:03:22 +01:00
William Moberg 215b1b1aa4 On crash, takes minidump, then show MessageBox, and exit app. 2016-02-12 03:32:42 +01:00
antc13 f49cacf167 Merge branch 'master' of https://github.com/teamfisk/TacticalZ 2016-02-12 02:47:50 +01:00
Jace a15e01596a Merge branch 'master' of github.com:teamfisk/TacticalZ 2016-02-12 02:47:12 +01:00
antc13 a5168bd1c2 Merge branch 'master' of https://github.com/teamfisk/TacticalZ 2016-02-12 02:46:52 +01:00
antc13 784e1eb69b Changed Colors on some materials and changed bridges to red and blue bridges. 2016-02-12 02:46:44 +01:00
Jace b5e372896f Added spawner? 2016-02-12 02:46:42 +01:00
Jace a54156fab3 Added HUD elements to player 2016-02-12 02:46:16 +01:00
Tobias Dahl a20707739e Merge pull request #107 from teamfisk/CapturePointColorFix
ColorFix
2016-02-12 02:39:21 +01:00
viktorljung 987dafb44a Fixed Health text color 2016-02-12 02:38:11 +01:00
Jace 47053285c8 Merge remote-tracking branch 'origin/Menu' into WeaponSystem
# Conflicts:
#	resources/Schema/Entities/Player.xml
#	resources/Schema/Types/Entity.xsd
2016-02-12 02:30:38 +01:00
Jace bee0630a26 Merge remote-tracking branch 'origin/master' into WeaponSystem 2016-02-12 02:27:44 +01:00
Jace 1dc3756533 Fixed respawn crash when a player died that had never spawned 2016-02-12 02:23:13 +01:00
Jace b9ea314232 Merge remote-tracking branch 'origin/master' into WeaponSystem
# Conflicts:
#	resources/Schema/Entities/NewMap.xml
2016-02-12 02:11:11 +01:00
Jace 71533b52ae Map fix 2016-02-12 02:10:42 +01:00
viktorljung 6442254575 Merge remote-tracking branch 'origin/master' into Menu
# Conflicts:
#	src/Game/Game.cpp
2016-02-12 02:09:14 +01:00
viktorljung 021c4e36d7 New HUD XML files 2016-02-12 02:08:24 +01:00
viktorljung fb5164221f HealthHUD redesigned 2016-02-12 01:57:53 +01:00
Jace 88c7c57671 Merge remote-tracking branch 'origin/master' into WeaponSystem 2016-02-12 01:46:45 +01:00
Jace 5295133311 Hack to sync ammo over network until we have input replaying + Reload effect from all views 2016-02-12 01:45:54 +01:00
Jocke 3b42f5dbf4 Fixed server so it now deletes. 2016-02-12 01:33:45 +01:00
viktorljung 0370775820 Merge remote-tracking branch 'origin/master' into Menu
# Conflicts:
#	resources/Schema/Entities/Player.xml
2016-02-12 00:28:24 +01:00
viktorljung a36ed76a4e AmmunitionHUDSystem now really working 2016-02-12 00:26:59 +01:00
stiffly e24a84c52d Server now deletes the player on a new player spawn. 2016-02-11 23:52:55 +01:00
Jace 30f454e6a4 Entity fixes 2016-02-11 23:50:57 +01:00
viktorljung c1860ae383 AmmunitionHUD now working 2016-02-11 23:38:25 +01:00
stiffly 70f4002d70 Merge remote-tracking branch 'origin/Animations' into TCPConnections 2016-02-11 22:15:59 +01:00
stiffly b66e3d3630 WIP trying to hot fix 2016-02-11 22:15:47 +01:00
stiffly 055f6517a1 Merge remote-tracking branch 'origin/master' into TCPConnections 2016-02-11 21:24:16 +01:00
stiffly afd9e24df6 Reverted last commit. Also testing to delay OnPlayerSpawn event for clients. No progress... 2016-02-11 21:23:53 +01:00
viktorljung 851418b1de Merge remote-tracking branch 'origin/master' into Menu 2016-02-11 21:16:31 +01:00
viktorljung fee50ba3b6 Crash fix 2016-02-11 21:16:10 +01:00
Jocke 49d4a45ef8 Client crashed when connecting, this was a hot fix. 2016-02-11 16:27:33 +01:00
Jocke e0c3a32e66 Merge branch 'master' into TCPConnections
# Conflicts:
#	include/Engine/Network/Client.h
#	include/Engine/Network/Server.h
#	include/Game/Game.h
#	src/Engine/Network/Client.cpp
#	src/Engine/Network/Server.cpp
#	src/Game/Game.cpp
2016-02-11 16:26:42 +01:00
Jocke fa2e556ab2 fixed some error handling in TCPClient. 2016-02-11 14:07:51 +01:00
Jocke eb244f87c4 Added disconnect functionality and removed some warnings. 2016-02-10 23:27:46 +01:00
Jocke ec54b1298d Reconnect is now possible. 2016-02-10 21:02:46 +01:00
Jocke 95fa1f4bbd Connect Fix for TCP Client 2016-02-10 20:10:20 +01:00
Jocke 7cbdc33f84 Updated submodules 2016-02-10 17:39:23 +01:00
Jocke 9645169797 Merge remote-tracking branch 'origin/master' into TCPConnections
# Conflicts:
#	include/Engine/Network/Client.h
#	include/Engine/Network/Network.h
#	include/Engine/Network/Packet.h
#	include/Engine/Network/Server.h
#	src/Engine/Network/Client.cpp
#	src/Engine/Network/Packet.cpp
#	src/Engine/Network/Server.cpp
#	src/Tests/HealthSystemTest.cpp
2016-02-10 17:05:07 +01:00
verysecrethero 02cd822cf1 Tiny test refactoring 2016-02-10 17:04:05 +01:00
verysecrethero f7756ff60f Tiny refactoring of PickupSpawnTest. Updated and fixed HealthSystemTest. 2016-02-10 16:51:00 +01:00
verysecrethero 2d5f71e442 Added 3 PickupSpawnSystem tests. 2016-02-10 16:25:47 +01:00
Jocke 4f2ad3ad00 Reliable message should now be working, further testing is to be done. 2016-02-10 16:16:56 +01:00
verysecrethero 2f53ed140f Merge remote-tracking branch 'origin/master' into AssaultBoost
# Conflicts:
#	resources/Schema/Components.xsd
2016-02-10 14:16:55 +01:00
Jocke 2ec30fd2b2 Cleaned up code and fixed crash when closing client before server when using udp. 2016-02-10 11:28:03 +01:00
Jocke d2ed293183 Network is now working as udp or tcp. Next step is making the hybrid. 2016-02-09 19:14:56 +01:00
Jocke fccd8c64e7 WIP Clients are working properly, servers are not. 2016-02-09 11:43:16 +01:00
Jocke ba9419b342 Moved UDP logic from Hybrid server/client to UDP server/client. fixed bug in Server::CheckForTimeOuts. 2016-02-08 14:32:00 +01:00
verysecrethero 503613907e Merge remote-tracking branch 'origin/master' into HealthPickup 2016-02-08 11:39:05 +01:00
verysecrethero 4bf91ba56a Merge remote-tracking branch 'origin/master' into AssaultBoost
# Conflicts:
#	resources/Schema/Components.xsd
#	src/Game/Systems/PlayerMovementSystem.cpp
2016-02-08 10:12:13 +01:00
Jocke 88d7b79cd3 TCP and UDP Client are working for 1 connected player, more players are not tested yet 2016-02-05 18:30:31 +01:00
verysecrethero 047e71a4e1 Added BoostAssault,BoostDefender components. Added their effects in HealthSystem,PlayerMovementSystem 2016-02-04 16:18:54 +01:00
Jocke 9232b24a7b WIP Reliable message 2016-02-04 15:49:04 +01:00
Jocke 7bf4f5c30e Merge remote-tracking branch 'origin/master' into TCPConnections 2016-02-03 10:29:36 +01:00
Jocke e133791369 WIP Reliable Message 2016-02-03 10:28:15 +01:00
97 changed files with 10307 additions and 607 deletions
+1 -1
Submodule assets updated: 078e014f3d...1e7adc749e
@@ -28,6 +28,7 @@ public:
virtual void Reset();
void AssaultDashCheck(double dt, bool isJumping, double assaultDashCoolDownMaxTimer);
bool SniperSprintingCheck();
virtual bool AssaultDashDoubleTapped() const { return m_AssaultDashDoubleTapped; }
virtual bool PlayerIsDashing() const { return m_PlayerIsDashing; }
@@ -202,7 +203,7 @@ void FirstPersonInputController<EventContext>::AssaultDashCheck(double dt, bool
}
//dashing with shift
if (m_ShiftDashing && m_AssaultDashCoolDownTimer <= 0.0f && !isJumping) {
if (m_ShiftDashing && m_AssaultDashCoolDownTimer <= 0.0f) {
//player is dashing with shift
//the wanted-direction is set in playermovement already so we dont need to check what direction we want to dash in!
m_AssaultDashCoolDownTimer = assaultDashCoolDownMaxTimer;
@@ -227,7 +228,7 @@ void FirstPersonInputController<EventContext>::AssaultDashCheck(double dt, bool
}
m_ValidDoubleTap = false;
if (!(m_AssaultDashCoolDownTimer <= 0.0f && !isJumping)) {
if (!(m_AssaultDashCoolDownTimer <= 0.0f)) {
//if we cant dash at the moment, then just reset the tap-sensitivity-timer
m_AssaultDashDoubleTapDeltaTime = 0.f;
return;
@@ -241,4 +242,12 @@ void FirstPersonInputController<EventContext>::AssaultDashCheck(double dt, bool
m_EventBroker->Publish(e);
}
template <typename EventContext>
bool FirstPersonInputController<EventContext>::SniperSprintingCheck() {
if (m_SpecialAbilityKeyDown) {
return true;
} else {
return false;
}
}
#endif
+14 -12
View File
@@ -13,6 +13,8 @@
#include "Network/Network.h"
#include "Network/MessageType.h"
#include "Network/PlayerDefinition.h"
#include "Network/UDPClient.h"
#include "Network/TCPClient.h"
#include "Network/SnapshotDefinitions.h"
#include "Core/World.h"
#include "Core/EventBroker.h"
@@ -33,17 +35,15 @@ public:
void Connect(std::string address, int port);
void Update() override;
private:
std::vector<Events::PlayerSpawned> m_PlayerSpawnEvents;
void parseSpawnEvents();
// Save for children
std::unique_ptr<SnapshotFilter> m_SnapshotFilter = nullptr;
// Assio UDP logic
boost::asio::ip::udp::endpoint m_ReceiverEndpoint;
boost::asio::io_service m_IOService;
boost::asio::ip::udp::socket m_Socket;
std::string m_Address;
int m_Port = 0;
// Sending message to server logic
size_t bytesRead = 0;
char readBuf[INPUTSIZE] = { 0 };
// Packet loss logic
PacketID m_PacketID = 0;
@@ -72,16 +72,14 @@ private:
std::vector<Events::InputCommand> m_InputCommandBuffer;
// Private member functions
void readFromServer();
size_t receive(char* data);
void send(Packet& packet);
void connect();
void disconnect();
void parseMessageType(Packet& packet);
void updateFields(Packet& packet, const ComponentInfo& componentInfo, const EntityID& entityID);
SharedComponentWrapper createSharedComponent(Packet& packet, EntityID entityID, const ComponentInfo& componentInfo);
void ignoreFields(Packet& packet, const ComponentInfo& componentInfo);
void parseConnect(Packet& packet);
void parseUDPConnect(Packet& packet);
void parseTCPConnect(Packet& packet);
void parsePlayerConnected(Packet& packet);
void parsePing();
void parseKick();
@@ -91,7 +89,7 @@ private:
void InterpolateFields(Packet & packet, const ComponentInfo & componentInfo, const EntityID & entityID, const std::string & componentType);
void parseSnapshot(Packet& packet);
void identifyPacketLoss();
bool hasServerTimedOut();
void hasServerTimedOut();
EntityID createPlayer();
void sendInputCommands();
void sendLocalPlayerTransform();
@@ -111,6 +109,10 @@ private:
bool OnPlayerDamage(const Events::PlayerDamage& e);
EventRelay<Client, Events::PlayerSpawned> m_EPlayerSpawned;
bool OnPlayerSpawned(const Events::PlayerSpawned& e);
void parsePlayerDamage(Packet& packet);
private:
UDPClient m_Unreliable;
TCPClient m_Reliable;
};
#endif
+13
View File
@@ -0,0 +1,13 @@
#ifndef HybridClient_h__
#define HybridClient_h__
class HybridClient
{
public:
HybridClient();
~HybridClient();
private:
};
#endif
+12
View File
@@ -0,0 +1,12 @@
#ifndef HybridServer_h__
#define HybridServer_h__
class HybridServer
{
public:
HybridServer();
~HybridServer();
private:
};
#endif
+2 -1
View File
@@ -18,7 +18,8 @@ enum class MessageType
OnPlayerSpawned,
EntityDeleted,
ComponentDeleted,
PlayerTransform
PlayerTransform,
Invalid
};
#endif
+3 -1
View File
@@ -12,7 +12,7 @@
#include <fstream>
#include <iostream>
#define INPUTSIZE 32000
#define BUFFERSIZE 32000
typedef unsigned int PlayerID;
typedef unsigned int PacketID;
@@ -35,6 +35,8 @@ protected:
std::clock_t m_SaveDataTimer;
unsigned int m_MaxConnections;
double m_TimeoutMs;
void logSentData(int bytesSent);
void logReceivedData(int bytesReceived);
void saveToFile();
void updateNetworkData();
};
+21
View File
@@ -0,0 +1,21 @@
#ifndef NetworkClient_h__
#define NetworkClient_h__
#include "Network/Packet.h"
#define BUFFERSIZE 64000
typedef unsigned int PlayerID;
typedef unsigned int PacketID;
class NetworkClient
{
public:
virtual void Connect(std::string playerName, std::string address, int port) = 0;
virtual void Disconnect() = 0;
virtual void Receive(Packet& packet) = 0;
virtual void Send(Packet & packet) = 0;
virtual bool IsSocketAvailable() = 0;
protected:
char m_ReadBuffer[BUFFERSIZE] = { 0 };
};
#endif
+21
View File
@@ -0,0 +1,21 @@
#ifndef NetworkServer_h__
#define NetworkServer_h__
#include <boost/asio.hpp>
#include "Network/Packet.h"
#include "Network/PlayerDefinition.h"
#define BUFFERSIZE 64000
typedef unsigned int PlayerID;
typedef unsigned int PacketID;
class NetworkServer
{
public:
virtual void AcceptNewConnections(int& nextPlayerID, std::map<PlayerID, PlayerDefinition>& connectedPlayers) = 0;
virtual void Receive(Packet & packet, PlayerDefinition & playerDefinition) = 0;
virtual void Send(Packet & packet, PlayerDefinition & playerDefinition) = 0;
virtual void Send(Packet & packet) = 0;
protected:
char m_ReadBuffer[BUFFERSIZE] = { 0 };
};
#endif
+6
View File
@@ -49,10 +49,15 @@ public:
void WriteData(char* data, int sizeOfData);
// Pops the first element as if it was a string.
std::string ReadString();
// Construct a packet
void ReconstructFromData(char* data, size_t SizeOfData);
// Update size of packet variable in header
void UpdateSize();
char* ReadData(int SizeOfData);
void ChangePacketID(unsigned int& packetID);
size_t Size() { return m_Offset; };
char* Data() { return m_Data; };
MessageType GetMessageType();
size_t DataReadSize() { return m_ReturnDataOffset; }
size_t MaxSize() { return m_MaxPacketSize; }
size_t HeaderSize() { return m_HeaderSize; }
@@ -64,6 +69,7 @@ private:
size_t m_MaxPacketSize = 512;
size_t m_HeaderSize = 0;
void resizeData();
void resizeData(int size);
};
#endif
@@ -2,6 +2,7 @@
#define PlayerDefinition_h__
#include <string>
#include "../Core/Entity.h"
#include <boost/asio.hpp>
struct PlayerDefinition {
::EntityID EntityID = EntityID_Invalid;
@@ -9,6 +10,10 @@ struct PlayerDefinition {
boost::asio::ip::udp::endpoint Endpoint;
unsigned int PacketID;
std::clock_t StopTime;
boost::asio::ip::address TCPAddress;
unsigned short TCPPort;
// use for tcp connections
boost::shared_ptr<boost::asio::ip::tcp::socket> TCPSocket;
};
#endif
+25 -20
View File
@@ -5,8 +5,9 @@
#include <ctime>
#include <glm/common.hpp>
#include <boost/asio/ip/udp.hpp>
#include "Network/TCPServer.h"
#include "Network/UDPServer.h"
#include "Network/MessageType.h"
#include "Network/PlayerDefinition.h"
#include "Core/World.h"
@@ -28,28 +29,29 @@ public:
void Update() override;
private:
// Network channels
TCPServer m_Reliable;
UDPServer m_Unreliable;
// dont forget to set these in the childrens receive logic
boost::asio::ip::address m_Address;
int m_Port = 27666;
// UDP logic
boost::asio::ip::udp::endpoint m_ReceiverEndpoint;
boost::asio::io_service m_IOService;
std::unique_ptr<boost::asio::ip::udp::socket> m_Socket;
// Sending messages to client logic
std::map<PlayerID, PlayerDefinition> m_ConnectedPlayers;
std::vector<PlayerID> m_PlayersToDisconnect;
// HACK: Fix INPUTSIZE
char readBuffer[INPUTSIZE] = { 0 };
char readBuffer[BUFFERSIZE] = { 0 };
size_t bytesRead = 0;
// time for previouse message
std::clock_t previousePingMessage = std::clock();
std::clock_t previousSnapshotMessage = std::clock();
std::clock_t timOutTimer = std::clock();
// How often we send messages (milliseconds)
float pingIntervalMs;
float snapshotInterval;
int checkTimeOutInterval = 100;
int m_NextPlayerID = 0;
std::vector<Events::InputCommand> m_InputCommandsToBroadcast;
//Timers
std::clock_t m_StartPingTime;
@@ -58,11 +60,9 @@ private:
PacketID m_PreviousPacketID = 0;
// Private member functions
size_t receive(char* data);
void readFromClients();
void send(PlayerID player, Packet& packet);
void send(Packet& packet);
void broadcast(Packet& packet);
//int receive(char* data);
void reliableBroadcast(Packet& packet);
void unreliableBroadcast(Packet& packet);
void sendSnapshot();
void addChildrenToPacket(Packet& packet, EntityID entityID);
void addInputCommandsToPacket(Packet& packet);
@@ -70,15 +70,19 @@ private:
void checkForTimeOuts();
void disconnect(PlayerID playerID);
void parseMessageType(Packet& packet);
void parseOnInputCommand(Packet& packet);
void parseOnPlayerDamage(Packet& packet);
void parseConnect(Packet& packet);
void parseDisconnect();
void parseClientPing();
void parsePing();
void identifyPacketLoss();
void kick(PlayerID player);
PlayerID GetPlayerIDFromEndpoint(boost::asio::ip::udp::endpoint endpoint);
PlayerID GetPlayerIDFromEndpoint();
void parsePlayerTransform(Packet& packet);
void parseOnInputCommand(Packet& packet);
void parseClientPing();
void parsePing();
void parseUDPConnect(Packet & packet);
void parseTCPConnect(Packet & packet);
void parseDisconnect();
bool shouldSendToClient(EntityWrapper childEntity);
// Debug event
EventRelay<Server, Events::InputCommand> m_EInputCommand;
bool OnInputCommand(const Events::InputCommand& e);
@@ -88,7 +92,8 @@ private:
bool OnEntityDeleted(const Events::EntityDeleted& e);
EventRelay<Server, Events::ComponentDeleted> m_EComponentDeleted;
bool OnComponentDeleted(const Events::ComponentDeleted& e);
void parsePlayerTransform(Packet& packet);
EventRelay<Server, Events::PlayerDamage> m_EPlayerDamage;
bool OnPlayerDamage(const Events::PlayerDamage& e);
};
#endif
+28
View File
@@ -0,0 +1,28 @@
#ifndef TCPClient_h__
#define TCPClient_h__
#include <boost/asio.hpp>
#include "NetworkClient.h"
class TCPClient : public NetworkClient
{
public:
TCPClient();
~TCPClient();
void Connect(std::string playerName, std::string address, int port);
void Disconnect();
void Receive(Packet& packet);
void Send(Packet & packet);
bool IsSocketAvailable();
private:
// Assio TCP logic
boost::asio::ip::tcp::endpoint m_Endpoint;
boost::asio::io_service m_IOService;
std::unique_ptr<boost::asio::ip::tcp::socket> m_Socket;
size_t readBuffer(char* data);
PacketID m_SendPacketID = 0;
bool m_IsConnected = false;
};
#endif
+31
View File
@@ -0,0 +1,31 @@
#ifndef TCPServer_h__
#define TCPServer_h__
#include <boost/asio.hpp>
#include <boost/bind.hpp>
#include <map>
#include "NetworkServer.h"
class TCPServer : public NetworkServer
{
public:
TCPServer();
~TCPServer();
void AcceptNewConnections(int& nextPlayerID, std::map<PlayerID, PlayerDefinition>& connectedPlayers);
void Receive(Packet & packet, PlayerDefinition & playerDefinition);
void Send(Packet & packet, PlayerDefinition & playerDefinition);
void Send(Packet & packet);
void Disconnect();
private:
// TCP logic
boost::asio::io_service m_IOService;
std::unique_ptr<boost::asio::ip::tcp::acceptor> acceptor;
boost::shared_ptr<boost::asio::ip::tcp::socket> lastReceivedSocket;
void handle_accept(boost::shared_ptr<boost::asio::ip::tcp::socket> socket,
int& nextPlayerID, std::map<PlayerID, PlayerDefinition>& connectedPlayers,
const boost::system::error_code& error);
int readBuffer(char* data, PlayerDefinition& playerDefinition);
};
#endif
+27
View File
@@ -0,0 +1,27 @@
#ifndef UDPClient_h__
#define UDPClient_h__
#include <boost/asio.hpp>
#include "Network/NetworkClient.h"
class UDPClient : public NetworkClient
{
public:
UDPClient();
~UDPClient();
void Connect(std::string playerName, std::string address, int port);
void Disconnect();
void Receive(Packet& packet);
void Send(Packet & packet);
bool IsSocketAvailable();
private:
// Assio UDP logic
boost::asio::io_service m_IOService;
boost::asio::ip::udp::endpoint m_ReceiverEndpoint;
boost::shared_ptr<boost::asio::ip::udp::socket> m_Socket;
int readBuffer(char* data);
PacketID m_SendPacketID = 0;
};
#endif
+25
View File
@@ -0,0 +1,25 @@
#ifndef UDPServer_h__
#define UDPServer_h__
#include "NetworkServer.h"
#include <boost/asio/ip/udp.hpp>
class UDPServer : public NetworkServer
{
public:
UDPServer();
~UDPServer();
void AcceptNewConnections(int& nextPlayerID, std::map<PlayerID, PlayerDefinition>& connectedPlayers);
void Receive(Packet & packet, PlayerDefinition & playerDefinition);
void Send(Packet & packet, PlayerDefinition & playerDefinition);
void Send(Packet & packet);
bool IsSocketAvailable();
private:
// UDP logic
boost::asio::io_service m_IOService;
boost::asio::ip::udp::endpoint m_ReceiverEndpoint;
std::unique_ptr<boost::asio::ip::udp::socket> m_Socket;
int readBuffer(char* data);
};
#endif
+8
View File
@@ -0,0 +1,8 @@
#ifndef MiniDump_h__
#define MiniDump_h__
#include <Windows.h>
void WINAPI Create_Dump(PEXCEPTION_POINTERS pException, BOOL File_Flag, BOOL Show_Flag);
#endif
@@ -0,0 +1,17 @@
#ifndef AmmunitionHUDSystem_h__
#define AmmunitionHUDSystem_h__
#include "../../Engine/Core/System.h"
#include "../../Engine/GLM.h"
class AmmunitionHUDSystem : public ImpureSystem
{
public:
AmmunitionHUDSystem(SystemParams params)
: System(params)
{ }
virtual void Update(double dt) override;
};
#endif
+21
View File
@@ -0,0 +1,21 @@
#ifndef BoostSystem_h__
#define BoostSystem_h__
#include "Core/System.h"
#include "Core/ResourceManager.h"
#include "Core/EntityFileParser.h"
#include "Core/EPlayerDamage.h"
#include "Common.h"
class BoostSystem : public System
{
public:
BoostSystem(SystemParams params);
private:
EventRelay<BoostSystem, Events::PlayerDamage> m_EPlayerDamage;
bool OnPlayerDamage(Events::PlayerDamage& e);
std::string DetermineClass(EntityWrapper player);
};
#endif
@@ -3,13 +3,11 @@
#include "../../Engine/Core/System.h"
#include "../../Engine/GLM.h"
#include "../../Engine/Rendering/ESetCamera.h"
#include <imgui/imgui.h>
class PlayerHUDSystem : public ImpureSystem
class HealthHUDSystem : public ImpureSystem
{
public:
PlayerHUDSystem(SystemParams params)
HealthHUDSystem(SystemParams params)
: System(params)
{ }
+5 -2
View File
@@ -9,7 +9,8 @@
#include "Core/EPlayerDamage.h"
#include "Core/EPlayerHealthPickup.h"
#include "Core/EPlayerDeath.h"
#include "../Engine/Input/EInputCommand.h"
#include "Core/ConfigFile.h"
#include "Input/EInputCommand.h"
#include <tuple>
#include <vector>
@@ -24,6 +25,8 @@ public:
virtual void UpdateComponent(EntityWrapper& entity, ComponentWrapper& component, double dt) override;
private:
bool m_NetworkEnabled;
//methods which will take care of specific events
EventRelay<HealthSystem, Events::PlayerDamage> m_EPlayerDamage;
bool HealthSystem::OnPlayerDamaged(Events::PlayerDamage& e);
@@ -34,7 +37,7 @@ private:
//vector which will keep track of health changes
std::vector<std::tuple<EntityID, double>> m_DeltaHealthVector;
};
#endif
+39
View File
@@ -0,0 +1,39 @@
#ifndef KillFeedSystem_h__
#define KillFeedSystem_h__
#include "../../Engine/Core/System.h"
#include "../../Engine/GLM.h"
#include "Core/EPlayerDeath.h"
class KillFeedSystem : public ImpureSystem
{
public:
KillFeedSystem(SystemParams params)
: System(params)
{
EVENT_SUBSCRIBE_MEMBER(m_EPlayerDeath, &KillFeedSystem::OnPlayerDeath);
}
virtual void Update(double dt) override;
private:
EventRelay<KillFeedSystem, Events::PlayerDeath> m_EPlayerDeath;
bool KillFeedSystem::OnPlayerDeath(Events::PlayerDeath& e);
struct KillFeedInfo
{
std::string Content;
glm::vec4 Color;
float TimeToLive = 5.f;
};
std::list<KillFeedInfo> m_DeathQueue;
};
#endif
@@ -1,11 +1,13 @@
#include "Sound/EPlaySoundOnEntity.h"
#include "Collision/Collision.h"
#include "Rendering/AnimationSystem.h"
#include "Core/ConfigFile.h"
#include "WeaponBehaviour.h"
#include "../SpawnerSystem.h"
#include "Core/EPlayerDamage.h"
#include "Core/EShoot.h"
class AssaultWeaponBehaviour : public WeaponBehaviour
{
public:
@@ -19,11 +21,13 @@ public:
private:
EntityWrapper m_FirstPersonModel;
EntityWrapper m_ThirdPersonModel;
// State
bool m_Firing = false;
bool m_Reloading = false;
double m_ReloadTimer = 0.0;
EntityWrapper m_ReloadImpersonator;
EntityWrapper m_FirstPersonReloadImpersonator;
EntityWrapper m_ThirdPersonReloadImpersonator;
double m_TimeSinceLastFire = 0.0;
EventRelay<WeaponBehaviour, Events::AnimationComplete> m_EAnimationComplete;
@@ -33,7 +37,8 @@ private:
void fireRound();
void spawnTracer();
float traceRayDistance(glm::vec3 origin, glm::vec3 direction);
void playSound();
void playFireSound();
void playEmptySound();
void viewPunch();
void finishReload();
void playShootAnimation();
+1 -1
View File
@@ -23,7 +23,7 @@ StartNetwork=false
IsServer=false
Name=Bob
Address=127.0.0.1
Port=13
Port=27666
MaxConnections=8
SnapshotInterval=0.05
SendInputIntervalMs=33
+7
View File
@@ -35,9 +35,16 @@
<xs:include schemaLocation="Components/AmmoPickup.xsd"/>
<xs:include schemaLocation="Components/AnimationOffset.xsd"/>
<xs:include schemaLocation="Components/DashAbility.xsd"/>
<xs:include schemaLocation="Components/ShieldAbility.xsd"/>
<xs:include schemaLocation="Components/SprintAbility.xsd"/>
<xs:include schemaLocation="Components/AssaultWeapon.xsd"/>
<xs:include schemaLocation="Components/BoostAssault.xsd"/>
<xs:include schemaLocation="Components/BoostDefender.xsd"/>
<xs:include schemaLocation="Components/BoostSniper.xsd"/>
<xs:include schemaLocation="Components/Shield.xsd"/>
<xs:include schemaLocation="Components/Sprite.xsd"/>
<xs:include schemaLocation="Components/Shielded.xsd"/>
<xs:include schemaLocation="Components/CapturePointHUD.xsd"/>
<xs:include schemaLocation="Components/AmmunitionHUD.xsd"/>
<xs:include schemaLocation="Components/KillFeed.xsd"/>
</xs:schema>
@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<AmmunitionHUD xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="AmmunitionHUD.xsd">
</AmmunitionHUD>
@@ -0,0 +1,10 @@
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:t="types">
<xs:import schemaLocation="../Types.xsd" namespace="types"/>
<xs:include schemaLocation="../Types/TeamEnum.xsd"/>
<xs:element name="AmmunitionHUD">
<xs:annotation>
<xs:documentation>Hud element for tracking ammunition from parent with AssaultWeapon component. Child with the name "MagazineAmmo" tracks clip ammunition. Child with the name "Ammo" tracks ammo.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:schema>
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<BoostAssault xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="BoostAssault.xsd">
<StrengthOfEffect>2</StrengthOfEffect>
</BoostAssault>
@@ -0,0 +1,18 @@
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:t="types">
<xs:import schemaLocation="../Types.xsd" namespace="types"/>
<xs:element name="BoostAssault">
<xs:annotation>
<xs:documentation>This is the assault's class boost component</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:all>
<xs:element name="StrengthOfEffect" type="t:double" minOccurs="0">
<xs:annotation><xs:documentation>This is the strength of the boost effect</xs:documentation></xs:annotation>
</xs:element>
</xs:all>
</xs:complexType>
</xs:element>
</xs:schema>
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<BoostDefender xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="BoostDefender.xsd">
<StrengthOfEffect>10</StrengthOfEffect>
</BoostDefender>
@@ -0,0 +1,18 @@
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:t="types">
<xs:import schemaLocation="../Types.xsd" namespace="types"/>
<xs:element name="BoostDefender">
<xs:annotation>
<xs:documentation>This is the defender's class boost component</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:all>
<xs:element name="StrengthOfEffect" type="t:double" minOccurs="0">
<xs:annotation><xs:documentation>This is the strength of the boost effect</xs:documentation></xs:annotation>
</xs:element>
</xs:all>
</xs:complexType>
</xs:element>
</xs:schema>
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<BoostSniper xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="BoostSniper.xsd">
<StrengthOfEffect>10</StrengthOfEffect>
</BoostSniper>
@@ -0,0 +1,18 @@
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:t="types">
<xs:import schemaLocation="../Types.xsd" namespace="types"/>
<xs:element name="BoostSniper">
<xs:annotation>
<xs:documentation>This is the sniper's class boost component</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:all>
<xs:element name="StrengthOfEffect" type="t:double" minOccurs="0">
<xs:annotation><xs:documentation>This is the strength of the boost effect</xs:documentation></xs:annotation>
</xs:element>
</xs:all>
</xs:complexType>
</xs:element>
</xs:schema>
+3
View File
@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<KillFeed xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="KillFeed.xsd">
</KillFeed>
+9
View File
@@ -0,0 +1,9 @@
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:t="types">
<xs:import schemaLocation="../Types.xsd" namespace="types"/>
<xs:element name="KillFeed">
<xs:annotation>
<xs:documentation>HUD element for tracking the 3 last kills, printed on the children with the names "KillFeed1", "KillFeed2", "KillFeed3"</xs:documentation>
</xs:annotation>
</xs:element>
</xs:schema>
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<ShieldAbility xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ShieldAbility.xsd">
<CoolDownMaxTimer>2.0</CoolDownMaxTimer>
</ShieldAbility>
@@ -0,0 +1,18 @@
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:t="types">
<xs:import schemaLocation="../Types.xsd" namespace="types"/>
<xs:element name="ShieldAbility">
<xs:annotation>
<xs:documentation>A shield component for one of the classes</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:all>
<xs:element name="CoolDownMaxTimer" type="t:double" minOccurs="0">
<xs:annotation><xs:documentation>This is the cooldown on shield</xs:documentation></xs:annotation>
</xs:element>
</xs:all>
</xs:complexType>
</xs:element>
</xs:schema>
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<SprintAbility xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="SprintAbility.xsd">
<StrengthOfEffect>2.0</StrengthOfEffect>
</SprintAbility>
@@ -0,0 +1,18 @@
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:t="types">
<xs:import schemaLocation="../Types.xsd" namespace="types"/>
<xs:element name="SprintAbility">
<xs:annotation>
<xs:documentation>A sprint component for one of the classes</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:all>
<xs:element name="StrengthOfEffect" type="t:double" minOccurs="0">
<xs:annotation><xs:documentation>This is the strength of the sprint effect</xs:documentation></xs:annotation>
</xs:element>
</xs:all>
</xs:complexType>
</xs:element>
</xs:schema>
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Text xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Text.xsd">
<Content>Text</Content>
<Content></Content>
<Resource></Resource>
<Color R="1" G="1" B="1" A="1"/>
<Visible>true</Visible>
+98
View File
@@ -0,0 +1,98 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Entity name="AmmunitionHUD" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
<Components>
<c:AmmunitionHUD/>
<c:Transform>
<Position X="-0.0430000015" Y="0.131501317" Z="-0.0670000017"/>
<Scale X="0.400000006" Y="0.400000006" Z="0.400000006"/>
</c:Transform>
</Components>
<Children>
<Entity name="AmmunitionHUDBackground">
<Components>
<c:Sprite>
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
<Color A="0.588235319" B="0" G="0" R="0"/>
</c:Sprite>
<c:Transform>
<Position X="0" Y="0" Z="-0.00200000009"/>
<Scale X="0.119999997" Y="0.119999997" Z="0.119999997"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:Transform/>
</Components>
<Children>
<Entity name="MagazineAmmo">
<Components>
<c:Text>
<Content>0</Content>
<Resource>Fonts/DroidSans.ttf,64</Resource>
<Color A="1" B="3.92156863" G="1.17647064" R="0"/>
</c:Text>
<c:Transform>
<Scale X="0.0599999987" Y="0.0599999987" Z="0.0599999987"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity name="Ammo">
<Components>
<c:Text>
<Content>360</Content>
<Resource>Fonts/DroidSans.ttf,64</Resource>
<Color A="1" B="3.92156863" G="1.17647064" R="0"/>
</c:Text>
<c:Transform>
<Position X="5.2833886e-05" Y="-0.0407950208" Z="0"/>
<Scale X="0.0399999991" Y="0.0399999991" Z="0.0399999991"/>
</c:Transform>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
<Entity>
<Components>
<c:Transform>
<Position X="-0.00200000009" Y="0.00400000019" Z="-0.00100000005"/>
</c:Transform>
</Components>
<Children>
<Entity name="MagazineAmmo">
<Components>
<c:Text>
<Content>0</Content>
<Resource>Fonts/DroidSans.ttf,64</Resource>
<Color A="1" B="0" G="0" R="0"/>
</c:Text>
<c:Transform>
<Scale X="0.0599999987" Y="0.0599999987" Z="0.0599999987"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity name="Ammo">
<Components>
<c:Text>
<Content>360</Content>
<Resource>Fonts/DroidSans.ttf,64</Resource>
<Color A="1" B="0" G="0" R="0"/>
</c:Text>
<c:Transform>
<Position X="5.2833886e-05" Y="-0.0407950208" Z="0"/>
<Scale X="0.0399999991" Y="0.0399999991" Z="0.0399999991"/>
</c:Transform>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
</Children>
</Entity>
+6 -1
View File
@@ -5,10 +5,15 @@
<c:AABB/>
<c:AmmoPickup/>
<c:Model>
<Resource>Models/Core/UnitSphere.mesh</Resource>
<Resource>Models/Props/PickUps/AmmoPickUp.mesh</Resource>
</c:Model>
<c:RaptorCopter>
<Speed>0.1</Speed>
<Axis X="0" Y="1" Z="0"/>
</c:RaptorCopter>
<c:Transform>
<Position X="0" Y="1" Z="0"/>
<Scale X="0.3" Y="0.3" Z="0.3"/>
</c:Transform>
<c:Trigger/>
</Components>
@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Entity name="AmmunitionHUD" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
<Components>
<c:AmmunitionHUD/>
<c:Transform>
<Position X="-0.0430000015" Y="0.131501317" Z="-0.0670000017"/>
<Scale X="0.400000006" Y="0.400000006" Z="0.400000006"/>
</c:Transform>
</Components>
<Children>
<Entity name="AmmunitionHUDBackground">
<Components>
<c:Sprite>
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
<Color A="0.588235319" B="0" G="0" R="0"/>
</c:Sprite>
<c:Transform>
<Position X="0" Y="0" Z="-0.00200000009"/>
<Scale X="0.119999997" Y="0.119999997" Z="0.119999997"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity name="AmmunitionText">
<Components>
<c:Transform/>
</Components>
<Children>
<Entity name="MagazineAmmo">
<Components>
<c:Text>
<Content>32</Content>
<Resource>Fonts/DroidSans.ttf,64</Resource>
<Color A="1" B="3.92156863" G="1.17647064" R="0"/>
</c:Text>
<c:Transform>
<Scale X="0.0599999987" Y="0.0599999987" Z="0.0599999987"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity name="Ammo">
<Components>
<c:Text>
<Content>360</Content>
<Resource>Fonts/DroidSans.ttf,64</Resource>
<Color A="1" B="3.92156863" G="1.17647064" R="0"/>
</c:Text>
<c:Transform>
<Position X="5.2833886e-05" Y="-0.0407950208" Z="0"/>
<Scale X="0.0399999991" Y="0.0399999991" Z="0.0399999991"/>
</c:Transform>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
</Children>
</Entity>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Entity xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
<Components>
<c:BoostAssault/>
<c:Lifetime>
<Lifetime>10</Lifetime>
</c:Lifetime>
<c:Transform/>
</Components>
<Children/>
</Entity>
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Entity xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
<Components>
<c:BoostDefender/>
<c:Lifetime>
<Lifetime>10</Lifetime>
</c:Lifetime>
<c:Transform/>
</Components>
<Children/>
</Entity>
+14
View File
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Entity xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
<Components>
<c:BoostSniper/>
<c:Lifetime>
<Lifetime>10</Lifetime>
</c:Lifetime>
<c:Transform/>
</Components>
<Children/>
</Entity>
@@ -1,9 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Entity name="HudOrigin" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
<Entity name="CapturePointHUD" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
<Components>
<c:Transform>
<Position X="-24.3529072" Y="0" Z="6.95243597"/>
<Position X="0" Y="0.190541431" Z="0"/>
<Scale X="0.0599999987" Y="0.0599999987" Z="0.0599999987"/>
</c:Transform>
</Components>
+255
View File
@@ -0,0 +1,255 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Entity name="Player" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
<Components>
<c:AABB>
<Origin X="0" Y="0.772000015" Z="0"/>
<Size X="1" Y="1.60000002" Z="1"/>
</c:AABB>
<c:AssaultWeapon>
<RPM>600</RPM>
</c:AssaultWeapon>
<c:Collidable/>
<c:DashAbility/>
<c:Health/>
<c:Physics>
<Velocity X="2.30999646e-23" Y="0" Z="1.05272533e-23"/>
</c:Physics>
<c:Player>
<MovementSpeed>5</MovementSpeed>
</c:Player>
<c:Team>
<Team>
<Red/>
</Team>
</c:Team>
<c:Transform>
<Position X="0" Y="0.0288832653" Z="2.64837074"/>
</c:Transform>
</Components>
<Children>
<Entity name="Camera">
<Components>
<c:Camera/>
<c:Transform>
<Position X="0" Y="1.27700007" Z="0"/>
</c:Transform>
</Components>
<Children>
<Entity name="PlayerName">
<Components>
<c:Text>
<Resource>Fonts/DroidSans.ttf,100</Resource>
<Color A="1" B="0" G="1" R="0"/>
</c:Text>
<c:Transform>
<Position X="0.100000001" Y="0.248000011" Z="-0.248000011"/>
<Scale X="0.100000001" Y="0.113000005" Z="0.5"/>
<Orientation X="0" Y="3.14199996" Z="0"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity name="CameraModel">
<Components>
<c:Model>
<Resource>Models/Widgets/Camera.mesh</Resource>
<Visible>false</Visible>
</c:Model>
<c:Transform>
<Position X="0" Y="0.0331346765" Z="-0.0792061687"/>
<Scale X="1.30000007" Y="1.50000012" Z="1"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity name="HUD">
<Components>
<c:Transform>
<Position X="0" Y="0" Z="-0.5"/>
</c:Transform>
</Components>
<Children>
<Entity name="HealthBar">
<Components>
<c:Fill>
<Percentage>1</Percentage>
<Color A="0" B="1" G="0" R="0"/>
</c:Fill>
<c:HealthHUD/>
<c:Model>
<Resource>Models/Core/UnitHexagon.mesh</Resource>
<Color A="1" B="0.70588237" G="0.70588237" R="0.70588237"/>
</c:Model>
<c:Transform>
<Position X="-0.383000016" Y="-0.185000002" Z="0"/>
<Scale X="0.150000006" Y="0.150000006" Z="0.150000006"/>
<Orientation X="0" Y="0.594000041" Z="0"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity name="Crosshair">
<Components>
<c:Sprite>
<DiffuseTexture>Textures/Weapons/Crosshair/SmallThickHoleDot.png</DiffuseTexture>
<DepthSort>false</DepthSort>
</c:Sprite>
<c:Transform>
<Position X="0" Y="0" Z="0.200000003"/>
<Scale X="0.0250000004" Y="0.0250000004" Z="0"/>
</c:Transform>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
<Entity name="Hands">
<Components>
<c:Animation>
<AnimationName1>Idle</AnimationName1>
<Time1>0.28963486380924053</Time1>
<Speed1>1</Speed1>
</c:Animation>
<c:Model>
<Resource>Models/Characters/Assault/FirstPerson.mesh</Resource>
<Transparent>true</Transparent>
</c:Model>
<c:Transform/>
</Components>
<Children>
<Entity name="WeaponModel">
<Components>
<c:BoneAttachment>
<BoneName>R_Arm_Weapon_Joint</BoneName>
</c:BoneAttachment>
<c:Model>
<Resource>Models/Weapons/Blue/AssaultWeaponBlue.mesh</Resource>
<Transparent>true</Transparent>
</c:Model>
<c:Transform>
<Position X="0.120430455" Y="-0.231800437" Z="-0.181454748"/>
<Orientation X="0.0104047749" Y="-0.00268166233" Z="0.042844031"/>
</c:Transform>
</Components>
<Children>
<Entity name="WeaponMuzzle">
<Components>
<c:Spawner>
<EntityFile>Schema/Entities/RayBlue.xml</EntityFile>
</c:Spawner>
<c:Transform>
<Position X="0.00325386273" Y="0.0970000029" Z="-0.843000054"/>
</c:Transform>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
<Entity name="FirstPersonReloadSpawner">
<Components>
<c:Spawner>
<EntityFile>Schema/Entities/WeaponReloadEffect.xml</EntityFile>
</c:Spawner>
<c:Transform/>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
</Children>
</Entity>
<Entity name="ThirdPersonCamera">
<Components>
<c:Camera/>
<c:Model>
<Resource>Models/Widgets/Camera.mesh</Resource>
<Visible>false</Visible>
</c:Model>
<c:Transform>
<Position X="-0.284000009" Y="1.83800006" Z="1.18900001"/>
<Orientation X="5.95600033" Y="0" Z="0"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity name="PlayerModel">
<Components>
<c:Animation>
<AnimationName1>Idle</AnimationName1>
<Time1>0.42156525436696768</Time1>
<Speed1>1</Speed1>
</c:Animation>
<c:AnimationOffset>
<AnimationName>AimRifle</AnimationName>
<Time>0.5</Time>
</c:AnimationOffset>
<c:HiddenForLocalPlayer/>
<c:Model>
<Resource>Models/Characters/Assault/AssaultAnimations.mesh</Resource>
<Color A="1" B="0" G="0" R="1"/>
</c:Model>
<c:Transform/>
</Components>
<Children>
<Entity name="ThirdPersonWeaponModel">
<Components>
<c:BoneAttachment>
<BoneName>R_Arm_Weapon_Joint</BoneName>
</c:BoneAttachment>
<c:Model>
<Resource>Models/Weapons/Blue/AssaultWeaponBlue.mesh</Resource>
<Visible>false</Visible>
</c:Model>
<c:Transform>
<Position X="0.160716802" Y="1.02800739" Z="-0.215931982"/>
<Orientation X="-0.0627654716" Y="-0.0450839326" Z="0.119217664"/>
</c:Transform>
</Components>
<Children>
<Entity name="ThirdPersonWeaponMuzzle">
<Components>
<c:Spawner>
<EntityFile>Schema/Entities/RayBlue.xml</EntityFile>
</c:Spawner>
<c:Transform>
<Position X="0.00644115033" Y="0.096679531" Z="-0.436609417"/>
</c:Transform>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
</Children>
</Entity>
<Entity name="AABBStanding">
<Components>
<c:Model>
<Resource>Models/Core/UnitCube.mesh</Resource>
<Color A="0.427450985" B="1" G="1" R="1"/>
<Visible>false</Visible>
</c:Model>
<c:Transform>
<Position X="0" Y="0.772000015" Z="0"/>
<Scale X="1" Y="1.60000002" Z="1"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity name="AABBCrouching">
<Components>
<c:Model>
<Resource>Models/Core/UnitCube.mesh</Resource>
<Color A="0.745098054" B="1" G="0" R="1"/>
<Visible>false</Visible>
</c:Model>
<c:Transform>
<Position X="0" Y="0.772000015" Z="0"/>
</c:Transform>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
File diff suppressed because it is too large Load Diff
+11 -12
View File
@@ -2,27 +2,26 @@
<Entity xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
<Components>
<c:Model>
<Resource>Models/Effects/JumpEffectHexagon.mesh</Resource>
<Color A="0.576470613" B="500" G="255" R="0.854901969"/>
<Transparent>true</Transparent>
</c:Model>
<c:Transform>
<Position X="0.600000024" Y="0.800000012" Z="0"/>
<Scale X="0.50000012" Y="0.50000019" Z="0.50000014"/>
</c:Transform>
<c:Lifetime>
<Lifetime>0.5</Lifetime>
</c:Lifetime>
<c:ExplosionEffect>
<ColorByDistance>true</ColorByDistance>
<Velocity X="0" Y="-7.76300049" Z="0"/>
<ExplosionOrigin X="0" Y="2.67900002" Z="0"/>
<Velocity X="3.60000014" Y="3.93700027" Z="0"/>
<ExponentialAccelaration>true</ExponentialAccelaration>
<ExplosionDuration>0.5</ExplosionDuration>
<EndColor A="0" B="0" G="0" R="1"/>
<EndColor A="0" B="1" G="1" R="1"/>
<Randomness>true</Randomness>
</c:ExplosionEffect>
<c:Model>
<Resource>Models/Effects/JumpEffectHexagon.mesh</Resource>
<Color A="0.545098066" B="500" G="255" R="0.854901969"/>
<Transparent>true</Transparent>
</c:Model>
<c:Transform>
<Position X="0.600000024" Y="0.800000012" Z="0"/>
<Scale X="0.500000119" Y="0.500000179" Z="0.500000119"/>
</c:Transform>
</Components>
<Children/>
+50
View File
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Entity name="HealthHUD" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
<Components>
<c:Transform/>
</Components>
<Children>
<Entity name="HealthText">
<Components>
<c:Fill>
<Percentage>1</Percentage>
<Color A="1" B="1" G="0" R="0"/>
</c:Fill>
<c:HealthHUD/>
<c:Text>
<Content>100/100</Content>
<Resource>Fonts/DroidSans.ttf,64</Resource>
<Color A="0.392156869" B="1" G="0" R="0"/>
</c:Text>
<c:Transform>
<Position X="-0.355000019" Y="-0.203000009" Z="0.0410000011"/>
<Scale X="0.0350000001" Y="0.0350000001" Z="0.0350000001"/>
<Orientation X="0" Y="0.410000026" Z="0"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity name="HealthBar">
<Components>
<c:Fill>
<Percentage>1</Percentage>
<Color A="0.196078435" B="1" G="0" R="0"/>
</c:Fill>
<c:Sprite>
<DiffuseTexture>Textures/HealthHUD3.png</DiffuseTexture>
<Color A="0.588235319" B="0" G="0" R="0"/>
</c:Sprite>
<c:HealthHUD/>
<c:Transform>
<Position X="-0.263000011" Y="-0.185000002" Z="0"/>
<Scale X="0.106000006" Y="0.333000004" Z="0.150000006"/>
<Orientation X="5.87300014" Y="0" Z="4.71200037"/>
</c:Transform>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
+6 -1
View File
@@ -5,10 +5,15 @@
<c:AABB/>
<c:HealthPickup/>
<c:Model>
<Resource>Models/Core/UnitSphere.mesh</Resource>
<Resource>Models/Props/PickUps/HealthPickUp.mesh</Resource>
</c:Model>
<c:RaptorCopter>
<Speed>0.1</Speed>
<Axis X="0" Y="1" Z="0"/>
</c:RaptorCopter>
<c:Transform>
<Position X="0" Y="1" Z="0"/>
<Scale X="0.3" Y="0.3" Z="0.3"/>
</c:Transform>
<c:Trigger/>
</Components>
+361 -42
View File
@@ -89,6 +89,7 @@
<c:Collidable/>
<c:Model>
<Resource>Models/Props/Highground5.mesh</Resource>
<Color A="1" B="7.84313726" G="7.84313726" R="7.84313726"/>
</c:Model>
<c:Transform/>
</Components>
@@ -99,6 +100,7 @@
<c:Collidable/>
<c:Model>
<Resource>Models/Props/Highground6.mesh</Resource>
<Color A="1" B="7.84313726" G="7.84313726" R="7.84313726"/>
</c:Model>
<c:Transform/>
</Components>
@@ -368,7 +370,7 @@
<Components>
<c:Collidable/>
<c:Model>
<Resource>Models/Props/Pillars/SciFiPillar2.mesh</Resource>
<Resource>Models/Props/Pillars/SciFiPillar2Blue.mesh</Resource>
</c:Model>
<c:Transform>
<Position X="55.0098839" Y="0" Z="80.7891693"/>
@@ -381,7 +383,7 @@
<Components>
<c:Collidable/>
<c:Model>
<Resource>Models/Props/Pillars/SciFiPillar2.mesh</Resource>
<Resource>Models/Props/Pillars/SciFiPillar2Red.mesh</Resource>
</c:Model>
<c:Transform>
<Position X="-57.6669235" Y="-0.0117412386" Z="-84.8278427"/>
@@ -591,7 +593,7 @@
<Resource>Models/Props/Walls/BigWallBlue.mesh</Resource>
</c:Model>
<c:Transform>
<Position X="56.3723755" Y="-0.458255291" Z="53.1675453"/>
<Position X="57.2414131" Y="-0.458255291" Z="53.1675453"/>
</c:Transform>
</Components>
<Children>
@@ -724,7 +726,7 @@
<Resource>Models/Props/Walls/BigWallBlue.mesh</Resource>
</c:Model>
<c:Transform>
<Position X="-2.87285304" Y="0" Z="0.0110195652"/>
<Position X="-3.20842171" Y="0" Z="0.0110195652"/>
<Scale X="1" Y="0.800000012" Z="1"/>
</c:Transform>
</Components>
@@ -737,7 +739,7 @@
<Resource>Models/Props/Walls/BigWallBlue.mesh</Resource>
</c:Model>
<c:Transform>
<Position X="2.9002583" Y="0" Z="-0.00627081469"/>
<Position X="3.16696811" Y="0" Z="-0.00627081469"/>
<Scale X="1" Y="0.800000012" Z="1"/>
</c:Transform>
</Components>
@@ -1289,7 +1291,7 @@
<Resource>Models/Props/Walls/BigWallBlue.mesh</Resource>
</c:Model>
<c:Transform>
<Position X="42.3930092" Y="-0.436794043" Z="53.3168259"/>
<Position X="42.6762505" Y="-0.436794043" Z="53.3168259"/>
</c:Transform>
</Components>
<Children>
@@ -1300,7 +1302,7 @@
<Resource>Models/Props/Walls/BigWallBlue.mesh</Resource>
</c:Model>
<c:Transform>
<Position X="2.79896975" Y="0" Z="0"/>
<Position X="3.02606034" Y="0" Z="0"/>
</c:Transform>
</Components>
<Children/>
@@ -1312,7 +1314,7 @@
<Resource>Models/Props/Walls/BigWallBlue.mesh</Resource>
</c:Model>
<c:Transform>
<Position X="5.67178059" Y="0" Z="0"/>
<Position X="6.20324564" Y="0" Z="0"/>
</c:Transform>
</Components>
<Children/>
@@ -1324,7 +1326,7 @@
<Resource>Models/Props/Walls/BigWallBlue.mesh</Resource>
</c:Model>
<c:Transform>
<Position X="8.55263519" Y="0" Z="0"/>
<Position X="9.40820885" Y="0" Z="0"/>
</c:Transform>
</Components>
<Children/>
@@ -1515,6 +1517,7 @@
<c:Collidable/>
<c:Model>
<Resource>Models/Props/Flora/SpecialRoot.mesh</Resource>
<Color A="1" B="1" G="7.84313726" R="7.84313726"/>
</c:Model>
<c:Transform>
<Position X="-37.5227966" Y="-0.41070056" Z="38.790432"/>
@@ -1885,7 +1888,7 @@
<Components>
<c:Collidable/>
<c:Model>
<Resource>Models/Props/Bridges/SciFiBridge.mesh</Resource>
<Resource>Models/Props/Bridges/SciFiBridge1Red.mesh</Resource>
</c:Model>
<c:Transform>
<Position X="45.3988762" Y="6.10456753" Z="-73.9011993"/>
@@ -2004,7 +2007,7 @@
<Components>
<c:Collidable/>
<c:Model>
<Resource>Models/Props/Bridges/SciFiBridge.mesh</Resource>
<Resource>Models/Props/Bridges/SciFiBridge1Blue.mesh</Resource>
</c:Model>
<c:Transform>
<Position X="-41.0066338" Y="6.08244133" Z="75.8575821"/>
@@ -2138,7 +2141,7 @@
<Components>
<c:Collidable/>
<c:Model>
<Resource>Models/Props/Bridges/SciFiBridge.mesh</Resource>
<Resource>Models/Props/Bridges/SciFiBridge1Blue.mesh</Resource>
</c:Model>
<c:Transform>
<Position X="-47.6850471" Y="7.0585866" Z="38.1646194"/>
@@ -2151,7 +2154,7 @@
<Components>
<c:Collidable/>
<c:Model>
<Resource>Models/Props/Bridges/SciFiBridge.mesh</Resource>
<Resource>Models/Props/Bridges/SciFiBridge1Blue.mesh</Resource>
</c:Model>
<c:Transform>
<Position X="-25.9571095" Y="6.43997049" Z="41.7452164"/>
@@ -2178,7 +2181,7 @@
<Components>
<c:Collidable/>
<c:Model>
<Resource>Models/Props/Bridges/SciFiBridge.mesh</Resource>
<Resource>Models/Props/Bridges/SciFiBridge1Red.mesh</Resource>
</c:Model>
<c:Transform>
<Position X="46.3167992" Y="6.36057663" Z="-37.5957794"/>
@@ -2191,7 +2194,7 @@
<Components>
<c:Collidable/>
<c:Model>
<Resource>Models/Props/Bridges/SciFiBridge.mesh</Resource>
<Resource>Models/Props/Bridges/SciFiBridge1Red.mesh</Resource>
</c:Model>
<c:Transform>
<Position X="25.2147388" Y="6.4451251" Z="-41.7257042"/>
@@ -2730,6 +2733,7 @@
<c:Collidable/>
<c:Model>
<Resource>Models/Props/Flora/SpecialRoot.mesh</Resource>
<Color A="1" B="1" G="7.84313726" R="7.84313726"/>
</c:Model>
<c:Transform>
<Position X="36.8391495" Y="0.354240507" Z="-36.1228752"/>
@@ -2948,6 +2952,7 @@
<c:Collidable/>
<c:Model>
<Resource>Models/Props/Flora/SpecialRoot.mesh</Resource>
<Color A="1" B="1" G="7.84313726" R="7.84313726"/>
</c:Model>
<c:Transform>
<Position X="-15.8430891" Y="2.84977508" Z="55.3108711"/>
@@ -3061,6 +3066,7 @@
<c:Collidable/>
<c:Model>
<Resource>Models/Props/Flora/SpecialRoot.mesh</Resource>
<Color A="1" B="1" G="7.84313726" R="7.84313726"/>
</c:Model>
<c:Transform>
<Position X="16.3593407" Y="4.03186893" Z="-54.4961166"/>
@@ -3304,6 +3310,60 @@
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:Collidable/>
<c:Model>
<Resource>Models/Props/Stones/BigStone.mesh</Resource>
</c:Model>
<c:Transform>
<Position X="2.85156512" Y="-1.23010564" Z="-1.48294902"/>
<Scale X="1.50000012" Y="1" Z="1.4000001"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:Collidable/>
<c:Model>
<Resource>Models/Props/Stones/MediumStone2.mesh</Resource>
</c:Model>
<c:Transform>
<Position X="-8.1107378" Y="1.61279738" Z="6.04347277"/>
<Scale X="2.70000005" Y="2.20000005" Z="2.4000001"/>
<Orientation X="1.02200007" Y="1.27200007" Z="0"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:Collidable/>
<c:Model>
<Resource>Models/Props/Stones/BigStone.mesh</Resource>
</c:Model>
<c:Transform>
<Position X="-12.3116245" Y="3.30153632" Z="2.33947349"/>
<Orientation X="0" Y="3.46600008" Z="0"/>
</c:Transform>
</Components>
<Children>
<Entity>
<Components>
<c:Collidable/>
<c:Model>
<Resource>Models/Props/Stones/BigStone.mesh</Resource>
</c:Model>
<c:Transform>
<Position X="2.7208035" Y="0.631672204" Z="1.97706997"/>
<Orientation X="0" Y="0" Z="5.86300039"/>
</c:Transform>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
</Children>
</Entity>
<Entity>
@@ -3313,7 +3373,7 @@
<Resource>Models/Props/Stones/BigStone.mesh</Resource>
</c:Model>
<c:Transform>
<Position X="-32.077774" Y="1.78250229" Z="-52.9675865"/>
<Position X="-32.141304" Y="1.78250229" Z="-52.9675865"/>
</c:Transform>
</Components>
<Children>
@@ -3343,6 +3403,46 @@
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:Collidable/>
<c:Model>
<Resource>Models/Props/Stones/BigStone.mesh</Resource>
</c:Model>
<c:Transform>
<Position X="13.3016024" Y="-1.04082656" Z="-2.06582665"/>
<Orientation X="0" Y="1.17200005" Z="6.28300047"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:Collidable/>
<c:Model>
<Resource>Models/Props/Stones/SmallStone1.mesh</Resource>
</c:Model>
<c:Transform>
<Position X="7.52924776" Y="0.407071143" Z="-2.09290624"/>
<Scale X="3.4000001" Y="5.70000029" Z="3.70000029"/>
<Orientation X="0" Y="1.7700001" Z="0"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:Collidable/>
<c:Model>
<Resource>Models/Props/Stones/BigStone.mesh</Resource>
</c:Model>
<c:Transform>
<Position X="-5.73053885" Y="-0.909733951" Z="4.32710028"/>
<Orientation X="0" Y="3.46600008" Z="0"/>
</c:Transform>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
<Entity>
@@ -3692,7 +3792,7 @@
<Resource>Models/Props/Stones/SmallStone1.mesh</Resource>
</c:Model>
<c:Transform>
<Position X="17.9978104" Y="0.729522109" Z="64.9478226"/>
<Position X="17.9978104" Y="0.729522109" Z="65.3742523"/>
<Scale X="3" Y="3" Z="3"/>
<Orientation X="2.68900013" Y="3.5940001" Z="0"/>
</c:Transform>
@@ -3942,7 +4042,7 @@
</c:Model>
<c:Transform>
<Position X="-40.5458374" Y="-0.729142785" Z="-45.7907982"/>
<Orientation X="4.93700027" Y="3.5" Z="1.37700009"/>
<Orientation X="4.93700027" Y="4.81200027" Z="1.37700009"/>
</c:Transform>
</Components>
<Children/>
@@ -4058,21 +4158,7 @@
<Orientation X="0" Y="1.93500006" Z="0"/>
</c:Transform>
</Components>
<Children>
<Entity>
<Components>
<c:Collidable/>
<c:Model>
<Resource>Models/Props/PickUps/HealthPickUp.mesh</Resource>
</c:Model>
<c:Transform>
<Position X="0" Y="2.53721571" Z="0"/>
<Scale X="0.800000012" Y="0.800000012" Z="0.800000012"/>
</c:Transform>
</Components>
<Children/>
</Entity>
</Children>
<Children/>
</Entity>
<Entity>
<Components>
@@ -4679,6 +4765,7 @@
<HomePointForTeam>
<Blue/>
</HomePointForTeam>
<CapturePointNumber>4</CapturePointNumber>
</c:CapturePoint>
<c:Model>
<Resource>Models/Core/UnitCylinder.mesh</Resource>
@@ -4714,7 +4801,7 @@
<Entity>
<Components>
<c:CapturePoint>
<CapturePointNumber>1</CapturePointNumber>
<CapturePointNumber>3</CapturePointNumber>
</c:CapturePoint>
<c:Model>
<Resource>Models/Core/UnitCylinder.mesh</Resource>
@@ -4779,7 +4866,7 @@
<Components>
<c:CapturePoint>
<CaptureTimer>1.5498908015879351</CaptureTimer>
<CapturePointNumber>3</CapturePointNumber>
<CapturePointNumber>1</CapturePointNumber>
</c:CapturePoint>
<c:Model>
<Resource>Models/Core/UnitCylinder.mesh</Resource>
@@ -4814,7 +4901,6 @@
<HomePointForTeam>
<Red/>
</HomePointForTeam>
<CapturePointNumber>4</CapturePointNumber>
</c:CapturePoint>
<c:Model>
<Resource>Models/Core/UnitCylinder.mesh</Resource>
@@ -4925,7 +5011,7 @@
<Components>
<c:PlayerSpawn/>
<c:Spawner>
<EntityFile>Schema/Entities/Player.xml</EntityFile>
<EntityFile>Schema/Entities/PlayerRed.xml</EntityFile>
</c:Spawner>
<c:Team>
<Team>
@@ -4933,7 +5019,7 @@
</Team>
</c:Team>
<c:Transform>
<Position X="0" Y="6.69097853" Z="0"/>
<Position X="-60.3695679" Y="5.14500046" Z="-79.3789597"/>
</c:Transform>
</Components>
<Children>
@@ -4942,9 +5028,10 @@
<c:SpawnPoint/>
<c:Model>
<Resource>Models/Characters/Assault/AssaultTPose.mesh</Resource>
<Visible>false</Visible>
</c:Model>
<c:Transform>
<Position X="1" Y="0" Z="0"/>
<Position X="9.3347702" Y="2.70210314" Z="2.33294678"/>
</c:Transform>
</Components>
<Children/>
@@ -4954,9 +5041,10 @@
<c:SpawnPoint/>
<c:Model>
<Resource>Models/Characters/Assault/AssaultTPose.mesh</Resource>
<Visible>false</Visible>
</c:Model>
<c:Transform>
<Position X="-1" Y="0" Z="0"/>
<Position X="5.59104443" Y="2.14147282" Z="6.07936668"/>
</c:Transform>
</Components>
<Children/>
@@ -4966,9 +5054,10 @@
<c:SpawnPoint/>
<c:Model>
<Resource>Models/Characters/Assault/AssaultTPose.mesh</Resource>
<Visible>false</Visible>
</c:Model>
<c:Transform>
<Position X="0" Y="0" Z="1"/>
<Position X="-2.2788806" Y="0" Z="3.17202592"/>
</c:Transform>
</Components>
<Children/>
@@ -4978,15 +5067,245 @@
<c:SpawnPoint/>
<c:Model>
<Resource>Models/Characters/Assault/AssaultTPose.mesh</Resource>
<Visible>false</Visible>
</c:Model>
<c:Transform>
<Position X="0" Y="0" Z="-1"/>
<Position X="1.14053249" Y="0" Z="-1.67306876"/>
</c:Transform>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
<Entity name="SpawnerBlueTeam">
<Components>
<c:PlayerSpawn/>
<c:Spawner>
<EntityFile>Schema/Entities/Player.xml</EntityFile>
</c:Spawner>
<c:Team>
<Team>
<Blue/>
</Team>
</c:Team>
<c:Transform>
<Position X="60.0169258" Y="6.0800004" Z="76.2893906"/>
</c:Transform>
</Components>
<Children>
<Entity name="SpawnPointRedTeam">
<Components>
<c:SpawnPoint/>
<c:Model>
<Resource>Models/Characters/Assault/AssaultTPose.mesh</Resource>
<Visible>false</Visible>
</c:Model>
<c:Transform>
<Position X="2.02889442" Y="0.194165871" Z="-1.17950201"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity name="SpawnPointRedTeam">
<Components>
<c:SpawnPoint/>
<c:Model>
<Resource>Models/Characters/Assault/AssaultTPose.mesh</Resource>
<Visible>false</Visible>
</c:Model>
<c:Transform>
<Position X="-9.04242706" Y="1.82531989" Z="-0.421615779"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity name="SpawnPointRedTeam">
<Components>
<c:SpawnPoint/>
<c:Model>
<Resource>Models/Characters/Assault/AssaultTPose.mesh</Resource>
<Visible>false</Visible>
</c:Model>
<c:Transform>
<Position X="1.64179754" Y="0.634559035" Z="4.27690458"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity name="SpawnPointRedTeam">
<Components>
<c:SpawnPoint/>
<c:Model>
<Resource>Models/Characters/Assault/AssaultTPose.mesh</Resource>
<Visible>false</Visible>
</c:Model>
<c:Transform>
<Position X="-6.58577824" Y="1.97348273" Z="-2.86768818"/>
</c:Transform>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
<Entity name="HealthPickups">
<Components>
<c:Transform/>
</Components>
<Children>
<Entity>
<Components>
<c:HealthPickup/>
<c:Model>
<Resource>Models/Props/PickUps/HealthPickUp.mesh</Resource>
</c:Model>
<c:RaptorCopter>
<Speed>0.10000000149011612</Speed>
<Axis X="0" Y="1" Z="0"/>
</c:RaptorCopter>
<c:Transform>
<Position X="48.9189453" Y="7.06223536" Z="-78.9347992"/>
<Scale X="0.300000012" Y="0.300000012" Z="0.300000012"/>
<Orientation X="0" Y="74.6042328" Z="0"/>
</c:Transform>
<c:Trigger/>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:AmmoPickup/>
<c:Model>
<Resource>Models/Props/PickUps/AmmoPickUp.mesh</Resource>
</c:Model>
<c:RaptorCopter>
<Speed>0.10000000149011612</Speed>
<Axis X="0" Y="1" Z="0"/>
</c:RaptorCopter>
<c:Transform>
<Position X="-59.3499641" Y="7.46932745" Z="-20.6276321"/>
<Scale X="0.300000012" Y="0.300000012" Z="0.300000012"/>
<Orientation X="0" Y="71.2585754" Z="0"/>
</c:Transform>
<c:Trigger/>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:HealthPickup/>
<c:Model>
<Resource>Models/Props/PickUps/HealthPickUp.mesh</Resource>
</c:Model>
<c:RaptorCopter>
<Speed>0.10000000149011612</Speed>
<Axis X="0" Y="1" Z="0"/>
</c:RaptorCopter>
<c:Transform>
<Position X="-1.13644195" Y="1.38919806" Z="38.9768829"/>
<Scale X="0.300000012" Y="0.300000012" Z="0.300000012"/>
<Orientation X="0" Y="68.8666077" Z="0"/>
</c:Transform>
<c:Trigger/>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:HealthPickup/>
<c:Model>
<Resource>Models/Props/PickUps/HealthPickUp.mesh</Resource>
</c:Model>
<c:RaptorCopter>
<Speed>0.10000000149011612</Speed>
<Axis X="0" Y="1" Z="0"/>
</c:RaptorCopter>
<c:Transform>
<Position X="54.7225227" Y="6.51863909" Z="29.0052128"/>
<Scale X="0.300000012" Y="0.300000012" Z="0.300000012"/>
<Orientation X="0" Y="69.180542" Z="0"/>
</c:Transform>
<c:Trigger/>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:AmmoPickup/>
<c:Model>
<Resource>Models/Props/PickUps/AmmoPickUp.mesh</Resource>
</c:Model>
<c:RaptorCopter>
<Speed>0.10000000149011612</Speed>
<Axis X="0" Y="1" Z="0"/>
</c:RaptorCopter>
<c:Transform>
<Position X="-51.6792374" Y="8.44526482" Z="32.5153465"/>
<Scale X="0.300000012" Y="0.300000012" Z="0.300000012"/>
<Orientation X="0" Y="68.6292572" Z="0"/>
</c:Transform>
<c:Trigger/>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:HealthPickup/>
<c:Model>
<Resource>Models/Props/PickUps/HealthPickUp.mesh</Resource>
</c:Model>
<c:RaptorCopter>
<Speed>0.10000000149011612</Speed>
<Axis X="0" Y="1" Z="0"/>
</c:RaptorCopter>
<c:Transform>
<Position X="-42.3974304" Y="7.28327894" Z="81.9305344"/>
<Scale X="0.300000012" Y="0.300000012" Z="0.300000012"/>
<Orientation X="0" Y="66.7584839" Z="0"/>
</c:Transform>
<c:Trigger/>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:AmmoPickup/>
<c:Model>
<Resource>Models/Props/PickUps/AmmoPickUp.mesh</Resource>
</c:Model>
<c:RaptorCopter>
<Speed>0.10000000149011612</Speed>
<Axis X="0" Y="1" Z="0"/>
</c:RaptorCopter>
<c:Transform>
<Position X="-9.85184956" Y="8.25567532" Z="39.6119232"/>
<Scale X="0.300000012" Y="0.300000012" Z="0.300000012"/>
<Orientation X="0" Y="65.8073425" Z="0"/>
</c:Transform>
<c:Trigger/>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:AmmoPickup/>
<c:Model>
<Resource>Models/Props/PickUps/AmmoPickUp.mesh</Resource>
</c:Model>
<c:RaptorCopter>
<Speed>0.10000000149011612</Speed>
<Axis X="0" Y="1" Z="0"/>
</c:RaptorCopter>
<c:Transform>
<Position X="49.2257118" Y="7.39368248" Z="-31.1810112"/>
<Scale X="0.300000012" Y="0.300000012" Z="0.300000012"/>
<Orientation X="0" Y="63.0184822" Z="0"/>
</c:Transform>
<c:Trigger/>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
</Children>
</Entity>
+365 -52
View File
@@ -23,9 +23,7 @@
<Blue/>
</Team>
</c:Team>
<c:Transform>
<Position X="0" Y="0.0288832653" Z="2.64837074"/>
</c:Transform>
<c:Transform/>
</Components>
<Children>
@@ -37,20 +35,6 @@
</c:Transform>
</Components>
<Children>
<Entity name="PlayerName">
<Components>
<c:Text>
<Resource>Fonts/DroidSans.ttf,100</Resource>
<Color A="1" B="0" G="1" R="0"/>
</c:Text>
<c:Transform>
<Position X="0.100000001" Y="0.248000011" Z="-0.248000011"/>
<Scale X="0.100000001" Y="0.113000005" Z="0.5"/>
<Orientation X="0" Y="3.14199996" Z="0"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity name="CameraModel">
<Components>
<c:Model>
@@ -71,25 +55,6 @@
</c:Transform>
</Components>
<Children>
<Entity name="HealthBar">
<Components>
<c:Fill>
<Percentage>1</Percentage>
<Color A="0" B="1" G="0" R="0"/>
</c:Fill>
<c:HealthHUD/>
<c:Model>
<Resource>Models/Core/UnitHexagon.mesh</Resource>
<Color A="1" B="0.70588237" G="0.70588237" R="0.70588237"/>
</c:Model>
<c:Transform>
<Position X="-0.383000016" Y="-0.185000002" Z="0"/>
<Scale X="0.150000006" Y="0.150000006" Z="0.150000006"/>
<Orientation X="0" Y="0.594000041" Z="0"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity name="Crosshair">
<Components>
<c:Sprite>
@@ -112,17 +77,284 @@
</Components>
<Children/>
</Entity>
<Entity name="HealthHUD">
<Components>
<c:Transform/>
</Components>
<Children>
<Entity name="HealthText">
<Components>
<c:Fill>
<Percentage>1</Percentage>
<Color A="1" B="1" G="0" R="0"/>
</c:Fill>
<c:HealthHUD/>
<c:Text>
<Content>100/100</Content>
<Resource>Fonts/DroidSans.ttf,64</Resource>
<Color A="0.505882382" B="3.92156863" G="1.17647064" R="0"/>
</c:Text>
<c:Transform>
<Position X="-0.355000019" Y="-0.203000009" Z="0.0410000011"/>
<Scale X="0.0350000001" Y="0.0350000001" Z="0.0350000001"/>
<Orientation X="0" Y="0.410000026" Z="0"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity name="HealthBar">
<Components>
<c:Fill>
<Percentage>1</Percentage>
<Color A="0.301960796" B="1" G="0" R="0"/>
</c:Fill>
<c:Sprite>
<DiffuseTexture>Textures/HealthHUD3.png</DiffuseTexture>
<Color A="0.588235319" B="0" G="0" R="0"/>
</c:Sprite>
<c:HealthHUD/>
<c:Transform>
<Position X="-0.263000011" Y="-0.185000002" Z="0"/>
<Scale X="0.106000006" Y="0.333000004" Z="0.150000006"/>
<Orientation X="5.87300014" Y="0" Z="4.71200037"/>
</c:Transform>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
<Entity name="CapturePointHUD">
<Components>
<c:Transform>
<Position X="0" Y="0.190541431" Z="0"/>
<Scale X="0.0599999987" Y="0.0599999987" Z="0.0599999987"/>
</c:Transform>
</Components>
<Children>
<Entity name="BackgroundHexagon">
<Components>
<c:Sprite>
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
<Color A="0.300000012" B="1" G="1" R="1"/>
</c:Sprite>
<c:Transform>
<Position X="0" Y="0.919596612" Z="0"/>
</c:Transform>
</Components>
<Children>
<Entity name="ProgressionHexagon">
<Components>
<c:CapturePointHUD>
<CapturePointNumber>2</CapturePointNumber>
</c:CapturePointHUD>
<c:Fill>
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
</c:Fill>
<c:Sprite>
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
</c:Sprite>
<c:Transform>
<Position X="0" Y="0" Z="0.00999999978"/>
<Scale X="0.800000012" Y="0.800000012" Z="0.800000012"/>
<Orientation X="0" Y="0" Z="1.57079637"/>
</c:Transform>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
<Entity name="BackgroundHexagon">
<Components>
<c:Sprite>
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
<Color A="0.300000012" B="1" G="1" R="1"/>
</c:Sprite>
<c:Transform>
<Position X="0.811270177" Y="0.440691769" Z="-0.100000001"/>
</c:Transform>
</Components>
<Children>
<Entity name="ProgressionHexagon">
<Components>
<c:CapturePointHUD>
<CapturePointNumber>3</CapturePointNumber>
</c:CapturePointHUD>
<c:Fill>
<Percentage>0.80222018197612788</Percentage>
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
</c:Fill>
<c:Sprite>
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
</c:Sprite>
<c:Transform>
<Position X="0" Y="0" Z="0.00999999978"/>
<Scale X="0.800000012" Y="0.800000012" Z="0.800000012"/>
<Orientation X="0" Y="0" Z="1.57079637"/>
</c:Transform>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
<Entity name="BackgroundHexagon">
<Components>
<c:Sprite>
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
</c:Sprite>
<c:Transform>
<Position X="1.62788737" Y="0.919596612" Z="0"/>
</c:Transform>
</Components>
<Children>
<Entity name="ProgressionHexagon">
<Components>
<c:CapturePointHUD>
<CapturePointNumber>4</CapturePointNumber>
</c:CapturePointHUD>
<c:Fill>
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
</c:Fill>
<c:Sprite>
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
</c:Sprite>
<c:Transform>
<Position X="0" Y="0" Z="0.00999999978"/>
<Scale X="0.800000012" Y="0.800000012" Z="0.800000012"/>
<Orientation X="0" Y="0" Z="1.57079637"/>
</c:Transform>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
<Entity name="BackgroundHexagon">
<Components>
<c:Sprite>
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
<Color A="0.300000012" B="1" G="1" R="1"/>
</c:Sprite>
<c:Transform>
<Position X="-0.820431828" Y="0.441878349" Z="-0.100000001"/>
</c:Transform>
</Components>
<Children>
<Entity name="ProgressionHexagon">
<Components>
<c:CapturePointHUD>
<CapturePointNumber>1</CapturePointNumber>
</c:CapturePointHUD>
<c:Fill>
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
</c:Fill>
<c:Sprite>
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
</c:Sprite>
<c:Transform>
<Position X="0" Y="0" Z="0.00999999978"/>
<Scale X="0.800000012" Y="0.800000012" Z="0.800000012"/>
<Orientation X="0" Y="0" Z="1.57079637"/>
</c:Transform>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
<Entity name="BackgroundHexagon">
<Components>
<c:Sprite>
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
<Color A="0.699999988" B="0" G="0.200000003" R="1"/>
</c:Sprite>
<c:Transform>
<Position X="-1.58304751" Y="0.919596612" Z="0"/>
</c:Transform>
</Components>
<Children>
<Entity name="ProgressionHexagon">
<Components>
<c:CapturePointHUD/>
<c:Fill>
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
</c:Fill>
<c:Sprite>
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
</c:Sprite>
<c:Transform>
<Position X="0" Y="0" Z="0.00999999978"/>
<Scale X="0.800000012" Y="0.800000012" Z="0.800000012"/>
<Orientation X="0" Y="0" Z="1.57079637"/>
</c:Transform>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
</Children>
</Entity>
<Entity name="KillFeed">
<Components>
<c:KillFeed/>
<c:Transform>
<Position X="0.486000031" Y="0.26000002" Z="0"/>
<Scale X="0.0149999997" Y="0.0149999997" Z="0.0149999997"/>
</c:Transform>
</Components>
<Children>
<Entity name="KillFeed1">
<Components>
<c:Text>
<Resource>Fonts/DroidSans.ttf,64</Resource>
<Alignment>
<Right/>
</Alignment>
</c:Text>
<c:Transform/>
</Components>
<Children/>
</Entity>
<Entity name="KillFeed2">
<Components>
<c:Text>
<Resource>Fonts/DroidSans.ttf,64</Resource>
<Alignment>
<Right/>
</Alignment>
</c:Text>
<c:Transform>
<Position X="0" Y="-1" Z="0"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity name="KillFeed3">
<Components>
<c:Text>
<Resource>Fonts/DroidSans.ttf,64</Resource>
<Alignment>
<Right/>
</Alignment>
</c:Text>
<c:Transform>
<Position X="0" Y="-2" Z="0"/>
</c:Transform>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
</Children>
</Entity>
<Entity name="Hands">
<Components>
<c:Animation>
<AnimationName1>Idle</AnimationName1>
<Time1>0.1719161089749548</Time1>
<Time1>1.6050530664521858</Time1>
<Speed1>1</Speed1>
</c:Animation>
<c:Model>
<Resource>Models/Characters/Assault/FirstPerson.mesh</Resource>
<Color A="1" B="1" G="0.309803933" R="0"/>
<Transparent>true</Transparent>
</c:Model>
<c:Transform/>
@@ -138,8 +370,8 @@
<Transparent>true</Transparent>
</c:Model>
<c:Transform>
<Position X="0.120747983" Y="-0.228997007" Z="-0.151475653"/>
<Orientation X="0.0104046585" Y="-0.00268164417" Z="0.0428441912"/>
<Position X="0.12043035" Y="-0.234149337" Z="-0.181454644"/>
<Orientation X="0.0104045281" Y="-0.00268131681" Z="0.0428438708"/>
</c:Transform>
</Components>
<Children>
@@ -154,17 +386,75 @@
</Components>
<Children/>
</Entity>
<Entity name="FirstPersonReloadSpawner">
<Components>
<c:Spawner>
<EntityFile>Schema/Entities/ReloadEffectView.xml</EntityFile>
</c:Spawner>
<c:Transform/>
</Components>
<Children/>
</Entity>
<Entity name="AmmunitionHUD">
<Components>
<c:AmmunitionHUD/>
<c:Transform>
<Position X="-0.0430000015" Y="0.131501317" Z="-0.0670000017"/>
<Scale X="0.400000006" Y="0.400000006" Z="0.400000006"/>
</c:Transform>
</Components>
<Children>
<Entity name="AmmunitionHUDBackground">
<Components>
<c:Sprite>
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
<Color A="0.588235319" B="0" G="0" R="0"/>
</c:Sprite>
<c:Transform>
<Position X="0" Y="0" Z="-0.00200000009"/>
<Scale X="0.119999997" Y="0.119999997" Z="0.119999997"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity name="AmmunitionText">
<Components>
<c:Transform/>
</Components>
<Children>
<Entity name="MagazineAmmo">
<Components>
<c:Text>
<Content>32</Content>
<Resource>Fonts/DroidSans.ttf,64</Resource>
<Color A="1" B="3.92156863" G="1.17647064" R="0"/>
</c:Text>
<c:Transform>
<Scale X="0.0599999987" Y="0.0599999987" Z="0.0599999987"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity name="Ammo">
<Components>
<c:Text>
<Content>360</Content>
<Resource>Fonts/DroidSans.ttf,64</Resource>
<Color A="1" B="3.92156863" G="1.17647064" R="0"/>
</c:Text>
<c:Transform>
<Position X="5.2833886e-05" Y="-0.0407950208" Z="0"/>
<Scale X="0.0399999991" Y="0.0399999991" Z="0.0399999991"/>
</c:Transform>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
</Children>
</Entity>
</Children>
</Entity>
<Entity name="FirstPersonReloadSpawner">
<Components>
<c:Spawner>
<EntityFile>Schema/Entities/WeaponReloadEffect.xml</EntityFile>
</c:Spawner>
<c:Transform/>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
</Children>
@@ -187,7 +477,7 @@
<Components>
<c:Animation>
<AnimationName1>Idle</AnimationName1>
<Time1>1.8038469763698401</Time1>
<Time1>1.620305457513453</Time1>
<Speed1>1</Speed1>
</c:Animation>
<c:AnimationOffset>
@@ -209,11 +499,10 @@
</c:BoneAttachment>
<c:Model>
<Resource>Models/Weapons/Blue/AssaultWeaponBlue.mesh</Resource>
<Visible>false</Visible>
</c:Model>
<c:Transform>
<Position X="0.15859656" Y="1.02875519" Z="-0.21540691"/>
<Orientation X="-0.0626692101" Y="-0.0361935496" Z="0.120095037"/>
<Position X="0.160351232" Y="1.02591991" Z="-0.215102971"/>
<Orientation X="-0.0627480298" Y="-0.0432248674" Z="0.119431816"/>
</c:Transform>
</Components>
<Children>
@@ -228,6 +517,15 @@
</Components>
<Children/>
</Entity>
<Entity name="ThirdPersonReloadSpawner">
<Components>
<c:Spawner>
<EntityFile>Schema/Entities/ReloadEffectWorld.xml</EntityFile>
</c:Spawner>
<c:Transform/>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
</Children>
@@ -259,6 +557,21 @@
</Components>
<Children/>
</Entity>
<Entity name="PlayerName">
<Components>
<c:Text>
<Content>Insert name here</Content>
<Resource>Fonts/DroidSans.ttf,100</Resource>
<Color A="1" B="0" G="1" R="0"/>
</c:Text>
<c:Transform>
<Position X="0.100000001" Y="1.50176644" Z="-0.248000011"/>
<Scale X="0.100000001" Y="0.113000005" Z="0.5"/>
<Orientation X="0" Y="3.14199996" Z="0"/>
</c:Transform>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
@@ -2,9 +2,7 @@
<Entity name="Explosion" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
<Components>
<c:Animation>
<Name>Hold Pos</Name>
</c:Animation>
<c:Animation/>
<c:Lifetime>
<Lifetime>2.5</Lifetime>
</c:Lifetime>
+577
View File
@@ -0,0 +1,577 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Entity name="Player" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
<Components>
<c:AABB>
<Origin X="0" Y="0.772000015" Z="0"/>
<Size X="1" Y="1.60000002" Z="1"/>
</c:AABB>
<c:AssaultWeapon>
<RPM>600</RPM>
</c:AssaultWeapon>
<c:Collidable/>
<c:DashAbility/>
<c:Health/>
<c:Physics>
<Velocity X="2.30999646e-23" Y="0" Z="1.05272533e-23"/>
</c:Physics>
<c:Player>
<MovementSpeed>5</MovementSpeed>
</c:Player>
<c:Team>
<Team>
<Red/>
</Team>
</c:Team>
<c:Transform/>
</Components>
<Children>
<Entity name="Camera">
<Components>
<c:Camera/>
<c:Transform>
<Position X="0" Y="1.27700007" Z="0"/>
</c:Transform>
</Components>
<Children>
<Entity name="CameraModel">
<Components>
<c:Model>
<Resource>Models/Widgets/Camera.mesh</Resource>
<Visible>false</Visible>
</c:Model>
<c:Transform>
<Position X="0" Y="0.0331346765" Z="-0.0792061687"/>
<Scale X="1.30000007" Y="1.50000012" Z="1"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity name="HUD">
<Components>
<c:Transform>
<Position X="0" Y="0" Z="-0.5"/>
</c:Transform>
</Components>
<Children>
<Entity name="Crosshair">
<Components>
<c:Sprite>
<DiffuseTexture>Textures/Weapons/Crosshair/SmallThickHoleDot.png</DiffuseTexture>
<DepthSort>false</DepthSort>
</c:Sprite>
<c:Transform>
<Position X="0" Y="0" Z="0.200000003"/>
<Scale X="0.0250000004" Y="0.0250000004" Z="0"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity name="HitMarkerSpawner">
<Components>
<c:Spawner>
<EntityFile>Schema/Entities/HitMarker.xml</EntityFile>
</c:Spawner>
<c:Transform/>
</Components>
<Children/>
</Entity>
<Entity name="HealthHUD">
<Components>
<c:Transform/>
</Components>
<Children>
<Entity name="HealthText">
<Components>
<c:Fill>
<Percentage>1</Percentage>
<Color A="1" B="1" G="0" R="0"/>
</c:Fill>
<c:HealthHUD/>
<c:Text>
<Content>100/100</Content>
<Resource>Fonts/DroidSans.ttf,64</Resource>
<Color A="0.505882382" B="3.92156863" G="1.17647064" R="0"/>
</c:Text>
<c:Transform>
<Position X="-0.355000019" Y="-0.203000009" Z="0.0410000011"/>
<Scale X="0.0350000001" Y="0.0350000001" Z="0.0350000001"/>
<Orientation X="0" Y="0.410000026" Z="0"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity name="HealthBar">
<Components>
<c:Fill>
<Percentage>1</Percentage>
<Color A="0.301960796" B="1" G="0" R="0"/>
</c:Fill>
<c:Sprite>
<DiffuseTexture>Textures/HealthHUD3.png</DiffuseTexture>
<Color A="0.588235319" B="0" G="0" R="0"/>
</c:Sprite>
<c:HealthHUD/>
<c:Transform>
<Position X="-0.263000011" Y="-0.185000002" Z="0"/>
<Scale X="0.106000006" Y="0.333000004" Z="0.150000006"/>
<Orientation X="5.87300014" Y="0" Z="4.71200037"/>
</c:Transform>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
<Entity name="CapturePointHUD">
<Components>
<c:Transform>
<Position X="0" Y="0.190541431" Z="0"/>
<Scale X="0.0599999987" Y="0.0599999987" Z="0.0599999987"/>
</c:Transform>
</Components>
<Children>
<Entity name="BackgroundHexagon">
<Components>
<c:Sprite>
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
<Color A="0.300000012" B="1" G="1" R="1"/>
</c:Sprite>
<c:Transform>
<Position X="0" Y="0.919596612" Z="0"/>
</c:Transform>
</Components>
<Children>
<Entity name="ProgressionHexagon">
<Components>
<c:CapturePointHUD>
<CapturePointNumber>2</CapturePointNumber>
</c:CapturePointHUD>
<c:Fill>
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
</c:Fill>
<c:Sprite>
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
</c:Sprite>
<c:Transform>
<Position X="0" Y="0" Z="0.00999999978"/>
<Scale X="0.800000012" Y="0.800000012" Z="0.800000012"/>
<Orientation X="0" Y="0" Z="1.57079637"/>
</c:Transform>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
<Entity name="BackgroundHexagon">
<Components>
<c:Sprite>
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
<Color A="0.300000012" B="1" G="1" R="1"/>
</c:Sprite>
<c:Transform>
<Position X="0.811270177" Y="0.440691769" Z="-0.100000001"/>
</c:Transform>
</Components>
<Children>
<Entity name="ProgressionHexagon">
<Components>
<c:CapturePointHUD>
<CapturePointNumber>3</CapturePointNumber>
</c:CapturePointHUD>
<c:Fill>
<Percentage>0.80222018197612788</Percentage>
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
</c:Fill>
<c:Sprite>
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
</c:Sprite>
<c:Transform>
<Position X="0" Y="0" Z="0.00999999978"/>
<Scale X="0.800000012" Y="0.800000012" Z="0.800000012"/>
<Orientation X="0" Y="0" Z="1.57079637"/>
</c:Transform>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
<Entity name="BackgroundHexagon">
<Components>
<c:Sprite>
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
</c:Sprite>
<c:Transform>
<Position X="1.62788737" Y="0.919596612" Z="0"/>
</c:Transform>
</Components>
<Children>
<Entity name="ProgressionHexagon">
<Components>
<c:CapturePointHUD>
<CapturePointNumber>4</CapturePointNumber>
</c:CapturePointHUD>
<c:Fill>
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
</c:Fill>
<c:Sprite>
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
</c:Sprite>
<c:Transform>
<Position X="0" Y="0" Z="0.00999999978"/>
<Scale X="0.800000012" Y="0.800000012" Z="0.800000012"/>
<Orientation X="0" Y="0" Z="1.57079637"/>
</c:Transform>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
<Entity name="BackgroundHexagon">
<Components>
<c:Sprite>
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
<Color A="0.300000012" B="1" G="1" R="1"/>
</c:Sprite>
<c:Transform>
<Position X="-0.820431828" Y="0.441878349" Z="-0.100000001"/>
</c:Transform>
</Components>
<Children>
<Entity name="ProgressionHexagon">
<Components>
<c:CapturePointHUD>
<CapturePointNumber>1</CapturePointNumber>
</c:CapturePointHUD>
<c:Fill>
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
</c:Fill>
<c:Sprite>
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
</c:Sprite>
<c:Transform>
<Position X="0" Y="0" Z="0.00999999978"/>
<Scale X="0.800000012" Y="0.800000012" Z="0.800000012"/>
<Orientation X="0" Y="0" Z="1.57079637"/>
</c:Transform>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
<Entity name="BackgroundHexagon">
<Components>
<c:Sprite>
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
<Color A="0.699999988" B="0" G="0.200000003" R="1"/>
</c:Sprite>
<c:Transform>
<Position X="-1.58304751" Y="0.919596612" Z="0"/>
</c:Transform>
</Components>
<Children>
<Entity name="ProgressionHexagon">
<Components>
<c:CapturePointHUD/>
<c:Fill>
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
</c:Fill>
<c:Sprite>
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
</c:Sprite>
<c:Transform>
<Position X="0" Y="0" Z="0.00999999978"/>
<Scale X="0.800000012" Y="0.800000012" Z="0.800000012"/>
<Orientation X="0" Y="0" Z="1.57079637"/>
</c:Transform>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
</Children>
</Entity>
<Entity name="KillFeed">
<Components>
<c:KillFeed/>
<c:Transform>
<Position X="0.486000031" Y="0.26000002" Z="0"/>
<Scale X="0.0149999997" Y="0.0149999997" Z="0.0149999997"/>
</c:Transform>
</Components>
<Children>
<Entity name="KillFeed1">
<Components>
<c:Text>
<Resource>Fonts/DroidSans.ttf,64</Resource>
<Alignment>
<Right/>
</Alignment>
</c:Text>
<c:Transform/>
</Components>
<Children/>
</Entity>
<Entity name="KillFeed2">
<Components>
<c:Text>
<Resource>Fonts/DroidSans.ttf,64</Resource>
<Alignment>
<Right/>
</Alignment>
</c:Text>
<c:Transform>
<Position X="0" Y="-1" Z="0"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity name="KillFeed3">
<Components>
<c:Text>
<Resource>Fonts/DroidSans.ttf,64</Resource>
<Alignment>
<Right/>
</Alignment>
</c:Text>
<c:Transform>
<Position X="0" Y="-2" Z="0"/>
</c:Transform>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
</Children>
</Entity>
<Entity name="Hands">
<Components>
<c:Animation>
<AnimationName1>Idle</AnimationName1>
<Time1>1.6050530664521858</Time1>
<Speed1>1</Speed1>
</c:Animation>
<c:Model>
<Resource>Models/Characters/Assault/FirstPerson.mesh</Resource>
<Color A="1" B="0" G="0" R="1"/>
<Transparent>true</Transparent>
</c:Model>
<c:Transform/>
</Components>
<Children>
<Entity name="WeaponModel">
<Components>
<c:BoneAttachment>
<BoneName>R_Arm_Weapon_Joint</BoneName>
</c:BoneAttachment>
<c:Model>
<Resource>Models/Weapons/Red/AssaultWeaponRed.mesh</Resource>
<Transparent>true</Transparent>
</c:Model>
<c:Transform>
<Position X="0.12043035" Y="-0.234149337" Z="-0.181454644"/>
<Orientation X="0.0104045281" Y="-0.00268131681" Z="0.0428438708"/>
</c:Transform>
</Components>
<Children>
<Entity name="WeaponMuzzle">
<Components>
<c:Spawner>
<EntityFile>Schema/Entities/RayRed.xml</EntityFile>
</c:Spawner>
<c:Transform>
<Position X="0.00325386273" Y="0.0970000029" Z="-0.843000054"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity name="FirstPersonReloadSpawner">
<Components>
<c:Spawner>
<EntityFile>Schema/Entities/ReloadEffectViewRed.xml</EntityFile>
</c:Spawner>
<c:Transform/>
</Components>
<Children/>
</Entity>
<Entity name="AmmunitionHUD">
<Components>
<c:AmmunitionHUD/>
<c:Transform>
<Position X="-0.0430000015" Y="0.131501317" Z="-0.0670000017"/>
<Scale X="0.400000006" Y="0.400000006" Z="0.400000006"/>
</c:Transform>
</Components>
<Children>
<Entity name="AmmunitionHUDBackground">
<Components>
<c:Sprite>
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
<Color A="0.588235319" B="0" G="0" R="0"/>
</c:Sprite>
<c:Transform>
<Position X="0" Y="0" Z="-0.00200000009"/>
<Scale X="0.119999997" Y="0.119999997" Z="0.119999997"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity name="AmmunitionText">
<Components>
<c:Transform/>
</Components>
<Children>
<Entity name="MagazineAmmo">
<Components>
<c:Text>
<Content>32</Content>
<Resource>Fonts/DroidSans.ttf,64</Resource>
<Color A="1" B="3.92156863" G="1.17647064" R="0"/>
</c:Text>
<c:Transform>
<Scale X="0.0599999987" Y="0.0599999987" Z="0.0599999987"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity name="Ammo">
<Components>
<c:Text>
<Content>360</Content>
<Resource>Fonts/DroidSans.ttf,64</Resource>
<Color A="1" B="3.92156863" G="1.17647064" R="0"/>
</c:Text>
<c:Transform>
<Position X="5.2833886e-05" Y="-0.0407950208" Z="0"/>
<Scale X="0.0399999991" Y="0.0399999991" Z="0.0399999991"/>
</c:Transform>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
</Children>
</Entity>
</Children>
</Entity>
</Children>
</Entity>
</Children>
</Entity>
<Entity name="ThirdPersonCamera">
<Components>
<c:Camera/>
<c:Model>
<Resource>Models/Widgets/Camera.mesh</Resource>
<Visible>false</Visible>
</c:Model>
<c:Transform>
<Position X="-0.284000009" Y="1.83800006" Z="1.18900001"/>
<Orientation X="5.95600033" Y="0" Z="0"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity name="PlayerModel">
<Components>
<c:Animation>
<AnimationName1>Idle</AnimationName1>
<Time1>1.620305457513453</Time1>
<Speed1>1</Speed1>
</c:Animation>
<c:AnimationOffset>
<AnimationName>AimRifle</AnimationName>
<Time>0.5</Time>
</c:AnimationOffset>
<c:HiddenForLocalPlayer/>
<c:Model>
<Resource>Models/Characters/Assault/AssaultAnimations.mesh</Resource>
<Color A="1" B="0" G="0" R="1"/>
</c:Model>
<c:Transform/>
</Components>
<Children>
<Entity name="ThirdPersonWeaponModel">
<Components>
<c:BoneAttachment>
<BoneName>R_Arm_Weapon_Joint</BoneName>
</c:BoneAttachment>
<c:Model>
<Resource>Models/Weapons/Red/AssaultWeaponRed.mesh</Resource>
</c:Model>
<c:Transform>
<Position X="0.160351232" Y="1.02591991" Z="-0.215102971"/>
<Orientation X="-0.0627480298" Y="-0.0432248674" Z="0.119431816"/>
</c:Transform>
</Components>
<Children>
<Entity name="ThirdPersonWeaponMuzzle">
<Components>
<c:Spawner>
<EntityFile>Schema/Entities/RayRed.xml</EntityFile>
</c:Spawner>
<c:Transform>
<Position X="0.00644115033" Y="0.096679531" Z="-0.436609417"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity name="ThirdPersonReloadSpawner">
<Components>
<c:Spawner>
<EntityFile>Schema/Entities/ReloadEffectWorldRed.xml</EntityFile>
</c:Spawner>
<c:Transform/>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
</Children>
</Entity>
<Entity name="AABBStanding">
<Components>
<c:Model>
<Resource>Models/Core/UnitCube.mesh</Resource>
<Color A="0.427450985" B="1" G="1" R="1"/>
<Visible>false</Visible>
</c:Model>
<c:Transform>
<Position X="0" Y="0.772000015" Z="0"/>
<Scale X="1" Y="1.60000002" Z="1"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity name="AABBCrouching">
<Components>
<c:Model>
<Resource>Models/Core/UnitCube.mesh</Resource>
<Color A="0.745098054" B="1" G="0" R="1"/>
<Visible>false</Visible>
</c:Model>
<c:Transform>
<Position X="0" Y="0.772000015" Z="0"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity name="PlayerName">
<Components>
<c:Text>
<Content>Insert name here</Content>
<Resource>Fonts/DroidSans.ttf,100</Resource>
<Color A="1" B="0" G="1" R="0"/>
</c:Text>
<c:Transform>
<Position X="0.100000001" Y="1.50199997" Z="-0.248000011"/>
<Scale X="0.100000001" Y="0.113000005" Z="0.5"/>
<Orientation X="0" Y="3.14199996" Z="0"/>
</c:Transform>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
+3 -3
View File
@@ -6,12 +6,12 @@
<Lifetime>0.25</Lifetime>
</c:Lifetime>
<c:Model>
<Resource>Models/Weapons/CylinderBullet.mesh</Resource>
<Color A="0.156862751" B="0" G="0.525490224" R="39.2156868"/>
<Resource>Models/Effects/CylinderShot.mesh</Resource>
<Color A="0.149019614" B="0" G="0" R="39.2156868"/>
<Transparent>true</Transparent>
</c:Model>
<c:Transform>
<Scale X="0.0110000009" Y="0.029000001" Z="100"/>
<Scale X="0.0690000057" Y="0.0690000057" Z="100"/>
</c:Transform>
</Components>
@@ -2,9 +2,6 @@
<Entity name="WeaponModel" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
<Components>
<c:BoneAttachment>
<BoneName>R_Arm_Weapon_Joint</BoneName>
</c:BoneAttachment>
<c:Lifetime>
<Lifetime>2</Lifetime>
</c:Lifetime>
@@ -18,12 +15,8 @@
</c:ExplosionEffect>
<c:Model>
<Resource>Models/Weapons/Blue/AssaultWeaponBlue.mesh</Resource>
<Transparent>true</Transparent>
</c:Model>
<c:Transform>
<Position X="0.120747991" Y="-0.229502052" Z="-0.151475638"/>
<Orientation X="0.0104046296" Y="-0.00268167513" Z="0.0428442545"/>
</c:Transform>
<c:Transform/>
</Components>
<Children/>
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Entity name="WeaponModel" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
<Components>
<c:Lifetime>
<Lifetime>2</Lifetime>
</c:Lifetime>
<c:ExplosionEffect>
<ColorByDistance>true</ColorByDistance>
<Velocity X="3.33300018" Y="0.0320000015" Z="0"/>
<ExplosionOrigin X="0" Y="0.0790000036" Z="-0.329000026"/>
<ExponentialAccelaration>true</ExponentialAccelaration>
<EndColor A="0" B="1" G="1" R="19.6078434"/>
<Randomness>true</Randomness>
</c:ExplosionEffect>
<c:Model>
<Resource>Models/Weapons/Red/AssaultWeaponRed.mesh</Resource>
</c:Model>
<c:Transform/>
</Components>
<Children/>
</Entity>
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Entity name="WeaponModel" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
<Components>
<c:Lifetime>
<Lifetime>2</Lifetime>
</c:Lifetime>
<c:ExplosionEffect>
<ColorByDistance>true</ColorByDistance>
<Velocity X="1.63300014" Y="0.0320000015" Z="0"/>
<ExplosionOrigin X="0" Y="0.0790000036" Z="-0.329000026"/>
<ExponentialAccelaration>true</ExponentialAccelaration>
<EndColor A="0" B="19.6078434" G="19.6078434" R="0"/>
<Randomness>true</Randomness>
</c:ExplosionEffect>
<c:Model>
<Resource>Models/Weapons/Blue/AssaultWeaponBlue.mesh</Resource>
<Transparent>true</Transparent>
</c:Model>
<c:Transform/>
</Components>
<Children/>
</Entity>
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Entity name="WeaponModel" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
<Components>
<c:Lifetime>
<Lifetime>2</Lifetime>
</c:Lifetime>
<c:ExplosionEffect>
<ColorByDistance>true</ColorByDistance>
<Velocity X="1.63300014" Y="0.0320000015" Z="0"/>
<ExplosionOrigin X="0" Y="0.0790000036" Z="-0.329000026"/>
<ExponentialAccelaration>true</ExponentialAccelaration>
<EndColor A="0" B="1" G="1" R="19.6078434"/>
<Randomness>true</Randomness>
</c:ExplosionEffect>
<c:Model>
<Resource>Models/Weapons/Red/AssaultWeaponRed.mesh</Resource>
<Transparent>true</Transparent>
</c:Model>
<c:Transform/>
</Components>
<Children/>
</Entity>
+38
View File
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Entity xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
<Components>
<c:Transform/>
</Components>
<Children>
<Entity name="MagazineAmmo">
<Components>
<c:Text>
<Content>0</Content>
<Resource>Fonts/DroidSans.ttf,64</Resource>
<Color A="1" B="3.92156863" G="1.17647064" R="0"/>
</c:Text>
<c:Transform>
<Scale X="0.0599999987" Y="0.0599999987" Z="0.0599999987"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity name="Ammo">
<Components>
<c:Text>
<Content>360</Content>
<Resource>Fonts/DroidSans.ttf,64</Resource>
<Color A="1" B="3.92156863" G="1.17647064" R="0"/>
</c:Text>
<c:Transform>
<Position X="5.2833886e-05" Y="-0.0407950208" Z="0"/>
<Scale X="0.0399999991" Y="0.0399999991" Z="0.0399999991"/>
</c:Transform>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
+4
View File
@@ -43,6 +43,10 @@
<xs:element ref="c:Shield" minOccurs="0"/>
<xs:element ref="c:Shielded" minOccurs="0"/>
<xs:element ref="c:CapturePointHUD" minOccurs="0"/>
<xs:element ref="c:AmmunitionHUD" minOccurs="0"/>
<xs:element ref="c:KillFeed" minOccurs="0"/>
<xs:element ref="c:Sprite" minOccurs="0"/>
<xs:element ref="c:AnimationOffset" minOccurs="0"/>
</xs:all>
</xs:complexType>
</xs:element>
+3
View File
@@ -40,8 +40,11 @@ EditorSystem::EditorSystem(SystemParams params, IRenderer* renderer, RenderFrame
m_EditorStats = new EditorStats();
m_Enabled = ResourceManager::Load<ConfigFile>("Config.ini")->Get<bool>("Debug.EditorEnabled", false);
if (m_Enabled) {
Enable();
} else {
Disable();
}
}
+146 -95
View File
@@ -1,10 +1,8 @@
#include "Network/Client.h"
using namespace boost::asio::ip;
Client::Client(World* world, EventBroker* eventBroker)
: Network(world, eventBroker)
, m_Socket(m_IOService)
{
// Asumes root node is EntityID_Invalid
insertIntoServerClientMaps(EntityID_Invalid, EntityID_Invalid);
@@ -14,7 +12,6 @@ Client::Client(World* world, EventBroker* eventBroker)
auto config = ResourceManager::Load<ConfigFile>("Config.ini");
m_PlayerName = config->Get<std::string>("Networking.Name", "Raptorcopter");
m_SendInputIntervalMs = config->Get<int>("Networking.SendInputIntervalMs", 33);
LOG_INFO("Client initialized");
}
@@ -26,70 +23,77 @@ Client::Client(World* world, EventBroker* eventBroker, std::unique_ptr<SnapshotF
Client::~Client()
{ }
// Need to call connect at start
void Client::Connect(std::string address, int port)
{
// Subscribe to events
EVENT_SUBSCRIBE_MEMBER(m_EInputCommand, &Client::OnInputCommand);
EVENT_SUBSCRIBE_MEMBER(m_EPlayerDamage, &Client::OnPlayerDamage);
EVENT_SUBSCRIBE_MEMBER(m_EPlayerSpawned, &Client::OnPlayerSpawned);
auto config = ResourceManager::Load<ConfigFile>("Config.ini");
m_Address = address;
if (address.empty()) {
address = config->Get<std::string>("Networking.Address", "127.0.0.1");
m_Address = config->Get<std::string>("Networking.Address", "127.0.0.1");
}
m_Port = port;
if (port == 0) {
port = config->Get<int>("Networking.Port", 27666);
m_Port = config->Get<int>("Networking.Port", 27666);
}
m_ReceiverEndpoint = udp::endpoint(boost::asio::ip::address::from_string(address), port);
LOG_INFO("Client connecting...");
m_Socket.connect(m_ReceiverEndpoint);
connect();
}
void Client::Update()
{
m_EventBroker->Process<Client>();
readFromServer();
while (m_Unreliable.IsSocketAvailable()) {
// Packet will get real data in receive
Packet packet(MessageType::Invalid);
m_Unreliable.Receive(packet);
if (packet.GetMessageType() == MessageType::Connect) {
parseUDPConnect(packet);
} else {
parseMessageType(packet);
}
}
while (m_Reliable.IsSocketAvailable()) {
// Packet will get real data in receive
Packet packet(MessageType::Invalid);
m_Reliable.Receive(packet);
if (packet.GetMessageType() == MessageType::Connect) {
parseTCPConnect(packet);
} else {
parseMessageType(packet);
}
}
if (m_IsConnected) {
hasServerTimedOut();
// Don't sent 1 input in 1 packet, bunch em up.
// Don't send 1 input in 1 packet, bunch em up.
if (m_SendInputIntervalMs < (1000 * (std::clock() - m_TimeSinceSentInputs) / (double)CLOCKS_PER_SEC)) {
sendInputCommands();
m_TimeSinceSentInputs = std::clock();
}
// HACK: Send absolute player positions for now to avoid desync until we have reliable messages
sendLocalPlayerTransform();
}
Network::Update();
}
void Client::readFromServer()
{
while (m_Socket.available()) {
bytesRead = receive(readBuf);
if (bytesRead > 0) {
Packet packet(readBuf, bytesRead);
parseMessageType(packet);
}
hasServerTimedOut();
}
//Network::Update();
}
void Client::parseMessageType(Packet& packet)
{
// Pop packetSize which is used by TCP Client to
// create a packet of the correct size
packet.ReadPrimitive<int>();
int messageType = packet.ReadPrimitive<int>();
if (messageType == -1)
return;
// Read packet ID
m_PreviousPacketID = m_PacketID; // Set previous packet id
m_PacketID = packet.ReadPrimitive<int>(); //Read new packet id
identifyPacketLoss();
//identifyPacketLoss();
switch (static_cast<MessageType>(messageType)) {
case MessageType::Connect:
parseConnect(packet);
break;
case MessageType::Ping:
parsePing();
break;
@@ -115,17 +119,40 @@ void Client::parseMessageType(Packet& packet)
case MessageType::ComponentDeleted:
parseComponentDeletion(packet);
break;
case MessageType::OnPlayerDamage:
parsePlayerDamage(packet);
break;
default:
break;
}
}
void Client::parseConnect(Packet& packet)
void Client::parseUDPConnect(Packet& packet)
{
// Map ServerEntityID and your PlayerID
LOG_INFO("I be connected PogChamp");
}
void Client::parseTCPConnect(Packet& packet)
{
LOG_INFO("Received TCP connect from server");
// Pop size of message int
packet.ReadPrimitive<int>();
int messageType = packet.ReadPrimitive<int>();
// Read packet ID
m_PreviousPacketID = m_PacketID; // Set previous packet id
m_PacketID = packet.ReadPrimitive<int>(); //Read new packet id
// parse player id and other stuff
m_PlayerID = packet.ReadPrimitive<int>();
m_PlayerID = packet.ReadPrimitive<int>();
LOG_INFO("A Player connected");
Packet UnreliablePacket(MessageType::Connect, m_SendPacketID);
// Add player id and other stuff
packet.WritePrimitive(m_PlayerID);
m_Unreliable.Send(packet);
LOG_INFO("Sent UDP Connect Server");
}
void Client::parsePlayerConnected(Packet & packet)
{
// Map ServerEntityID and other player's PlayerID
@@ -143,7 +170,7 @@ void Client::parsePing()
Packet packet(MessageType::Ping, m_SendPacketID);
packet.WriteString("Ping recieved");
send(packet);
m_Reliable.Send(packet);
}
void Client::parseKick()
@@ -152,14 +179,41 @@ void Client::parseKick()
m_IsConnected = false;
}
void Client::parseSpawnEvents()
{
std::vector<Events::PlayerSpawned> tempSpawn;
for (int i = 0; i < m_PlayerSpawnEvents.size(); i++) {
Events::PlayerSpawned e;
if (!serverClientMapsHasEntity(m_PlayerSpawnEvents.at(i).Player.ID)) {
tempSpawn.push_back(m_PlayerSpawnEvents.at(i));
continue;
}
e.Player = EntityWrapper(m_World, m_ServerIDToClientID.at(m_PlayerSpawnEvents.at(i).Player.ID));
//e.Spawner = EntityWrapper(m_World, m_ServerIDToClientID.at(m_PlayerSpawnEvents.at(i).Spawner.ID));
e.PlayerID = -1;
e.PlayerName = m_PlayerSpawnEvents.at(i).PlayerName;
m_EventBroker->Publish(e);
}
m_PlayerSpawnEvents = tempSpawn;
// m_PlayerSpawnEvents.clear();
}
void Client::parsePlayersSpawned(Packet& packet)
{
//Events::PlayerSpawned e;
//e.Player = EntityWrapper(m_World, m_ServerIDToClientID[packet.ReadPrimitive<EntityID>()]);
//e.Spawner = EntityWrapper(m_World, m_ServerIDToClientID[packet.ReadPrimitive<EntityID>()]);
//e.PlayerID = -1;
//e.PlayerName = packet.ReadString();
//m_EventBroker->Publish(e);
Events::PlayerSpawned e;
e.Player = EntityWrapper(m_World, m_ServerIDToClientID[packet.ReadPrimitive<EntityID>()]);
e.Spawner = EntityWrapper(m_World, m_ServerIDToClientID[packet.ReadPrimitive<EntityID>()]);
e.Player = EntityWrapper(m_World, packet.ReadPrimitive<EntityID>());
e.Spawner = EntityWrapper(m_World, packet.ReadPrimitive<EntityID>());
e.PlayerID = -1;
e.PlayerName = packet.ReadString();
m_EventBroker->Publish(e);
m_PlayerSpawnEvents.push_back(e);
parseSpawnEvents();
}
void Client::parseEntityDeletion(Packet & packet)
@@ -235,10 +289,15 @@ void Client::parseSnapshot(Packet& packet)
for (std::size_t i = 0; i < numInputCommands; ++i) {
Events::InputCommand e;
e.PlayerID = packet.ReadPrimitive<EntityID>();
e.Player = EntityWrapper(m_World, m_ServerIDToClientID.at(packet.ReadPrimitive<EntityID>()));
e.Command = packet.ReadString();
e.Value = packet.ReadPrimitive<float>();
m_EventBroker->Publish(e);
EntityID player = packet.ReadPrimitive<EntityID>();
std::string command = packet.ReadString();
float value = packet.ReadPrimitive<float>();
if (m_ServerIDToClientID.find(player) != m_ServerIDToClientID.end()) {
e.Player = EntityWrapper(m_World, m_ServerIDToClientID.at(player));
e.Command = command;
e.Value = value;
m_EventBroker->Publish(e);
}
}
// Read world state
@@ -297,56 +356,17 @@ void Client::parseSnapshot(Packet& packet)
m_World->SetParent(localEntityID, m_ServerIDToClientID.at(serverParentID));
}
}
}
size_t Client::receive(char* data)
{
boost::system::error_code error;
size_t bytesReceived = m_Socket.receive_from(boost
::asio::buffer((void*)data, INPUTSIZE),
m_ReceiverEndpoint,
0, error);
// Network Debug data
if (isReadingData) {
m_NetworkData.TotalDataReceived += bytesReceived;
m_NetworkData.DataReceivedThisInterval += bytesReceived;
m_NetworkData.AmountOfMessagesReceived++;
}
if (error) {
//LOG_ERROR("receive: %s", error.message().c_str());
}
return bytesReceived;
}
void Client::send(Packet& packet)
{
m_Socket.send_to(boost::asio::buffer(
packet.Data(),
packet.Size()),
m_ReceiverEndpoint, 0);
// Network Debug data
if (isReadingData) {
m_NetworkData.TotalDataSent += packet.Size();
m_NetworkData.DataSentThisInterval += packet.Size();
m_NetworkData.AmountOfMessagesSent++;
}
}
void Client::connect()
{
Packet packet(MessageType::Connect, m_SendPacketID);
packet.WriteString(m_PlayerName);
m_StartPingTime = std::clock();
send(packet);
parseSpawnEvents();
}
void Client::disconnect()
{
m_IsConnected = false;
m_PreviousPacketID = 0;
m_PacketID = 0;
Packet packet(MessageType::Disconnect, m_SendPacketID);
send(packet);
m_Reliable.Send(packet);
m_Reliable.Disconnect();
}
bool Client::OnInputCommand(const Events::InputCommand & e)
@@ -357,7 +377,8 @@ bool Client::OnInputCommand(const Events::InputCommand & e)
if (e.Command == "ConnectToServer") { // Connect for now
if (e.Value > 0) {
connect();
m_Reliable.Connect(m_PlayerName, m_Address, m_Port);
m_Unreliable.Connect(m_PlayerName, m_Address, m_Port);
}
//LOG_DEBUG("Client::OnInputCommand: Command is %s. Value is %f. PlayerID is %i.", e.Command.c_str(), e.Value, e.PlayerID);
return true;
@@ -380,7 +401,9 @@ bool Client::OnInputCommand(const Events::InputCommand & e)
m_SaveDataTimer = std::clock();
}
} else {
m_InputCommandBuffer.push_back(e);
if (m_IsConnected) {
m_InputCommandBuffer.push_back(e);
}
//LOG_DEBUG("Client::OnInputCommand: Command is %s. Value is %f. PlayerID is %i.", e.Command.c_str(), e.Value, e.PlayerID);
return true;
}
@@ -389,12 +412,17 @@ bool Client::OnInputCommand(const Events::InputCommand & e)
bool Client::OnPlayerDamage(const Events::PlayerDamage & e)
{
if (e.Inflictor != m_LocalPlayer) {
return false;
}
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);
send(packet);
return false;
m_Reliable.Send(packet);
return true;
}
bool Client::OnPlayerSpawned(const Events::PlayerSpawned& e)
@@ -405,23 +433,49 @@ bool Client::OnPlayerSpawned(const Events::PlayerSpawned& e)
return true;
}
void Client::parsePlayerDamage(Packet& packet)
{
Events::PlayerDamage e;
PlayerID victimID = packet.ReadPrimitive<EntityID>();
if(serverClientMapsHasEntity(victimID)){
return;
}
e.Inflictor = EntityWrapper(m_World, m_ServerIDToClientID.at(victimID));
e.Victim = EntityWrapper(m_World, m_ServerIDToClientID.at(packet.ReadPrimitive<EntityID>()));
e.Damage = packet.ReadPrimitive<double>();
// Don't rebroadcast our own player damage events or we'll have an infinite loop!
if (e.Inflictor != m_LocalPlayer) {
m_EventBroker->Publish(e);
}
}
void Client::sendLocalPlayerTransform()
{
if (!m_LocalPlayer.Valid()) {
return;
}
Packet packet(MessageType::PlayerTransform, m_SendPacketID);
ComponentWrapper cTransform = m_LocalPlayer["Transform"];
glm::vec3& position = cTransform["Position"];
glm::vec3& orientation = cTransform["Orientation"];
Packet packet(MessageType::PlayerTransform, m_SendPacketID);
packet.WritePrimitive(position.x);
packet.WritePrimitive(position.y);
packet.WritePrimitive(position.z);
packet.WritePrimitive(orientation.x);
packet.WritePrimitive(orientation.y);
packet.WritePrimitive(orientation.z);
send(packet);
bool hasAssaultWeapon = m_LocalPlayer.HasComponent("AssaultWeapon");
packet.WritePrimitive(hasAssaultWeapon);
if (hasAssaultWeapon) {
ComponentWrapper cAssaultWeapon = m_LocalPlayer["AssaultWeapon"];
packet.WritePrimitive((int)cAssaultWeapon["MagazineAmmo"]);
packet.WritePrimitive((int)cAssaultWeapon["Ammo"]);
}
m_Unreliable.Send(packet);
}
void Client::identifyPacketLoss()
@@ -433,17 +487,15 @@ void Client::identifyPacketLoss()
}
}
bool Client::hasServerTimedOut()
void Client::hasServerTimedOut()
{
// Time in ms
double timeSincePing = 1000 * (std::clock() - m_StartPingTime) / static_cast<double>(CLOCKS_PER_SEC);
if (timeSincePing > m_TimeoutMs) {
// Clear everything and go to menu.
LOG_INFO("Server has timed out, returning to menu, Beep Boop.");
m_IsConnected = false;
return true;
disconnect();
}
return false;
}
EntityID Client::createPlayer()
@@ -464,7 +516,7 @@ void Client::sendInputCommands()
packet.WriteString(m_InputCommandBuffer[i].Command);
packet.WritePrimitive(m_InputCommandBuffer[i].Value);
}
send(packet);
m_Reliable.Send(packet);
m_InputCommandBuffer.clear();
}
}
@@ -472,7 +524,7 @@ void Client::sendInputCommands()
void Client::becomePlayer()
{
Packet packet = Packet(MessageType::BecomePlayer, m_SendPacketID);
send(packet);
m_Reliable.Send(packet);
}
bool Client::clientServerMapsHasEntity(EntityID clientEntityID)
@@ -503,7 +555,6 @@ void Client::insertIntoServerClientMaps(EntityID serverEntityID, EntityID client
{
m_ServerIDToClientID.insert(std::make_pair(serverEntityID, clientEntityID));
m_ClientIDToServerID.insert(std::make_pair(clientEntityID, serverEntityID));
}
void Client::deleteFromServerClientMaps(EntityID serverEntityID, EntityID clientEntityID)
+10
View File
@@ -0,0 +1,10 @@
#include "Network/HybridClient.h"
HybridClient::HybridClient()
{
}
HybridClient::~HybridClient()
{
}
+9
View File
@@ -0,0 +1,9 @@
#include "Network/HybridServer.h"
HybridServer::HybridServer()
{
}
HybridServer::~HybridServer()
{
}
+15
View File
@@ -14,6 +14,21 @@ void Network::Update()
updateNetworkData();
}
void Network::logSentData(int bytesSent)
{
}
void Network::logReceivedData(int bytesReceived)
{
// Network Debug data
if (isReadingData) {
m_NetworkData.TotalDataReceived += bytesReceived;
m_NetworkData.DataReceivedThisInterval += bytesReceived;
m_NetworkData.AmountOfMessagesReceived++;
}
}
void Network::saveToFile()
{
std::ofstream outfile;
+48 -11
View File
@@ -34,10 +34,12 @@ void Packet::Init(MessageType type, unsigned int & packetID)
m_ReturnDataOffset = 0;
m_Offset = 0;
// Create message header
// allocate memory for size of packet(only used in tcp)
WritePrimitive<int>(0);
// Add message type
int messageType = static_cast<int>(type);
Packet::WritePrimitive<int>(messageType);
Packet::WritePrimitive<int>(packetID);
WritePrimitive<int>(messageType);
WritePrimitive<int>(packetID);
packetID++;
m_HeaderSize = m_Offset;
}
@@ -56,9 +58,12 @@ void Packet::WriteString(const std::string& str)
void Packet::WriteData(char * data, int sizeOfData)
{
if (m_Offset + sizeOfData > m_MaxPacketSize) {
//LOG_WARNING("Packet::WriteData(): Data size in packet exceeded maximum packet size. New size is %i bytes\n", m_MaxPacketSize*2);
resizeData();
while (m_Offset + sizeOfData > m_MaxPacketSize) {
resizeData();
}
}
memcpy(m_Data + m_Offset, data, sizeOfData);
m_Offset += sizeOfData;
@@ -76,14 +81,35 @@ std::string Packet::ReadString()
return returnValue;
}
char * Packet::ReadData(int SizeOfData)
void Packet::ReconstructFromData(char * data, size_t sizeOfData)
{
if (m_Offset < m_ReturnDataOffset + SizeOfData) {
if (sizeOfData > m_MaxPacketSize) {
// Delete our data
delete[] m_Data;
// Set new max size
m_MaxPacketSize = sizeOfData;
m_Data = new char[m_MaxPacketSize];
// while we resized the old data container.
}
memcpy(m_Data, data, sizeOfData);
m_Offset = sizeOfData;
}
void Packet::UpdateSize()
{
int whatisoffset = m_Offset;
memcpy(m_Data, &m_Offset, sizeof(int));
}
char * Packet::ReadData(int sizeOfData)
{
if (m_Offset < m_ReturnDataOffset + sizeOfData) {
//LOG_WARNING("packet ReadData(): Oh no! You are trying to remove things outside my memory kingdom");
return nullptr;
}
size_t oldReturnDataOffset = m_ReturnDataOffset;
m_ReturnDataOffset += SizeOfData;
m_ReturnDataOffset += sizeOfData;
return (m_Data + oldReturnDataOffset);
}
@@ -91,25 +117,36 @@ void Packet::ChangePacketID(unsigned int & packetID)
{
packetID = packetID + 1;
// Overwrite old PacketID
memcpy(m_Data + sizeof(int), &packetID, sizeof(int));
memcpy(m_Data + 2*sizeof(int), &packetID, sizeof(int));
}
MessageType Packet::GetMessageType()
{
MessageType messagType;
memcpy(&messagType, m_Data + sizeof(int), sizeof(int));
return messagType;
}
void Packet::resizeData()
{
resizeData(m_MaxPacketSize * 2);
}
void Packet::resizeData(int size)
{
// Allocate memory to store our data in
char* holdData = new char[m_MaxPacketSize];
// Copy our data to the newly allocated memory
memcpy(holdData, m_Data, m_Offset);
// Increase max packet size
m_MaxPacketSize = m_MaxPacketSize * 2;
m_MaxPacketSize = size;
// Delete our data
delete m_Data;
// Allocate twice the memory we had before
delete[] m_Data;
// Allocate memory
m_Data = new char[m_MaxPacketSize];
// Copy our data to new location
memcpy(m_Data, holdData, m_Offset);
// Delete the memory allocated to hold our data
// while we resized the old data container.
delete holdData;
delete[] holdData;
}
+264 -207
View File
@@ -6,19 +6,18 @@ Server::Server(World* world, EventBroker* eventBroker, int port)
ConfigFile* config = ResourceManager::Load<ConfigFile>("Config.ini");
snapshotInterval = 1000 * config->Get<float>("Networking.SnapshotInterval", 0.05f);
pingIntervalMs = config->Get<float>("Networking.PingIntervalMs", 1000);
// Subscribe to events
EVENT_SUBSCRIBE_MEMBER(m_EInputCommand, &Server::OnInputCommand);
EVENT_SUBSCRIBE_MEMBER(m_EPlayerSpawned, &Server::OnPlayerSpawned);
EVENT_SUBSCRIBE_MEMBER(m_EEntityDeleted, &Server::OnEntityDeleted);
EVENT_SUBSCRIBE_MEMBER(m_EComponentDeleted, &Server::OnComponentDeleted);
EVENT_SUBSCRIBE_MEMBER(m_EPlayerDamage, &Server::OnPlayerDamage);
// Bind
if (port == 0) {
port = config->Get<float>("Networking.Port", 27666);
}
m_Port = port;
m_Socket = std::make_unique<boost::asio::ip::udp::socket>(m_IOService, boost::asio::ip::udp::endpoint(boost::asio::ip::udp::v4(), port));
LOG_INFO("Server initialized and bound to port %i", port);
}
@@ -29,7 +28,58 @@ Server::~Server()
void Server::Update()
{
readFromClients();
PlayerDefinition pd;
m_Reliable.AcceptNewConnections(m_NextPlayerID, m_ConnectedPlayers);
for (auto& kv : m_ConnectedPlayers) {
while (kv.second.TCPSocket->available()) {
// Packet will get real data in receive
Packet packet(MessageType::Invalid);
m_Reliable.Receive(packet, kv.second);
m_Address = kv.second.TCPSocket->remote_endpoint().address();
m_Port = kv.second.TCPSocket->remote_endpoint().port();
if (packet.GetMessageType() == MessageType::Connect) {
parseTCPConnect(packet);
} else {
parseMessageType(packet);
}
}
}
while (m_Unreliable.IsSocketAvailable()) {
// Packet will get real data in receive
Packet packet(MessageType::Invalid);
m_Unreliable.Receive(packet, pd);
m_Address = pd.Endpoint.address();
m_Port = pd.Endpoint.port();
if (packet.GetMessageType() == MessageType::Connect) {
parseUDPConnect(packet);
} else {
parseMessageType(packet);
}
}
// Check if players have disconnected
for (int i = 0; i < m_PlayersToDisconnect.size(); i++) {
disconnect(m_PlayersToDisconnect.at(i));
}
m_PlayersToDisconnect.clear();
std::clock_t currentTime = std::clock();
// Send snapshot
if (snapshotInterval < (1000 * (currentTime - previousSnapshotMessage) / (double)CLOCKS_PER_SEC)) {
sendSnapshot();
previousSnapshotMessage = currentTime;
}
// Send pings each
if (pingIntervalMs < (1000 * (currentTime - previousePingMessage) / (double)CLOCKS_PER_SEC)) {
sendPing();
previousePingMessage = currentTime;
}
// Time out logic
if (checkTimeOutInterval < (1000 * (currentTime - timOutTimer) / (double)CLOCKS_PER_SEC)) {
checkForTimeOuts();
timOutTimer = currentTime;
}
m_EventBroker->Process<Server>();
if (isReadingData) {
Network::Update();
@@ -37,48 +87,20 @@ void Server::Update()
}
void Server::readFromClients()
{
while (m_Socket->available()) {
try {
bytesRead = receive(readBuffer);
Packet packet(readBuffer, bytesRead);
parseMessageType(packet);
} catch (const std::exception&) {
//LOG_ERROR("%i: Read from client crashed %s", m_PacketID, err.what());
}
}
std::clock_t currentTime = std::clock();
// Send snapshot
if (snapshotInterval < (1000 * (currentTime - previousSnapshotMessage) / (double)CLOCKS_PER_SEC)) {
sendSnapshot();
previousSnapshotMessage = currentTime;
}
// Send pings each
if (pingIntervalMs < (1000 * (currentTime - previousePingMessage) / (double)CLOCKS_PER_SEC)) {
sendPing();
previousePingMessage = currentTime;
}
// Time out logic
if (checkTimeOutInterval < (1000 * (currentTime - timOutTimer) / (double)CLOCKS_PER_SEC)) {
checkForTimeOuts();
timOutTimer = currentTime;
}
}
void Server::parseMessageType(Packet& packet)
{
int messageType = packet.ReadPrimitive<int>(); // Read what type off message was sent from server
// Pop packetSize which is used by TCP Client to
// create a packet of the correct size
packet.ReadPrimitive<int>();
int messageType = packet.ReadPrimitive<int>(); // Read what type off message was sent from server
// Read packet ID
m_PreviousPacketID = m_PacketID; // Set previous packet id
m_PacketID = packet.ReadPrimitive<int>(); //Read new packet id
//identifyPacketLoss();
switch (static_cast<MessageType>(messageType)) {
case MessageType::Connect:
parseConnect(packet);
//parseConnect(packet);
break;
case MessageType::Ping:
parsePing();
@@ -104,60 +126,19 @@ void Server::parseMessageType(Packet& packet)
}
}
size_t Server::receive(char * data)
{
size_t length = m_Socket->receive_from(
boost::asio::buffer((void*)data
, INPUTSIZE)
, m_ReceiverEndpoint, 0);
// Network Debug data
if (isReadingData) {
m_NetworkData.TotalDataReceived += length;
m_NetworkData.DataReceivedThisInterval += length;
m_NetworkData.AmountOfMessagesReceived++;
}
return length;
}
void Server::send(PlayerID player, Packet& packet)
{
try {
size_t bytesSent = m_Socket->send_to(
boost::asio::buffer(packet.Data(), packet.Size()),
m_ConnectedPlayers[player].Endpoint,
0);
// Network Debug data
if (isReadingData) {
m_NetworkData.TotalDataSent += packet.Size();
m_NetworkData.DataSentThisInterval += packet.Size();
m_NetworkData.AmountOfMessagesSent++;
}
} catch (const boost::system::system_error&) {
// TODO: Clean up invalid endpoints out of m_ConnectedPlayers later
m_ConnectedPlayers[player].Endpoint = boost::asio::ip::udp::endpoint();
}
}
void Server::send(Packet & packet)
{
m_Socket->send_to(
boost::asio::buffer(
packet.Data(),
packet.Size()),
m_ReceiverEndpoint,
0);
if (isReadingData) {
// Network Debug data
m_NetworkData.TotalDataSent += packet.Size();
m_NetworkData.DataSentThisInterval += packet.Size();
}
}
void Server::broadcast(Packet& packet)
void Server::reliableBroadcast(Packet& packet)
{
for (auto& kv : m_ConnectedPlayers) {
packet.ChangePacketID(kv.second.PacketID);
send(kv.first, packet);
m_Reliable.Send(packet, kv.second);
}
}
void Server::unreliableBroadcast(Packet& packet)
{
for (auto& kv : m_ConnectedPlayers) {
packet.ChangePacketID(kv.second.PacketID);
m_Unreliable.Send(packet, kv.second);
}
}
@@ -167,7 +148,7 @@ void Server::sendSnapshot()
Packet packet(MessageType::Snapshot);
addInputCommandsToPacket(packet);
addChildrenToPacket(packet, EntityID_Invalid);
broadcast(packet);
unreliableBroadcast(packet);
}
void Server::addInputCommandsToPacket(Packet& packet)
@@ -190,6 +171,12 @@ void Server::addChildrenToPacket(Packet & packet, EntityID entityID)
// Loop through every child
for (auto it = itPair.first; it != itPair.second; it++) {
EntityID childEntityID = it->second;
// HACK: Only sync players for now, since the map turned out to be TOO LARGE to send in one snapshot and Simon's computer shits itself
EntityWrapper childEntity(m_World, childEntityID);
if (!shouldSendToClient(childEntity)) {
continue;
}
// Write EntityID and parentsID and Entity name
packet.WritePrimitive(childEntityID);
packet.WritePrimitive(entityID);
@@ -241,7 +228,7 @@ void Server::sendPing()
// Time message
m_StartPingTime = std::clock();
// Send message
broadcast(packet);
reliableBroadcast(packet);
}
void Server::checkForTimeOuts()
@@ -249,16 +236,91 @@ void Server::checkForTimeOuts()
double startPing = 1000 * m_StartPingTime
/ static_cast<double>(CLOCKS_PER_SEC);
for (int i = 0; i < m_ConnectedPlayers.size(); i++) {
if (m_ConnectedPlayers[i].Endpoint.address() != boost::asio::ip::address()) {
double stopPing = 1000 * m_ConnectedPlayers[i].StopTime /
std::vector<PlayerID> playersToRemove;
for (auto& kv : m_ConnectedPlayers) {
if (kv.second.TCPAddress != boost::asio::ip::address()) {
int stopPing = 1000 * kv.second.StopTime /
static_cast<double>(CLOCKS_PER_SEC);
if (startPing > stopPing + m_TimeoutMs) {
//LOG_INFO("User %i timed out!", i);
//disconnect(i);
LOG_INFO("User %i timed out!", kv.second.Name);
playersToRemove.push_back(kv.first);
}
}
}
for (size_t i = 0; i < playersToRemove.size(); i++) {
disconnect(playersToRemove.at(i));
}
}
void Server::parseUDPConnect(Packet & packet)
{
// Pop size of message int
packet.ReadPrimitive<int>();
int messageType = packet.ReadPrimitive<int>();
// Read packet ID
m_PreviousPacketID = m_PacketID; // Set previous packet id
m_PacketID = packet.ReadPrimitive<int>(); //Read new packet id
// parse player id and other stuff
PlayerID playerID = packet.ReadPrimitive<int>();
// Do something here?
boost::asio::ip::udp::endpoint endpoint(m_Address, m_Port);
m_ConnectedPlayers.at(playerID).Endpoint = endpoint;
LOG_INFO("parseUDPConnect: Spectator \"%s\" connected on IP: %s", m_ConnectedPlayers.at(playerID).Name.c_str(), m_ConnectedPlayers.at(playerID).Endpoint.address().to_string().c_str());
// Send a message to the player that connected
Packet connnectPacket(MessageType::Connect, m_ConnectedPlayers.at(playerID).PacketID);
m_Unreliable.Send(connnectPacket);
LOG_INFO("UDP Connect sent to client");
}
void Server::parseTCPConnect(Packet & packet)
{
// Pop size of message int
packet.ReadPrimitive<int>();
int messageType = packet.ReadPrimitive<int>();
// Read packet ID
m_PreviousPacketID = m_PacketID; // Set previous packet id
m_PacketID = packet.ReadPrimitive<int>(); //Read new packet id
LOG_INFO("Parsing connections");
// Check if player is already connected
// Ska vara till lagd i TCPServer receive
PlayerID playerID = GetPlayerIDFromEndpoint();
if (playerID == -1) {
return;
}
// Create a new player
m_ConnectedPlayers.at(playerID).EntityID = 0; // Overlook this
m_ConnectedPlayers.at(playerID).Name = packet.ReadString();
m_ConnectedPlayers.at(playerID).PacketID = 0;
m_ConnectedPlayers.at(playerID).StopTime = std::clock();
m_ConnectedPlayers.at(playerID).TCPAddress = m_Address;
m_ConnectedPlayers.at(playerID).TCPPort = m_Port;
LOG_INFO("parseTCPConnect: Spectator \"%s\" connected on IP: %s", m_ConnectedPlayers.at(playerID).Name.c_str(),
m_ConnectedPlayers.at(playerID).TCPAddress.to_string().c_str());
// Send a message to the player that connected
Packet connnectPacket(MessageType::Connect, m_ConnectedPlayers.at(playerID).PacketID);
// Write playerID to packet
connnectPacket.WritePrimitive(playerID);
m_Reliable.Send(connnectPacket);
// Send notification that a player has connected
//Packet notificationPacket(MessageType::PlayerConnected);
//broadcast(notificationPacket);
}
void Server::parseDisconnect()
{
LOG_INFO("%i: Parsing disconnect", m_PacketID);
for (auto& kv : m_ConnectedPlayers) {
if (kv.second.TCPAddress == m_Address &&
kv.second.TCPPort == m_Port) {
m_PlayersToDisconnect.push_back(kv.first);
break;
}
}
}
void Server::disconnect(PlayerID playerID)
@@ -267,33 +329,15 @@ void Server::disconnect(PlayerID playerID)
LOG_INFO("User %s disconnected/timed out", m_ConnectedPlayers[playerID].Name.c_str());
// Remove enteties and stuff (When we can remove entity, remove it and tell clients to remove the copy they have)
Events::PlayerDisconnected e;
e.Entity = m_ConnectedPlayers[playerID].EntityID;
e.Entity = m_ConnectedPlayers.at(playerID).EntityID;
e.PlayerID = playerID;
m_EventBroker->Publish(e);
//m_World->DeleteEntity(m_ConnectedPlayers[playerID].EntityID);
m_ConnectedPlayers[playerID].TCPSocket->shutdown(boost::asio::ip::tcp::socket::shutdown_both);
m_ConnectedPlayers[playerID].TCPSocket->close();
m_World->DeleteEntity(m_ConnectedPlayers[playerID].EntityID);
m_ConnectedPlayers.erase(playerID);
}
void Server::parseOnInputCommand(Packet& packet)
{
PlayerID player = -1;
// Check which player it was who sent the message
player = GetPlayerIDFromEndpoint(m_ReceiverEndpoint);
if (player != -1) {
while (packet.DataReadSize() < packet.Size()) {
Events::InputCommand e;
e.Command = packet.ReadString();
e.PlayerID = player; // Set correct player id
e.Player = EntityWrapper(m_World, m_ConnectedPlayers.at(player).EntityID);
e.Value = packet.ReadPrimitive<float>();
m_EventBroker->Publish(e);
if (e.Command == "PrimaryFire") {
m_InputCommandsToBroadcast.push_back(e);
}
//LOG_INFO("Server::parseOnInputCommand: Command is %s. Value is %f. PlayerID is %i.", e.Command.c_str(), e.Value, e.PlayerID);
}
}
// Send disconnect to the other players.
}
void Server::parseOnPlayerDamage(Packet & packet)
@@ -306,75 +350,6 @@ void Server::parseOnPlayerDamage(Packet & packet)
//LOG_DEBUG("Server::parseOnPlayerDamage: Command is %s. Value is %f. PlayerID is %i.", e.DamageAmount, e.PlayerDamagedID, e.TypeOfDamage.c_str());
}
void Server::parseConnect(Packet& packet)
{
LOG_INFO("Parsing connections");
// Check if player is already connected
if (GetPlayerIDFromEndpoint(m_ReceiverEndpoint) != -1) {
return;
}
for (auto& kv : m_ConnectedPlayers) {
if (kv.second.Endpoint.address() == m_ReceiverEndpoint.address() &&
kv.second.Endpoint.port() == m_ReceiverEndpoint.port()) {
// Already connected
return;
}
}
// Create a new player
PlayerDefinition pd;
pd.EntityID = 0; // Overlook this
pd.Endpoint = m_ReceiverEndpoint;
pd.Name = packet.ReadString();
pd.PacketID = 0;
pd.StopTime = std::clock();
m_ConnectedPlayers[m_NextPlayerID++] = pd;
LOG_INFO("Spectator \"%s\" connected on IP: %s", pd.Name.c_str(), pd.Endpoint.address().to_string().c_str());
// Send a message to the player that connected
Packet connnectPacket(MessageType::Connect, pd.PacketID);
send(connnectPacket);
// Send notification that a player has connected
Packet notificationPacket(MessageType::PlayerConnected);
broadcast(notificationPacket);
}
void Server::parseDisconnect()
{
LOG_INFO("%i: Parsing disconnect", m_PacketID);
for (auto& kv : m_ConnectedPlayers) {
if (kv.second.Endpoint.address() == m_ReceiverEndpoint.address() &&
kv.second.Endpoint.port() == m_ReceiverEndpoint.port()) {
disconnect(kv.first);
break;
}
}
}
void Server::parseClientPing()
{
LOG_INFO("%i: Parsing ping", m_PacketID);
PlayerID player = GetPlayerIDFromEndpoint(m_ReceiverEndpoint);
if (player == -1) {
return;
}
// Return ping
Packet packet(MessageType::Ping, m_ConnectedPlayers[player].PacketID);
packet.WriteString("Ping received");
send(packet);
}
void Server::parsePing()
{
for (int i = 0; i < m_ConnectedPlayers.size(); i++) {
if (m_ConnectedPlayers[i].Endpoint.address() == m_ReceiverEndpoint.address()) {
m_ConnectedPlayers[i].StopTime = std::clock();
break;
}
}
}
void Server::identifyPacketLoss()
{
// if no packets lost, difference should be equal to 1
@@ -388,18 +363,7 @@ void Server::kick(PlayerID player)
{
disconnect(player);
Packet packet = Packet(MessageType::Kick);
send(packet);
}
PlayerID Server::GetPlayerIDFromEndpoint(boost::asio::ip::udp::endpoint endpoint)
{
for (auto& kv : m_ConnectedPlayers) {
if (kv.second.Endpoint.address() == endpoint.address() &&
kv.second.Endpoint.port() == endpoint.port()) {
return kv.first;
}
}
return -1;
m_Reliable.Send(packet);
}
bool Server::OnInputCommand(const Events::InputCommand & e)
@@ -428,7 +392,7 @@ bool Server::OnPlayerSpawned(const Events::PlayerSpawned & e)
packet.WritePrimitive<EntityID>(e.Spawner.ID);
// We don't send PlayerID here because it will always be set to -1
packet.WriteString(m_ConnectedPlayers[e.PlayerID].Name);
send(e.PlayerID, packet);
m_Reliable.Send(packet, m_ConnectedPlayers[e.PlayerID]);
return false;
}
@@ -437,7 +401,7 @@ bool Server::OnEntityDeleted(const Events::EntityDeleted & e)
if (!e.Cascaded) {
Packet packet = Packet(MessageType::EntityDeleted);
packet.WritePrimitive<EntityID>(e.DeletedEntity);
broadcast(packet);
reliableBroadcast(packet);
}
return false;
}
@@ -445,16 +409,79 @@ bool Server::OnEntityDeleted(const Events::EntityDeleted & e)
bool Server::OnComponentDeleted(const Events::ComponentDeleted & e)
{
if (!e.Cascaded) {
Packet packet = Packet(MessageType::ComponentDeleted);
packet.WritePrimitive<EntityID>(e.Entity);
packet.WriteString(e.ComponentType);
broadcast(packet);
if (shouldSendToClient(EntityWrapper(m_World, e.Entity))) {
Packet packet = Packet(MessageType::ComponentDeleted);
packet.WritePrimitive<EntityID>(e.Entity);
packet.WriteString(e.ComponentType);
reliableBroadcast(packet);
}
}
return false;
}
bool Server::OnPlayerDamage(const Events::PlayerDamage& e)
{
Packet packet(MessageType::OnPlayerDamage);
packet.WritePrimitive(e.Inflictor.ID);
packet.WritePrimitive(e.Victim.ID);
packet.WritePrimitive(e.Damage);
reliableBroadcast(packet);
return false;
}
void Server::parseClientPing()
{
LOG_INFO("%i: Parsing ping", m_PacketID);
PlayerID player = GetPlayerIDFromEndpoint();
if (player == -1) {
return;
}
// Return ping
Packet packet(MessageType::Ping, m_ConnectedPlayers[player].PacketID);
packet.WriteString("Ping received");
m_Reliable.Send(packet);
}
void Server::parsePing()
{
for (auto& kv : m_ConnectedPlayers) {
if (kv.second.TCPAddress == m_Address &&
kv.second.TCPPort == m_Port) {
kv.second.StopTime = std::clock();
break;
}
}
}
void Server::parseOnInputCommand(Packet& packet)
{
PlayerID player = -1;
// Check which player it was who sent the message
player = GetPlayerIDFromEndpoint();
if (player != -1) {
while (packet.DataReadSize() < packet.Size()) {
Events::InputCommand e;
e.Command = packet.ReadString();
e.PlayerID = player; // Set correct player id
e.Player = EntityWrapper(m_World, m_ConnectedPlayers.at(player).EntityID);
e.Value = packet.ReadPrimitive<float>();
m_EventBroker->Publish(e);
if (e.Command == "PrimaryFire" || e.Command == "Reload") {
m_InputCommandsToBroadcast.push_back(e);
}
//LOG_INFO("Server::parseOnInputCommand: Command is %s. Value is %f. PlayerID is %i.", e.Command.c_str(), e.Value, e.PlayerID);
}
}
}
void Server::parsePlayerTransform(Packet& packet)
{
PlayerID playerID = GetPlayerIDFromEndpoint();
if (playerID == -1) {
return;
}
glm::vec3 position;
glm::vec3 orientation;
position.x = packet.ReadPrimitive<float>();
@@ -464,11 +491,41 @@ void Server::parsePlayerTransform(Packet& packet)
orientation.y = packet.ReadPrimitive<float>();
orientation.z = packet.ReadPrimitive<float>();
PlayerID playerID = GetPlayerIDFromEndpoint(m_ReceiverEndpoint);
EntityWrapper player(m_World, m_ConnectedPlayers.at(playerID).EntityID);
bool hasAssaultWeapon = packet.ReadPrimitive<bool>();
int magazineAmmo;
int ammo;
if (hasAssaultWeapon) {
magazineAmmo = packet.ReadPrimitive<int>();
ammo = packet.ReadPrimitive<int>();
}
EntityWrapper player(m_World, m_ConnectedPlayers.at(playerID).EntityID);
if (player.Valid()) {
player["Transform"]["Position"] = position;
player["Transform"]["Orientation"] = orientation;
if (hasAssaultWeapon) {
player["AssaultWeapon"]["MagazineAmmo"] = magazineAmmo;
player["AssaultWeapon"]["Ammo"] = ammo;
}
}
}
bool Server::shouldSendToClient(EntityWrapper childEntity)
{
return childEntity.HasComponent("Player") || childEntity.FirstParentWithComponent("Player").Valid();
}
PlayerID Server::GetPlayerIDFromEndpoint()
{
// check both tcp and udp connection
for (auto& kv : m_ConnectedPlayers) {
if ((kv.second.TCPAddress == m_Address
&& kv.second.TCPPort == m_Port)
|| (kv.second.Endpoint.address() == m_Address
&& kv.second.Endpoint.port() == m_Port)) {
return kv.first;
}
}
return -1;
}
+107
View File
@@ -0,0 +1,107 @@
#include "Network/TCPClient.h"
using namespace boost::asio::ip;
TCPClient::TCPClient()
{
}
TCPClient::~TCPClient()
{
}
void TCPClient::Connect(std::string playerName, std::string address, int port)
{
if (m_Socket) {
if (m_IsConnected) {
Packet packet(MessageType::Connect, m_SendPacketID);
packet.WriteString(playerName);
Send(packet);
LOG_INFO("Connect message sent again!");
}
}
else if (!m_IsConnected) {
boost::system::error_code error = boost::asio::error::host_not_found;
m_Endpoint = tcp::endpoint(boost::asio::ip::address::from_string(address), port);
m_Socket = std::unique_ptr<tcp::socket>(new tcp::socket(m_IOService));
m_Socket->connect(m_Endpoint, error);
tcp::no_delay option(true);
m_Socket->set_option(option);
LOG_INFO(error.message().c_str());
if (!error) {
m_IsConnected = true;
Packet packet(MessageType::Connect, m_SendPacketID);
packet.WriteString(playerName);
Send(packet);
LOG_INFO("Connect message sent!");
}
// If error
else {
m_Socket->close();
m_Socket = nullptr;
}
}
}
void TCPClient::Disconnect()
{
if (!m_IsConnected) {
return;
}
m_Socket->shutdown(boost::asio::ip::tcp::socket::shutdown_both);
m_Socket->close();
m_Socket = nullptr;
m_IsConnected = false;
}
void TCPClient::Receive(Packet& packet)
{
size_t bytesRead = readBuffer(m_ReadBuffer);
if (bytesRead > 0) {
packet.ReconstructFromData(m_ReadBuffer, bytesRead);
}
}
size_t TCPClient::readBuffer(char* data)
{
if (!m_Socket) {
return 0;
}
boost::system::error_code error;
// Read size of packet
size_t bytesReceived = m_Socket->read_some(boost
::asio::buffer((void*)data, sizeof(int)),
error);
int sizeOfPacket = 0;
memcpy(&sizeOfPacket, data, sizeof(int));
// Read the rest of the message
bytesReceived += m_Socket->read_some(boost
::asio::buffer((void*)(data + bytesReceived), sizeOfPacket - bytesReceived),
error);
if (error) {
//LOG_ERROR("receive: %s", error.message().c_str());
}
return bytesReceived;
}
void TCPClient::Send(Packet & packet)
{
if (!m_Socket) {
LOG_WARNING("TCPClient::Send: Socket is null");
return;
}
packet.UpdateSize();
boost::system::error_code error;
m_Socket->send(boost::asio::buffer(
packet.Data(),
packet.Size()), 0, error);
}
bool TCPClient::IsSocketAvailable()
{
if (!m_Socket) {
return false;
}
return m_Socket->available();
}
+110
View File
@@ -0,0 +1,110 @@
#include "Network/TCPServer.h"
using namespace boost::asio::ip;
TCPServer::TCPServer()
{
acceptor = std::unique_ptr<tcp::acceptor>(new tcp::acceptor(m_IOService, tcp::endpoint(tcp::v4(), 27666)));
}
TCPServer::~TCPServer()
{
}
void TCPServer::AcceptNewConnections(int& nextPlayerID, std::map<PlayerID, PlayerDefinition>& connectedPlayers)
{
boost::shared_ptr<tcp::socket> newSocket = boost::shared_ptr<tcp::socket>(new tcp::socket(m_IOService));
m_IOService.poll();
acceptor->async_accept(*newSocket,
boost::bind(&TCPServer::handle_accept, this, newSocket, boost::ref(nextPlayerID), boost::ref(connectedPlayers),
boost::asio::placeholders::error));
}
PlayerID GetPlayerIDFromEndpoint(const std::map<PlayerID, PlayerDefinition>& connectedPlayers,
boost::asio::ip::address address, unsigned short port)
{
for (auto& kv : connectedPlayers) {
if (kv.second.TCPAddress == address &&
kv.second.TCPPort == port) {
return kv.first;
}
}
return -1;
}
void TCPServer::handle_accept(boost::shared_ptr<tcp::socket> socket,
int& nextPlayerID, std::map<PlayerID, PlayerDefinition>& connectedPlayers,
const boost::system::error_code& error)
{
if (!error && GetPlayerIDFromEndpoint(connectedPlayers, socket->remote_endpoint().address(),
socket->remote_endpoint().port()) == -1) {
// Add tcp socket to connections
boost::asio::ip::tcp::no_delay option(true);
socket->set_option(option);
PlayerDefinition pd;
pd.StopTime = std::clock();
pd.TCPSocket = socket;
pd.TCPAddress = socket.get()->remote_endpoint().address();
pd.TCPPort = socket.get()->remote_endpoint().port();
connectedPlayers[nextPlayerID++] = pd;
}
}
void TCPServer::Send(Packet & packet, PlayerDefinition & playerDefinition)
{
try {
packet.UpdateSize();
int bytesSent = playerDefinition.TCPSocket->send(
boost::asio::buffer(packet.Data(), packet.Size()),
0);
} catch (const boost::system::system_error& e) {
// TODO: Clean up invalid endpoints out of m_ConnectedPlayers later
playerDefinition.Endpoint = boost::asio::ip::udp::endpoint();
}
}
void TCPServer::Send(Packet & packet)
{
packet.UpdateSize();
lastReceivedSocket->send(
boost::asio::buffer(
packet.Data(),
packet.Size()),
0);
}
void TCPServer::Disconnect()
{
}
void TCPServer::Receive(Packet & packet, PlayerDefinition & playerDefinition)
{
int bytesRead = readBuffer(m_ReadBuffer, playerDefinition);
if (bytesRead > 0) {
packet.ReconstructFromData(m_ReadBuffer, bytesRead);
}
lastReceivedSocket = playerDefinition.TCPSocket;
}
int TCPServer::readBuffer(char* data, PlayerDefinition & playerDefinition)
{
if (!playerDefinition.TCPSocket) {
return 0;
}
boost::system::error_code error;
// Read size of packet
size_t bytesReceived = playerDefinition.TCPSocket->read_some(boost
::asio::buffer((void*)data, sizeof(int)),
error);
int sizeOfPacket = 0;
memcpy(&sizeOfPacket, data, sizeof(int));
// Read the rest of the message
bytesReceived += playerDefinition.TCPSocket->read_some(boost
::asio::buffer((void*)(data + bytesReceived), sizeOfPacket - bytesReceived),
error);
if (error) {
//LOG_ERROR("receive: %s", error.message().c_str());
}
return bytesReceived;
}
+66
View File
@@ -0,0 +1,66 @@
#include "Network/UDPClient.h"
using namespace boost::asio::ip;
UDPClient::UDPClient()
{
}
UDPClient::~UDPClient()
{
}
void UDPClient::Connect(std::string playerName, std::string address, int port)
{
if (m_Socket) {
return;
}
m_ReceiverEndpoint = udp::endpoint(boost::asio::ip::address::from_string(address), port);
m_Socket = boost::shared_ptr<boost::asio::ip::udp::socket>(new boost::asio::ip::udp::socket(m_IOService));
m_Socket->connect(m_ReceiverEndpoint);
}
void UDPClient::Disconnect()
{
}
void UDPClient::Receive(Packet& packet)
{
int bytesRead = readBuffer(m_ReadBuffer);
if (bytesRead > 0) {
packet.ReconstructFromData(m_ReadBuffer, bytesRead);
}
}
int UDPClient::readBuffer(char* data)
{
if (!m_Socket) {
return 0;
}
boost::system::error_code error;
int bytesReceived = m_Socket->receive_from(boost
::asio::buffer((void*)data, BUFFERSIZE),
m_ReceiverEndpoint,
0, error);
if (error) {
//LOG_ERROR("receive: %s", error.message().c_str());
}
return bytesReceived;
}
void UDPClient::Send(Packet& packet)
{
m_Socket->send_to(boost::asio::buffer(
packet.Data(),
packet.Size()),
m_ReceiverEndpoint, 0);
}
bool UDPClient::IsSocketAvailable()
{
if (!m_Socket) {
return false;
}
return m_Socket->available();
}
+62
View File
@@ -0,0 +1,62 @@
#include "Network/UDPServer.h"
UDPServer::UDPServer()
{
m_Socket = std::unique_ptr<boost::asio::ip::udp::socket>(new boost::asio::ip::udp::socket(m_IOService, boost::asio::ip::udp::endpoint(boost::asio::ip::udp::v4(), 27666)));
}
UDPServer::~UDPServer()
{ }
void UDPServer::Send(Packet& packet, PlayerDefinition & playerDefinition)
{
try {
int bytesSent = m_Socket->send_to(
boost::asio::buffer(packet.Data(), packet.Size()),
playerDefinition.Endpoint,
0);
} catch (const boost::system::system_error& e) {
// TODO: Clean up invalid endpoints out of m_ConnectedPlayers later
playerDefinition.Endpoint = boost::asio::ip::udp::endpoint();
}
}
// Send back to endpoint of received packet
void UDPServer::Send(Packet & packet)
{
m_Socket->send_to(
boost::asio::buffer(
packet.Data(),
packet.Size()),
m_ReceiverEndpoint,
0);
}
void UDPServer::Receive(Packet & packet, PlayerDefinition & playerDefinition)
{
int bytesRead = readBuffer(m_ReadBuffer);
if (bytesRead > 0) {
packet.ReconstructFromData(m_ReadBuffer, bytesRead);
}
playerDefinition.Endpoint = m_ReceiverEndpoint;
}
bool UDPServer::IsSocketAvailable()
{
return m_Socket->available();
}
int UDPServer::readBuffer(char* data)
{
boost::system::error_code error = boost::asio::error::host_not_found;
unsigned int length = m_Socket->receive_from(
boost::asio::buffer((void*)data
, BUFFERSIZE)
, m_ReceiverEndpoint, 0, error);
if (error) {
LOG_WARNING(error.message().c_str());
}
return length;
}
void UDPServer::AcceptNewConnections(int& nextPlayerID, std::map<PlayerID, PlayerDefinition>& connectedPlayers)
{ }
+26 -28
View File
@@ -42,22 +42,22 @@ void PickingPass::InitializeShaderPrograms()
m_PickingProgram->BindFragDataLocation(0, "TextureFragment");
m_PickingProgram->Link();
m_PickingSkinnedProgram = ResourceManager::Load<ShaderProgram>("#PickingSkinnedProgram");
m_PickingSkinnedProgram = ResourceManager::Load<ShaderProgram>("#PickingSkinnedProgram");
m_PickingSkinnedProgram->AddShader(std::shared_ptr<Shader>(new VertexShader("Shaders/PickingSkinned.vert.glsl")));
m_PickingSkinnedProgram->AddShader(std::shared_ptr<Shader>(new FragmentShader("Shaders/Picking.frag.glsl")));
m_PickingSkinnedProgram->Compile();
m_PickingSkinnedProgram->BindFragDataLocation(0, "TextureFragment");
m_PickingSkinnedProgram->Link();
m_PickingSkinnedProgram->AddShader(std::shared_ptr<Shader>(new VertexShader("Shaders/PickingSkinned.vert.glsl")));
m_PickingSkinnedProgram->AddShader(std::shared_ptr<Shader>(new FragmentShader("Shaders/Picking.frag.glsl")));
m_PickingSkinnedProgram->Compile();
m_PickingSkinnedProgram->BindFragDataLocation(0, "TextureFragment");
m_PickingSkinnedProgram->Link();
}
void PickingPass::Draw(RenderScene& scene)
{
PickingPassState* state = new PickingPassState(m_PickingBuffer.GetHandle());
//TODO: Render: Add code for more jobs than modeljobs.
GLuint shaderHandle = m_PickingProgram->GetHandle();
GLuint shaderSkinnedHandle = m_PickingSkinnedProgram->GetHandle();
GLuint shaderSkinnedHandle = m_PickingSkinnedProgram->GetHandle();
m_PickingProgram->Bind();
if (scene.ClearDepth) {
@@ -92,15 +92,14 @@ void PickingPass::Draw(RenderScene& scene)
m_PickingColorsToEntity[glm::ivec2(pickColor[0], pickColor[1])] = pickInfo;
if (modelJob->Model->IsSkinned())
{
m_PickingSkinnedProgram->Bind();
glUniformMatrix4fv(glGetUniformLocation(shaderSkinnedHandle, "M"), 1, GL_FALSE, glm::value_ptr(modelJob->Matrix));
glUniformMatrix4fv(glGetUniformLocation(shaderSkinnedHandle, "V"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ViewMatrix()));
glUniformMatrix4fv(glGetUniformLocation(shaderSkinnedHandle, "P"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix()));
glUniform2fv(glGetUniformLocation(shaderSkinnedHandle, "PickingColor"), 1, glm::value_ptr(glm::vec2(pickColor[0], pickColor[1])));
if (modelJob->Model->IsSkinned()) {
m_PickingSkinnedProgram->Bind();
glUniformMatrix4fv(glGetUniformLocation(shaderSkinnedHandle, "M"), 1, GL_FALSE, glm::value_ptr(modelJob->Matrix));
glUniformMatrix4fv(glGetUniformLocation(shaderSkinnedHandle, "V"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ViewMatrix()));
glUniformMatrix4fv(glGetUniformLocation(shaderSkinnedHandle, "P"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix()));
glUniform2fv(glGetUniformLocation(shaderSkinnedHandle, "PickingColor"), 1, glm::value_ptr(glm::vec2(pickColor[0], pickColor[1])));
if (modelJob->Model->m_RawModel->m_Skeleton != nullptr) {
if (modelJob->Model->m_RawModel->m_Skeleton != nullptr) {
std::vector<glm::mat4> frameBones;
if (modelJob->AnimationOffset.animation != nullptr) {
@@ -109,15 +108,14 @@ void PickingPass::Draw(RenderScene& scene)
frameBones = modelJob->Skeleton->GetFrameBones(modelJob->Animations);
}
glUniformMatrix4fv(glGetUniformLocation(shaderSkinnedHandle, "Bones"), frameBones.size(), GL_FALSE, glm::value_ptr(frameBones[0]));
}
} else {
}
} else {
m_PickingProgram->Bind();
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "M"), 1, GL_FALSE, glm::value_ptr(modelJob->Matrix));
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "V"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ViewMatrix()));
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "P"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix()));
glUniform2fv(glGetUniformLocation(shaderHandle, "PickingColor"), 1, glm::value_ptr(glm::vec2(pickColor[0], pickColor[1])));
}
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "M"), 1, GL_FALSE, glm::value_ptr(modelJob->Matrix));
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "V"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ViewMatrix()));
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "P"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix()));
glUniform2fv(glGetUniformLocation(shaderHandle, "PickingColor"), 1, glm::value_ptr(glm::vec2(pickColor[0], pickColor[1])));
}
glBindVertexArray(modelJob->Model->VAO);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, modelJob->Model->ElementBuffer);
@@ -207,7 +205,7 @@ void PickingPass::Draw(RenderScene& scene)
m_PickingColorsToEntity[glm::ivec2(pickColor[0], pickColor[1])] = pickInfo;
if(modelJob->Model->IsSkinned()) {
if (modelJob->Model->IsSkinned()) {
m_PickingSkinnedProgram->Bind();
glUniformMatrix4fv(glGetUniformLocation(shaderSkinnedHandle, "M"), 1, GL_FALSE, glm::value_ptr(modelJob->Matrix));
glUniformMatrix4fv(glGetUniformLocation(shaderSkinnedHandle, "V"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ViewMatrix()));
@@ -266,7 +264,7 @@ void PickingPass::Draw(RenderScene& scene)
if (modelJob->Model->IsSkinned()) {
m_PickingSkinnedProgram->Bind();
glUniformMatrix4fv(glGetUniformLocation(shaderSkinnedHandle, "M"), 1, GL_FALSE, glm::value_ptr(modelJob->Matrix));
glUniformMatrix4fv(glGetUniformLocation(shaderSkinnedHandle, "V"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ViewMatrix()));
@@ -293,7 +291,7 @@ void PickingPass::Draw(RenderScene& scene)
glUniform2fv(glGetUniformLocation(shaderHandle, "PickingColor"), 1, glm::value_ptr(glm::vec2(pickColor[0], pickColor[1])));
}
glBindVertexArray(modelJob->Model->VAO);
@@ -301,7 +299,7 @@ void PickingPass::Draw(RenderScene& scene)
glDrawElements(GL_TRIANGLES, modelJob->EndIndex - modelJob->StartIndex + 1, GL_UNSIGNED_INT, (void*)(modelJob->StartIndex * sizeof(unsigned int)));
}
}*/
m_PickingBuffer.Unbind();
GLERROR("PickingPass Error");
+5 -2
View File
@@ -79,7 +79,6 @@ void RenderSystem::fillSprites(std::list<std::shared_ptr<RenderJob>>& 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;
@@ -87,7 +86,11 @@ bool RenderSystem::isEntityVisible(EntityWrapper& entity)
// Hide things parented to local player if they have the HiddenFromLocalPlayer component
bool outOfBodyExperience = ResourceManager::Load<ConfigFile>("Config.ini")->Get<bool>("Debug.OutOfBodyExperience", false);
if (entity.HasComponent("HiddenForLocalPlayer") && (entity == m_LocalPlayer || entity.IsChildOf(m_LocalPlayer)) && !outOfBodyExperience) {
if (
(entity.HasComponent("HiddenForLocalPlayer") || entity.FirstParentWithComponent("HiddenForLocalPlayer").Valid())
&& (entity == m_LocalPlayer || entity.IsChildOf(m_LocalPlayer))
&& !outOfBodyExperience
) {
return false;
}
+1
View File
@@ -168,6 +168,7 @@ void Renderer::SortRenderJobsByDepth(RenderScene &scene)
//Sort all forward jobs so transparency is good.
scene.Jobs.TransparentObjects.sort(Renderer::DepthSort);
scene.Jobs.SpriteJob.sort(Renderer::DepthSort);
scene.Jobs.Text.sort(Renderer::DepthSort);
}
void Renderer::GenerateTexture(GLuint* texture, GLenum wrapping, GLenum filtering, glm::vec2 dimensions, GLint internalFormat, GLint format, GLenum type)
-5
View File
@@ -121,7 +121,6 @@ void Skeleton::AccumulateBoneTransforms(bool noRootMotion, std::vector<Animation
if (progress > 1.0f || progress < 0.0f) {
LOG_INFO("Progress: %f", progress);
progress = glm::clamp(progress, 0.0f, 1.0f);
}
Animation::Keyframe::BoneProperty currentBoneProperty = currentFrame.BoneProperties;
@@ -241,7 +240,6 @@ void Skeleton::AccumulateBoneTransforms(bool noRootMotion, std::vector<Animation
if (progress > 1.0f || progress < 0.0f) {
LOG_INFO("Progress: %f", progress);
progress = glm::clamp(progress, 0.0f, 1.0f);
}
Animation::Keyframe::BoneProperty currentBoneProperty = currentFrame.BoneProperties;
@@ -489,7 +487,6 @@ glm::mat4 Skeleton::GetBoneTransform(bool noRootMotion, const Bone* bone, std::v
if (progress > 1.0f || progress < 0.0f) {
LOG_INFO("Progress: %f", progress);
progress = glm::clamp(progress, 0.0f, 1.0f);
}
Animation::Keyframe::BoneProperty currentBoneProperty = currentFrame.BoneProperties;
@@ -609,12 +606,10 @@ glm::mat4 Skeleton::GetBoneTransform(bool noRootMotion, const Bone* bone, std::v
progress = (time - currentFrame.Time) / (animation->Duration - currentFrame.Time);
} else {
progress = (time - currentFrame.Time) / (nextFrame.Time - currentFrame.Time);
}
if (progress > 1.0f || progress < 0.0f) {
LOG_INFO("Progress: %f", progress);
progress = glm::clamp(progress, 0.0f, 1.0f);
}
Animation::Keyframe::BoneProperty currentBoneProperty = currentFrame.BoneProperties;
+1
View File
@@ -36,6 +36,7 @@ source_group(Network FILES ${SOURCE_FILES_Network})
set(SOURCE_FILES
${SOURCE_FILES}
"Game.cpp"
"MiniDump.cpp"
${SOURCE_FILES_Systems}
${SOURCE_FILES_Systems_Weapon}
${SOURCE_FILES_Events}
+9 -2
View File
@@ -18,12 +18,16 @@
#include "Game/Systems/DamageIndicatorSystem.h"
#include "Game/Systems/Weapon/WeaponSystem.h"
#include "Rendering/AnimationSystem.h"
#include "Game/Systems/PlayerHUDSystem.h"
#include "Game/Systems/HealthHUDSystem.h"
#include "Rendering/BoneAttachmentSystem.h"
#include "Game/Systems/LifetimeSystem.h"
#include "../Engine/Core/UniformScaleSystem.h"
#include "Rendering/AnimationSystem.h"
#include "Network/MultiplayerSnapshotFilter.h"
#include "Game/Systems/AmmunitionHUDSystem.h"
#include "Game/Systems/KillFeedSystem.h"
#include "Game/Systems/BoostSystem.h"
Game::Game(int argc, char* argv[])
{
@@ -127,6 +131,9 @@ Game::Game(int argc, char* argv[])
m_SystemPipeline->AddSystem<PickupSpawnSystem>(updateOrderLevel);
m_SystemPipeline->AddSystem<AmmoPickupSystem>(updateOrderLevel);
m_SystemPipeline->AddSystem<DamageIndicatorSystem>(updateOrderLevel);
m_SystemPipeline->AddSystem<AmmunitionHUDSystem>(updateOrderLevel);
m_SystemPipeline->AddSystem<KillFeedSystem>(updateOrderLevel);
m_SystemPipeline->AddSystem<BoostSystem>(updateOrderLevel);
// Populate Octree with collidables
++updateOrderLevel;
m_SystemPipeline->AddSystem<FillOctreeSystem>(updateOrderLevel, m_OctreeCollision, "Collidable");
@@ -134,8 +141,8 @@ Game::Game(int argc, char* argv[])
m_SystemPipeline->AddSystem<FillFrustumOctreeSystem>(updateOrderLevel, m_OctreeFrustrumCulling);
m_SystemPipeline->AddSystem<AnimationSystem>(updateOrderLevel);
m_SystemPipeline->AddSystem<UniformScaleSystem>(updateOrderLevel);
m_SystemPipeline->AddSystem<HealthHUDSystem>(updateOrderLevel);
m_SystemPipeline->AddSystem<PlayerDeathSystem>(updateOrderLevel);
m_SystemPipeline->AddSystem<PlayerHUDSystem>(updateOrderLevel);
// Collision and TriggerSystem should update after player.
++updateOrderLevel;
m_SystemPipeline->AddSystem<BoneAttachmentSystem>(updateOrderLevel);
+110
View File
@@ -0,0 +1,110 @@
/*
Author: Vladimir Sedach.
Purpose: demo of Call Stack creation by our own means,
and with MiniDumpWriteDump() function of DbgHelp.dll.
*/
#include <iostream>
#include <ctime>
#include <windows.h>
#include <tlhelp32.h>
//#include "dbghelp.h"
//#define DEBUG_DPRINTF 1 //allow d()
//#include "wfun.h"
#pragma optimize("y", off) //generate stack frame pointers for all functions - same as /Oy- in the project
#pragma warning(disable: 4200) //nonstandard extension used : zero-sized array in struct/union
#pragma warning(disable: 4100) //unreferenced formal parameter
// In case you don't have dbghelp.h.
#ifndef _DBGHELP_
typedef struct _MINIDUMP_EXCEPTION_INFORMATION {
DWORD ThreadId;
PEXCEPTION_POINTERS ExceptionPointers;
BOOL ClientPointers;
} MINIDUMP_EXCEPTION_INFORMATION, *PMINIDUMP_EXCEPTION_INFORMATION;
typedef enum _MINIDUMP_TYPE {
MiniDumpNormal = 0x00000000,
MiniDumpWithDataSegs = 0x00000001,
} MINIDUMP_TYPE;
typedef BOOL (WINAPI * MINIDUMP_WRITE_DUMP)(
IN HANDLE hProcess,
IN DWORD ProcessId,
IN HANDLE hFile,
IN MINIDUMP_TYPE DumpType,
IN CONST PMINIDUMP_EXCEPTION_INFORMATION ExceptionParam, OPTIONAL
IN PVOID UserStreamParam, OPTIONAL
IN PVOID CallbackParam OPTIONAL
);
#else
typedef BOOL (WINAPI * MINIDUMP_WRITE_DUMP)(
IN HANDLE hProcess,
IN DWORD ProcessId,
IN HANDLE hFile,
IN MINIDUMP_TYPE DumpType,
IN CONST PMINIDUMP_EXCEPTION_INFORMATION ExceptionParam, OPTIONAL
IN PMINIDUMP_USER_STREAM_INFORMATION UserStreamParam, OPTIONAL
IN PMINIDUMP_CALLBACK_INFORMATION CallbackParam OPTIONAL
);
#endif //#ifndef _DBGHELP_
HMODULE hDbgHelp;
MINIDUMP_WRITE_DUMP MiniDumpWriteDump_;
// Tool Help functions.
typedef HANDLE (WINAPI * CREATE_TOOL_HELP32_SNAPSHOT)(DWORD dwFlags, DWORD th32ProcessID);
//*************************************************************************************
void WINAPI Create_Dump(PEXCEPTION_POINTERS pException, BOOL File_Flag, BOOL Show_Flag)
//*************************************************************************************
// Create dump.
// pException can be either GetExceptionInformation() or NULL.
// If File_Flag = TRUE - write dump files (.dmz and .dmp) with the name of the current process.
// If Show_Flag = TRUE - show message with Get_Exception_Info() dump.
{
// Try to get MiniDumpWriteDump() address.
hDbgHelp = LoadLibrary("DBGHELP.DLL");
MiniDumpWriteDump_ = (MINIDUMP_WRITE_DUMP)GetProcAddress(hDbgHelp, "MiniDumpWriteDump");
// If MiniDumpWriteDump() of DbgHelp.dll available.
if (MiniDumpWriteDump_)
{
HANDLE hDump_File;
CHAR Dump_Path[MAX_PATH];
GetModuleFileName(NULL, Dump_Path, sizeof(Dump_Path)); //path of current process
std::time_t t = std::time(NULL);
char tStr[16];
std::strftime(tStr, 32, " %a %H-%M-%S", std::localtime(&t));
std::string time(tStr);
std::string path(Dump_Path);
path = path.substr(0, path.length() - 4);
path += time + ".dmp";
MINIDUMP_EXCEPTION_INFORMATION M;
M.ThreadId = GetCurrentThreadId();
M.ExceptionPointers = pException;
M.ClientPointers = 0;
hDump_File = CreateFile(path.c_str(), GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
MiniDumpWriteDump_(GetCurrentProcess(), GetCurrentProcessId(), hDump_File,
MiniDumpNormal, (pException) ? &M : NULL, NULL, NULL);
CloseHandle(hDump_File);
std::cout << "Memory dumped to: \"" << path.c_str() << "\"";
MessageBox(NULL, ("Application crashed, memory dumped to: " + path).c_str(), "MiniDump", MB_ICONHAND | MB_OK);
} else {
MessageBox(NULL, "Application crashed, memory dump failed.", "MiniDump", MB_ICONHAND | MB_OK);
}
}
+10 -1
View File
@@ -9,7 +9,16 @@ MultiplayerSnapshotFilter::MultiplayerSnapshotFilter(EventBroker* eventBroker)
bool MultiplayerSnapshotFilter::FilterComponent(EntityWrapper entity, SharedComponentWrapper& component)
{
if (entity == m_LocalPlayer || entity.IsChildOf(m_LocalPlayer)) {
return false;
if (
component.Info.Name == "Transform"
|| component.Info.Name == "Physics"
|| component.Info.Name == "AssaultWeapon"
|| component.Info.Name == "Animation"
|| component.Info.Name == "AnimationOffset"
|| entity.Name() == "PlayerName"
) {
return false;
}
}
if (component.Info.Name == "Physics") {
+36
View File
@@ -0,0 +1,36 @@
#include "Game/Systems/AmmunitionHUDSystem.h"
void AmmunitionHUDSystem::Update(double dt)
{
//Hud element for tracking ammunition from parent with AssaultWeapon component.Child with the name "MagazineAmmo" tracks clip ammunition.Child with the name "Ammo" tracks ammo.</xs:documentation>
auto ammunitionHUDs = m_World->GetComponents("AmmunitionHUD");
if (ammunitionHUDs == nullptr) {
return;
}
for (auto& ammunitionHUDComponent : *ammunitionHUDs) {
EntityWrapper entity = EntityWrapper(m_World, ammunitionHUDComponent.EntityID);
EntityWrapper playerEntity = entity.FirstParentWithComponent("AssaultWeapon");
if (!playerEntity.Valid()) {
return;
}
EntityWrapper magazineAmmo = entity.FirstChildByName("MagazineAmmo");
if(magazineAmmo.Valid()) {
if(magazineAmmo.HasComponent("Text")) {
(std::string&)magazineAmmo["Text"]["Content"] = std::to_string((int)playerEntity["AssaultWeapon"]["MagazineAmmo"]);
}
}
EntityWrapper ammo = entity.FirstChildByName("Ammo");
if (ammo.Valid()) {
if (ammo.HasComponent("Text")) {
(std::string&)ammo["Text"]["Content"] = std::to_string((int)playerEntity["AssaultWeapon"]["Ammo"]);
}
}
}
}
+63
View File
@@ -0,0 +1,63 @@
#include "Systems/BoostSystem.h"
BoostSystem::BoostSystem(SystemParams params)
: System(params)
{
EVENT_SUBSCRIBE_MEMBER(m_EPlayerDamage, &BoostSystem::OnPlayerDamage);
}
bool BoostSystem::OnPlayerDamage(Events::PlayerDamage& e)
{
if (e.Victim.ID == e.Inflictor.ID) {
return false;
}
if (!e.Victim.Valid() && e.Victim != LocalPlayer && !e.Victim.IsChildOf(LocalPlayer)) {
return false;
}
if (!e.Inflictor.Valid() || !e.Victim.Valid()) {
return false;
}
//if its not friendly fire, return
if ((int)m_World->GetComponent(e.Inflictor.ID, "Team")["Team"] != (int)m_World->GetComponent(e.Victim.ID, "Team")["Team"]) {
return false;
}
//determine the inflictors class
auto className = DetermineClass(e.Inflictor);
if (className == "") {
return false;
}
//get the XML file, example: "Schema/Entities/BoostclassName.xml"
std::string classXML = "Schema/Entities/" + className + ".xml";
//check if player already has a child with the component, if so delete that child
auto playerBoostAssaultEntity = e.Victim.FirstChildByName(className);
if (playerBoostAssaultEntity.Valid()) {
m_World->DeleteEntity(playerBoostAssaultEntity.ID);
}
//load boost XML file, set it entity parented with the victim player
auto entityFile = ResourceManager::Load<EntityFile>(classXML);
EntityFileParser parser(entityFile);
EntityID boostAssaultEntity = parser.MergeEntities(m_World);
m_World->SetName(boostAssaultEntity, className);
m_World->SetParent(boostAssaultEntity, e.Victim.ID);
return true;
}
std::string BoostSystem::DetermineClass(EntityWrapper inflictorPlayer)
{
//determine the class based on what component the inflictor-player has
if (m_World->HasComponent(inflictorPlayer.ID, "DashAbility")) {
return "BoostAssault";
}
if (m_World->HasComponent(inflictorPlayer.ID, "ShieldAbility")) {
return "BoostDefender";
}
if (m_World->HasComponent(inflictorPlayer.ID, "SprintAbility")) {
return "BoostSniper";
}
return "";
}
@@ -20,6 +20,10 @@ void CapturePointHUDSystem::Update(double dt)
return;
}
if(!CapturePointHUDElements) {
return;
}
for (auto& cCapturePointHUD : *CapturePointHUDElements) {
int HUD_ID = cCapturePointHUD["CapturePointNumber"];
EntityWrapper entityHUD = EntityWrapper(m_World, cCapturePointHUD.EntityID);
+9 -3
View File
@@ -6,15 +6,21 @@ CapturePointSystem::CapturePointSystem(SystemParams params)
, PureSystem("CapturePoint")
{
//subscribe/listenTo playerdamage,healthpickup events (using the eventBroker)
EVENT_SUBSCRIBE_MEMBER(m_ETriggerTouch, &CapturePointSystem::OnTriggerTouch);
EVENT_SUBSCRIBE_MEMBER(m_ETriggerLeave, &CapturePointSystem::OnTriggerLeave);
EVENT_SUBSCRIBE_MEMBER(m_ECaptured, &CapturePointSystem::OnCaptured);
if (IsClient) {
EVENT_SUBSCRIBE_MEMBER(m_ETriggerTouch, &CapturePointSystem::OnTriggerTouch);
EVENT_SUBSCRIBE_MEMBER(m_ETriggerLeave, &CapturePointSystem::OnTriggerLeave);
EVENT_SUBSCRIBE_MEMBER(m_ECaptured, &CapturePointSystem::OnCaptured);
}
}
//here all capturepoints will update their component
//NOTE: needs to run each frame, since we're possibly modifying the captureTimer for the capturePoints by dt
void CapturePointSystem::UpdateComponent(EntityWrapper& capturePointEntity, ComponentWrapper& cCapturePoint, double dt)
{
if (!IsClient) {
return;
}
if (m_WinnerWasFound) {
return;
}
+5 -2
View File
@@ -18,12 +18,15 @@ bool DamageIndicatorSystem::OnPlayerDamage(Events::PlayerDamage& e)
return false;
}
if (e.Victim != LocalPlayer) {
//if (e.Victim != LocalPlayer) {
// return false;
//}
if (e.Victim.Valid() && e.Victim != LocalPlayer && !e.Victim.IsChildOf(LocalPlayer)) {
return false;
}
if (!e.Inflictor.Valid() || !e.Victim.Valid()) {
return false;
return false;
}
//grab players direction
@@ -1,6 +1,6 @@
#include "Game/Systems/PlayerHUDSystem.h"
#include "Game/Systems/HealthHUDSystem.h"
void PlayerHUDSystem::Update(double dt)
void HealthHUDSystem::Update(double dt)
{
auto healthHUDs = m_World->GetComponents("HealthHUD");
if (healthHUDs == nullptr) {
@@ -27,13 +27,13 @@ void PlayerHUDSystem::Update(double dt)
s = s + "/";
s = s + std::to_string((int)(double)entityIDParent["Health"]["MaxHealth"]);
float healthPercentage = (double)entityIDParent["Health"]["Health"]/(double)entityIDParent["Health"]["MaxHealth"];
(glm::vec4&)entity["Text"]["Color"] = glm::vec4(1.0 - healthPercentage, 0.f, healthPercentage, 1.f);
//(glm::vec4&)entity["Text"]["Color"] = glm::vec4(1.0 - healthPercentage, 0.f, healthPercentage, glm::vec4(entity["Text"]["Color"]).a);
entity["Text"]["Content"] = s;
}
if(entity.HasComponent("Fill")) {
float healthPercentage = (double)entityIDParent["Health"]["Health"]/(double)entityIDParent["Health"]["MaxHealth"];
(glm::vec4&)entity["Fill"]["Color"] = glm::vec4(1.0 - healthPercentage, 0.f, healthPercentage, 0.f);
(glm::vec4&)entity["Fill"]["Color"] = glm::vec4(1.0 - healthPercentage, 0.f, healthPercentage, glm::vec4(entity["Fill"]["Color"]).a);
(double&)entity["Fill"]["Percentage"] = healthPercentage;
}
+19 -8
View File
@@ -8,24 +8,34 @@ HealthSystem::HealthSystem(SystemParams params)
EVENT_SUBSCRIBE_MEMBER(m_EPlayerDamage, &HealthSystem::OnPlayerDamaged);
EVENT_SUBSCRIBE_MEMBER(m_EPlayerHealthPickup, &HealthSystem::OnPlayerHealthPickup);
EVENT_SUBSCRIBE_MEMBER(m_InputCommand, &HealthSystem::OnInputCommand);
m_NetworkEnabled = ResourceManager::Load<ConfigFile>("Config.ini")->Get("Networking.StartNetwork", false);
}
void HealthSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapper& component, double dt)
void HealthSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapper& cHealth, double dt)
{
double& health = cHealth["Health"];
if (health <= 0.0) {
Events::PlayerDeath ePlayerDeath;
ePlayerDeath.Player = entity;
m_EventBroker->Publish(ePlayerDeath);
//Note: we will delete the entity in PlayerDeathSystem
}
}
bool HealthSystem::OnPlayerDamaged(Events::PlayerDamage& e)
{
if (!IsServer && m_NetworkEnabled) {
return false;
}
ComponentWrapper cHealth = e.Victim["Health"];
double& health = cHealth["Health"];
health -= e.Damage;
if (health <= 0.0) {
Events::PlayerDeath ePlayerDeath;
ePlayerDeath.Player = e.Victim;
m_EventBroker->Publish(ePlayerDeath);
//Note: we will delete the entity in PlayerDeathSystem
//if player has the boost from a defender, subtract the damage taken by StrengthOfEffect amount
auto playerBoostDefenderEntity = e.Victim.FirstChildByName("BoostDefender");
if (playerBoostDefenderEntity.Valid()) {
e.Damage -= (double)playerBoostDefenderEntity["BoostDefender"]["StrengthOfEffect"];
}
health -= e.Damage;
return true;
}
@@ -34,6 +44,7 @@ bool HealthSystem::OnInputCommand(Events::InputCommand& e)
{
if (e.Command == "TakeDamage" && e.Value > 0 && LocalPlayer.Valid()) {
Events::PlayerDamage ev;
ev.Inflictor = LocalPlayer;
ev.Victim = LocalPlayer;
ev.Damage = e.Value;
m_EventBroker->Publish(ev);
+80
View File
@@ -0,0 +1,80 @@
#include "Game/Systems/KillFeedSystem.h"
void KillFeedSystem::Update(double dt)
{
auto killFeeds = m_World->GetComponents("KillFeed");
if (killFeeds == nullptr) {
return;
}
for (auto& killFeedComponent : *killFeeds) {
EntityWrapper entity = EntityWrapper(m_World, killFeedComponent.EntityID);
for (int i = 1; i <= 3; i++) {
EntityWrapper child = entity.FirstChildByName("KillFeed" + std::to_string(i));
if (child.HasComponent("Text")) {
(std::string&)child["Text"]["Content"] = "";
}
}
int feedIndex = 1;
for (auto it = m_DeathQueue.begin(); it != m_DeathQueue.end(); ) {
bool remove = false;
EntityWrapper child = entity.FirstChildByName("KillFeed" + std::to_string(feedIndex));
if (child.HasComponent("Text")) {
(std::string&)child["Text"]["Content"] = (*it).Content;
(glm::vec4&)child["Text"]["Color"] = (*it).Color;
(*it).TimeToLive -= dt;
if ((*it).TimeToLive <= 0.f) {
(std::string&)child["Text"]["Content"] = "";
(glm::vec4&)child["Text"]["Color"] = (*it).Color;
remove = true;
}
}
feedIndex++;
if(feedIndex > 3) {
break;
}
if(remove) {
it = m_DeathQueue.erase(it);
} else {
it++;
}
}
}
}
bool KillFeedSystem::OnPlayerDeath(Events::PlayerDeath& e)
{
KillFeedInfo kfInfo;
if (e.Player.HasComponent("Team")) {
int red = e.Player["Team"].Enum("Team", "Red");
int blue = e.Player["Team"].Enum("Team", "Blue");
if ((int)e.Player["Team"]["Team"] == red) {
kfInfo.Content = "Blue Player killed Red Player";
kfInfo.Color = glm::vec4(0.f, 0.2f, 1.f, 0.8f);
m_DeathQueue.push_back(kfInfo);
} else if ((int)e.Player["Team"]["Team"] == blue) {
kfInfo.Content = "Red Player killed blue Player";
kfInfo.Color = glm::vec4(1.f, 0.f, 0.f, 0.8f);
m_DeathQueue.push_back(kfInfo);
}
}
if(m_DeathQueue.size() > 3) {
m_DeathQueue.pop_front();
}
return true;
}
+40 -17
View File
@@ -40,7 +40,8 @@ void PlayerMovementSystem::updateMovementControllers(double dt)
EntityWrapper playerModel = player.FirstChildByName("PlayerModel");
if (playerModel.Valid()) {
ComponentWrapper cAnimationOffset = playerModel["AnimationOffset"];
double time = (cameraOrientation.x + glm::half_pi<float>()) / glm::pi<float>();
float pitch = cameraOrientation.x + 0.2;
double time = (pitch + glm::half_pi<float>()) / glm::pi<float>();
cAnimationOffset["Time"] = time;
}
}
@@ -52,6 +53,19 @@ void PlayerMovementSystem::updateMovementControllers(double dt)
float playerMovementSpeed = player["Player"]["MovementSpeed"];
float playerCrouchSpeed = player["Player"]["CrouchSpeed"];
glm::vec3& wishDirection = player["Player"]["CurrentWishDirection"];
auto playerBoostAssaultEntity = player.FirstChildByName("BoostAssault");
if (playerBoostAssaultEntity.Valid()) {
playerMovementSpeed *= (double)playerBoostAssaultEntity["BoostAssault"]["StrengthOfEffect"];
playerCrouchSpeed *= (double)playerBoostAssaultEntity["BoostAssault"]["StrengthOfEffect"];
}
bool sniperSprinting = false;
if (player.HasComponent("SprintAbility")) {
if (controller->SniperSprintingCheck()) {
playerMovementSpeed *= (double)player["SprintAbility"]["StrengthOfEffect"];
playerCrouchSpeed *= (double)player["SprintAbility"]["StrengthOfEffect"];
sniperSprinting = true;
}
}
if (player.HasComponent("Physics")) {
ComponentWrapper cPhysics = player["Physics"];
@@ -78,18 +92,18 @@ void PlayerMovementSystem::updateMovementControllers(double dt)
}
glm::vec3& velocity = cPhysics["Velocity"];
bool isOnGround = (bool)cPhysics["IsOnGround"];
ImGui::Text(isOnGround ? "On ground" : "In air");
ImGui::Text("velocity: (%f, %f, %f) |%f|", velocity.x, velocity.y, velocity.z, glm::length(velocity));
//ImGui::Text(isOnGround ? "On ground" : "In air");
//ImGui::Text("velocity: (%f, %f, %f) |%f|", velocity.x, velocity.y, velocity.z, glm::length(velocity));
glm::vec3 groundVelocity(0.f, 0.f, 0.f);
groundVelocity.x = velocity.x;
groundVelocity.z = velocity.z;
ImGui::Text("groundVelocity: (%f, %f, %f) |%f|", groundVelocity.x, groundVelocity.y, groundVelocity.z, glm::length(groundVelocity));
ImGui::Text("wishDirection: (%f, %f, %f) |%f|", wishDirection.x, wishDirection.y, wishDirection.z, glm::length(wishDirection));
//ImGui::Text("groundVelocity: (%f, %f, %f) |%f|", groundVelocity.x, groundVelocity.y, groundVelocity.z, glm::length(groundVelocity));
//ImGui::Text("wishDirection: (%f, %f, %f) |%f|", wishDirection.x, wishDirection.y, wishDirection.z, glm::length(wishDirection));
float currentSpeedProj = glm::dot(groundVelocity, wishDirection);
float addSpeed = wishSpeed - currentSpeedProj;
ImGui::Text("currentSpeedProj: %f", currentSpeedProj);
ImGui::Text("wishSpeed: %f", wishSpeed);
ImGui::Text("addSpeed: %f", addSpeed);
//ImGui::Text("currentSpeedProj: %f", currentSpeedProj);
//ImGui::Text("wishSpeed: %f", wishSpeed);
//ImGui::Text("addSpeed: %f", addSpeed);
if (addSpeed > 0) {
static float accel = 15.f;
@@ -103,6 +117,13 @@ void PlayerMovementSystem::updateMovementControllers(double dt)
//if doubleTapped do Assault Dash - but only boost maximum 50.0f
float doubleTapDashBoost = controller->AssaultDashDoubleTapped() ? 40.0f : 1.0f;
accelerationSpeed = glm::min(doubleTapDashBoost*glm::min(accelerationSpeed, addSpeed), 50.0f);
//if player has Boost from an Assault class, accelerate the player faster
if (playerBoostAssaultEntity.Valid()) {
accelerationSpeed *= (double)playerBoostAssaultEntity["BoostAssault"]["StrengthOfEffect"];
}
if (sniperSprinting) {
accelerationSpeed *= (double)player["SprintAbility"]["StrengthOfEffect"];
}
velocity += accelerationSpeed * wishDirection;
ImGui::Text("velocity: (%f, %f, %f) |%f|", velocity.x, velocity.y, velocity.z, glm::length(velocity));
}
@@ -113,15 +134,17 @@ void PlayerMovementSystem::updateMovementControllers(double dt)
if (isOnGround) {
controller->SetDoubleJumping(false);
} else {
//put a hexagon at the players feet
auto hexagonEffect = ResourceManager::Load<EntityFile>("Schema/Entities/DoubleJumpHexagon.xml");
EntityFileParser parser(hexagonEffect);
EntityID hexagonEffectID = parser.MergeEntities(m_World);
EntityWrapper hexagonEW = EntityWrapper(m_World, hexagonEffectID);
hexagonEW["Transform"]["Position"] = (glm::vec3)player["Transform"]["Position"];
controller->SetDoubleJumping(true);
Events::DoubleJump e;
m_EventBroker->Publish(e);
if (IsClient) {
//put a hexagon at the players feet
auto hexagonEffect = ResourceManager::Load<EntityFile>("Schema/Entities/DoubleJumpHexagon.xml");
EntityFileParser parser(hexagonEffect);
EntityID hexagonEffectID = parser.MergeEntities(m_World);
EntityWrapper hexagonEW = EntityWrapper(m_World, hexagonEffectID);
hexagonEW["Transform"]["Position"] = (glm::vec3)player["Transform"]["Position"];
controller->SetDoubleJumping(true);
Events::DoubleJump e;
m_EventBroker->Publish(e);
}
}
velocity.y = 4.f;
}
+15 -7
View File
@@ -126,11 +126,18 @@ bool PlayerSpawnSystem::OnPlayerSpawned(Events::PlayerSpawned& e)
m_PlayerIDs[e.Player.ID] = e.PlayerID;
// When a player is actually spawned (since the actual spawning is handled on the server)
// Hack should be moved.
// TODO: Set the player name to whatever
EntityWrapper playerName = e.Player.FirstChildByName("PlayerName");
if (playerName.Valid()) {
playerName["Text"]["Content"] = e.PlayerName;
}
if (!IsClient) {
return false;
}
// Set the camera to the correct entity
EntityWrapper cameraEntity = e.Player.FirstChildByName("Camera");
bool outOfBodyExperience = ResourceManager::Load<ConfigFile>("Config.ini")->Get<bool>("Debug.OutOfBodyExperience", false);
@@ -152,12 +159,6 @@ bool PlayerSpawnSystem::OnPlayerSpawned(Events::PlayerSpawned& e)
}
}
// TODO: Set the player name to whatever
EntityWrapper playerName = e.Player.FirstChildByName("PlayerName");
if (playerName.Valid()) {
playerName["Text"]["Content"] = e.PlayerName;
}
return true;
}
@@ -175,8 +176,15 @@ bool PlayerSpawnSystem::OnPlayerDeath(Events::PlayerDeath& e)
if ((ComponentInfo::EnumType)cTeam["Team"] == cTeam["Team"].Enum("Spectator")) {
return false;
}
if (m_PlayerIDs.count(e.Player.ID) == 0) {
return false;
}
SpawnRequest req;
req.PlayerID = m_PlayerIDs.at(e.Player.ID);
req.Team = cTeam["Team"];
m_SpawnRequests.push_back(req);
return true;
}
+13 -7
View File
@@ -6,13 +6,15 @@ SoundSystem::SoundSystem(SystemParams params)
{
ConfigFile* config = ResourceManager::Load<ConfigFile>("Config.ini");
m_Announcer = ResourceManager::Load<ConfigFile>("Config.ini")->Get<std::string>("Sound.Announcer", "female");
EVENT_SUBSCRIBE_MEMBER(m_EPlayerSpawned, &SoundSystem::OnPlayerSpawned);
EVENT_SUBSCRIBE_MEMBER(m_InputCommand, &SoundSystem::OnInputCommand);
EVENT_SUBSCRIBE_MEMBER(m_EDoubleJump, &SoundSystem::OnDoubleJump);
EVENT_SUBSCRIBE_MEMBER(m_EDashAbility, &SoundSystem::OnDashAbility);
EVENT_SUBSCRIBE_MEMBER(m_EPlayerDamage, &SoundSystem::OnPlayerDamage);
EVENT_SUBSCRIBE_MEMBER(m_ECaptured, &SoundSystem::OnCaptured);
EVENT_SUBSCRIBE_MEMBER(m_ETriggerTouch, &SoundSystem::OnTriggerTouch);
if (IsClient) {
EVENT_SUBSCRIBE_MEMBER(m_EPlayerSpawned, &SoundSystem::OnPlayerSpawned);
EVENT_SUBSCRIBE_MEMBER(m_InputCommand, &SoundSystem::OnInputCommand);
EVENT_SUBSCRIBE_MEMBER(m_EDoubleJump, &SoundSystem::OnDoubleJump);
EVENT_SUBSCRIBE_MEMBER(m_EDashAbility, &SoundSystem::OnDashAbility);
EVENT_SUBSCRIBE_MEMBER(m_EPlayerDamage, &SoundSystem::OnPlayerDamage);
EVENT_SUBSCRIBE_MEMBER(m_ECaptured, &SoundSystem::OnCaptured);
EVENT_SUBSCRIBE_MEMBER(m_ETriggerTouch, &SoundSystem::OnTriggerTouch);
}
}
void SoundSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapper& cComponent, double dt)
@@ -20,6 +22,10 @@ void SoundSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapper& cComp
void SoundSystem::Update(double dt)
{
if (!IsClient) {
return;
}
// Temp for play test.
if (m_DrumsIsPlaying) {
m_DrumsIsPlaying = !drumTimer(dt);
@@ -4,6 +4,7 @@ AssaultWeaponBehaviour::AssaultWeaponBehaviour(SystemParams systemParams, IRende
: WeaponBehaviour(systemParams, renderer, collisionOctree, player)
{
m_FirstPersonModel = m_Player.FirstChildByName("Hands");
m_ThirdPersonModel = m_Player.FirstChildByName("PlayerModel");
EVENT_SUBSCRIBE_MEMBER(m_EAnimationComplete, &AssaultWeaponBehaviour::OnAnimationComplete);
}
@@ -37,12 +38,18 @@ void AssaultWeaponBehaviour::Reload()
// Don't reload if we're completly out of ammo
if (ammo == 0) {
playEmptySound();
m_TimeSinceLastFire = -0.0f; // HACK: To make empty sound play with interval
return;
}
m_Reloading = true;
m_ReloadTimer = cAssaultWeapon["ReloadTime"];
playReloadAnimation();
Events::PlaySoundOnEntity e;
e.EmitterID = cAssaultWeapon.EntityID;
e.FilePath = "Audio/weapon/reload.wav";
m_EventBroker->Publish(e);
}
void AssaultWeaponBehaviour::Update(double dt)
@@ -50,9 +57,14 @@ void AssaultWeaponBehaviour::Update(double 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 (IsClient) {
if (m_ReloadTimer <= (double)m_Player["AssaultWeapon"]["ReloadTime"] / 2.0) {
if (m_FirstPersonReloadImpersonator.Valid()) {
m_FirstPersonReloadImpersonator["Model"]["GlowMap"] = true;
}
if (m_ThirdPersonReloadImpersonator.Valid()) {
m_ThirdPersonReloadImpersonator["Model"]["GlowMap"] = true;
}
}
}
if (m_ReloadTimer <= 0) {
@@ -69,14 +81,18 @@ void AssaultWeaponBehaviour::Update(double dt)
}
if (!m_Firing && !m_Reloading) {
playIdleAnimation();
if (IsClient) {
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();
if (IsClient) {
EntityWrapper firstPersonWeaponModel = m_Player.FirstChildByName("WeaponModel");
if (firstPersonWeaponModel.Valid()) {
firstPersonWeaponModel["Model"]["GlowMap"] = hasAmmo();
}
}
}
@@ -117,20 +133,23 @@ void AssaultWeaponBehaviour::fireRound()
if (magAmmo <= 0) {
Reload();
return;
}
}
// Fire
magAmmo -= 1;
spawnTracer();
playSound();
viewPunch();
playShootAnimation();
bool hit = shoot(cAssaultWeapon["BaseDamage"]);
if (hit) {
showHitMarker();
}
m_TimeSinceLastFire = 0.0;
// Effects
if (IsClient) {
spawnTracer();
playFireSound();
viewPunch();
playShootAnimation();
bool hit = shoot(cAssaultWeapon["BaseDamage"]);
if (hit) {
showHitMarker();
}
}
}
void AssaultWeaponBehaviour::spawnTracer()
@@ -140,7 +159,8 @@ void AssaultWeaponBehaviour::spawnTracer()
}
EntityWrapper spawner;
if (m_Player == LocalPlayer) {
bool outOfBodyExperience = ResourceManager::Load<ConfigFile>("Config.ini")->Get<bool>("Debug.OutOfBodyExperience", false);
if (m_Player == LocalPlayer && !outOfBodyExperience) {
spawner = m_Player.FirstChildByName("WeaponMuzzle");
} else {
spawner = m_Player.FirstChildByName("ThirdPersonWeaponMuzzle");
@@ -168,7 +188,7 @@ float AssaultWeaponBehaviour::traceRayDistance(glm::vec3 origin, glm::vec3 direc
}
}
void AssaultWeaponBehaviour::playSound()
void AssaultWeaponBehaviour::playFireSound()
{
if (!IsClient) {
return;
@@ -180,6 +200,19 @@ void AssaultWeaponBehaviour::playSound()
m_EventBroker->Publish(e);
}
void AssaultWeaponBehaviour::playEmptySound()
{
if (!IsClient) {
return;
}
Events::PlaySoundOnEntity e;
e.EmitterID = m_Player.ID;
e.FilePath = "Audio/weapon/zeroAmmo.wav";
m_EventBroker->Publish(e);
}
void AssaultWeaponBehaviour::viewPunch()
{
EntityWrapper playerCamera = m_Player.FirstChildByName("Camera");
@@ -206,7 +239,13 @@ void AssaultWeaponBehaviour::finishReload()
// Make real first person weapon model visible again
EntityWrapper firstPersonWeaponModel = m_Player.FirstChildByName("WeaponModel");
firstPersonWeaponModel["Model"]["Visible"] = true;
if (firstPersonWeaponModel.Valid()) {
firstPersonWeaponModel["Model"]["Visible"] = true;
}
EntityWrapper thirdPersonWeaponModel = m_Player.FirstChildByName("ThirdPersonWeaponModel");
if (thirdPersonWeaponModel.Valid()) {
thirdPersonWeaponModel["Model"]["Visible"] = true;
}
m_Reloading = false;
}
@@ -259,19 +298,45 @@ 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;
// First person
if (IsClient)
{
ComponentWrapper cAnimation = m_FirstPersonModel["Animation"];
cAnimation["AnimationName1"] = "ReloadSwitch";
cAnimation["Weight1"] = 1.0;
cAnimation["Time1"] = 0.0;
cAnimation["Speed1"] = 0.5;
cAnimation["Loop1"] = true;
}
// TODO: Third person
//{
// ComponentWrapper cAnimation = m_ThirdPersonModel["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;
{
EntityWrapper firstPersonWeaponModel = m_Player.FirstChildByName("WeaponModel");
EntityWrapper reloadSpawner = m_Player.FirstChildByName("FirstPersonReloadSpawner");
if (IsClient) {
m_FirstPersonReloadImpersonator = SpawnerSystem::Spawn(reloadSpawner, reloadSpawner);
firstPersonWeaponModel["Model"].Copy(m_FirstPersonReloadImpersonator["Model"]);
}
firstPersonWeaponModel["Model"]["Visible"] = false;
}
{
EntityWrapper thirdPersonWeaponModel = m_Player.FirstChildByName("ThirdPersonWeaponModel");
EntityWrapper reloadSpawner = m_Player.FirstChildByName("ThirdPersonReloadSpawner");
if (IsClient) {
m_ThirdPersonReloadImpersonator = SpawnerSystem::Spawn(reloadSpawner, reloadSpawner);
thirdPersonWeaponModel["Model"].Copy(m_ThirdPersonReloadImpersonator["Model"]);
}
thirdPersonWeaponModel["Model"]["Visible"] = false;
}
}
bool AssaultWeaponBehaviour::shoot(double damage)
@@ -302,6 +367,9 @@ bool AssaultWeaponBehaviour::shoot(double damage)
}
EntityWrapper victim(m_World, pickData.Entity);
if (!victim.Valid()) {
return false;
}
// Don't let us shoot ourselves in the foot
if (victim == LocalPlayer) {
@@ -316,9 +384,10 @@ bool AssaultWeaponBehaviour::shoot(double damage)
return false;
}
// Check for friendly fire
// If friendly fire - reduce damage to 0 (needed to make Boosts, Ammosharing work)
if ((ComponentInfo::EnumType)victim["Team"]["Team"] == (ComponentInfo::EnumType)m_Player["Team"]["Team"]) {
return false;
damage = 0;
}
// Deal damage!
@@ -337,5 +406,9 @@ void AssaultWeaponBehaviour::showHitMarker()
EntityWrapper hitMarkerSpawner = m_Player.FirstChildByName("HitMarkerSpawner");
if (hitMarkerSpawner.Valid()) {
SpawnerSystem::Spawn(hitMarkerSpawner, hitMarkerSpawner);
Events::PlaySoundOnEntity e;
e.EmitterID = m_Player.ID;
e.FilePath = "Audio/weapon/hitclick.wav";
m_EventBroker->Publish(e);
}
}
+18 -4
View File
@@ -1,11 +1,25 @@
#include "Game.h"
#include "MiniDump.h"
LONG WINAPI CrashHandler(EXCEPTION_POINTERS* pException);
int main(int argc, char* argv[])
{
Game game(argc, argv);
while (game.Running()) {
game.Tick();
}
::SetUnhandledExceptionFilter(CrashHandler);
Game game(argc, argv);
while (game.Running()) {
game.Tick();
}
return 0;
}
LONG WINAPI CrashHandler(EXCEPTION_POINTERS* pException)
{
//Take minidump. path should be bin/TacticalZ.dmp
//Then show MessageBox, and exit application.
Create_Dump(pException, 1, 1);
return EXCEPTION_EXECUTE_HANDLER;// EXCEPTION_CONTINUE_SEARCH
}