Sfoglia il codice sorgente

Updates from PR feedback

Signed-off-by: kberg-amzn <[email protected]>
kberg-amzn 2 anni fa
parent
commit
d6feb41e80

+ 3 - 1
Gem/Code/Source/AutoGen/NetworkPlayerMovementComponent.AutoComponent.xml

@@ -41,7 +41,8 @@
         IsReliable="true"
         GenerateEventBindings="true"
         Description="Applies an impulse directly to the players self generated velocity">
-        <Param Type="AZ::Vector3" Name="Impulse"/>
+        <Param Type="AZ::Vector3" Name="Impulse" />
+        <Param Type="bool" Name="External" Description="If true, the impulse will be applied to the external velocity, and if false it will be applied to internal velocity" />
     </RemoteProcedure>
 
     <RemoteProcedure
@@ -53,6 +54,7 @@
         GenerateEventBindings="true"
         Description="Directly sets the self generated velocity to the provided value, overriding any current velocity values">
         <Param Type="AZ::Vector3" Name="Velocity"/>
+        <Param Type="bool" Name="External" Description="If true, the impulse will be applied to the external velocity, and if false it will be applied to internal velocity" />
     </RemoteProcedure>
 
     <ArchetypeProperty Type="float" Name="WalkSpeed"    Init="3.0f" ExposeToEditor="true" Description="Walk speed, units in meters per second" />

+ 0 - 2
Gem/Code/Source/Components/Multiplayer/EnergyBallComponent.cpp

@@ -36,7 +36,6 @@ namespace MultiplayerSample
 
     void EnergyBallComponent::OnDeactivate([[maybe_unused]] Multiplayer::EntityIsMigrating entityIsMigrating)
     {
-        ;
     }
 
 #if AZ_TRAIT_CLIENT
@@ -51,7 +50,6 @@ namespace MultiplayerSample
     EnergyBallComponentController::EnergyBallComponentController(EnergyBallComponent& parent)
         : EnergyBallComponentControllerBase(parent)
     {
-        ;
     }
 
     void EnergyBallComponentController::OnActivate([[maybe_unused]] Multiplayer::EntityIsMigrating entityIsMigrating)

+ 0 - 1
Gem/Code/Source/Components/Multiplayer/EnergyCannonComponent.cpp

@@ -34,7 +34,6 @@ namespace MultiplayerSample
 
     void EnergyCannonComponent::OnDeactivate([[maybe_unused]] Multiplayer::EntityIsMigrating entityIsMigrating)
     {
-        ;
     }
 
 #if AZ_TRAIT_CLIENT

+ 21 - 6
Gem/Code/Source/Components/NetworkPlayerMovementComponent.cpp

@@ -54,7 +54,7 @@ namespace MultiplayerSample
         , m_updateAI{ [this] { UpdateAI(); }, AZ::Name{ "MovementControllerAi" } }
 #endif
 #if AZ_TRAIT_CLIENT
-        , m_updateLocalBot{ [this] { UpdateLocalBot(); }, AZ::Name{ "MovementControllerLocalBot" } }
+    , m_updateLocalBot{ [this] { UpdateLocalBot(); }, AZ::Name{ "MovementControllerLocalBot" } }
 #endif
     {
         ;
@@ -279,15 +279,30 @@ namespace MultiplayerSample
     }
 
 #if AZ_TRAIT_SERVER
-    void NetworkPlayerMovementComponentController::HandleApplyImpulse([[maybe_unused]] AzNetworking::IConnection* connection, const AZ::Vector3& impulse)
+    void NetworkPlayerMovementComponentController::HandleApplyImpulse([[maybe_unused]] AzNetworking::IConnection* connection, const AZ::Vector3& impulse, const bool& external)
     {
-        const AZ::Vector3 newVelocity = GetSelfGeneratedVelocity() + impulse;
-        SetSelfGeneratedVelocity(newVelocity);
+        if (external)
+        {
+            const AZ::Vector3 newVelocity = GetVelocityFromExternalSources() + impulse;
+            SetVelocityFromExternalSources(newVelocity);
+        }
+        else
+        {
+            const AZ::Vector3 newVelocity = GetSelfGeneratedVelocity() + impulse;
+            SetSelfGeneratedVelocity(newVelocity);
+        }
     }
 
-    void NetworkPlayerMovementComponentController::HandleSetVelocity([[maybe_unused]] AzNetworking::IConnection* connection, const AZ::Vector3& velocity)
+    void NetworkPlayerMovementComponentController::HandleSetVelocity([[maybe_unused]] AzNetworking::IConnection* connection, const AZ::Vector3& velocity, const bool& external)
     {
-        SetSelfGeneratedVelocity(velocity);
+        if (external)
+        {
+            SetVelocityFromExternalSources(velocity);
+        }
+        else
+        {
+            SetSelfGeneratedVelocity(velocity);
+        }
     }
 #endif
 

+ 2 - 2
Gem/Code/Source/Components/NetworkPlayerMovementComponent.h

@@ -47,8 +47,8 @@ namespace MultiplayerSample
         void ProcessInput(Multiplayer::NetworkInput& input, float deltaTime) override;
 
 #if AZ_TRAIT_SERVER
-        void HandleApplyImpulse(AzNetworking::IConnection* connection, const AZ::Vector3& impulse) override;
-        void HandleSetVelocity(AzNetworking::IConnection* connection, const AZ::Vector3& velocity) override;
+        void HandleApplyImpulse(AzNetworking::IConnection* connection, const AZ::Vector3& impulse, const bool& external) override;
+        void HandleSetVelocity(AzNetworking::IConnection* connection, const AZ::Vector3& velocity, const bool& external) override;
 #endif
         //! @}
     

+ 2 - 3
Levels/NewStarbase/NewStarbase.prefab

@@ -4383,9 +4383,8 @@
                     "Id": 8615741586168280576,
                     "m_template": {
                         "$type": "MultiplayerSample::HUDComponent",
-                        "RoundNumberId": "",
-                        "RoundTimerId": "",
-                        "RoundSecondsRemaining": ""
+                        "RoundNumberId": "8",
+                        "RoundTimerId": "4"
                     }
                 },
                 "Component_[8823626037987064928]": {

+ 35 - 6
Prefabs/Energy_Cannon_with_Energy_Ball.prefab

@@ -75,13 +75,25 @@
                     "Id": 12889870600493739301,
                     "ParticleSystem": {
                         "assetId": {
-                            "guid": "{4981130E-D6A9-54D3-A693-2B957A15051F}"
+                            "guid": "{EAD91758-94E3-597E-94CF-FB52F72B7252}"
                         },
-                        "assetHint": "popcornfx/particles/energyballtrap/fx_energyballtrap_projectile.pkfx"
+                        "assetHint": "popcornfx/particles/defenseturret/fx_defenseturret_projectile.pkfx"
                     },
                     "PrewarmTime": 0.0,
                     "AttributeList": {
                         "Attributes": [
+                            {
+                                "Name": "Fire Rate",
+                                "Type": 31
+                            },
+                            {
+                                "Name": "Color1",
+                                "Type": 34
+                            },
+                            {
+                                "Name": "Color2",
+                                "Type": 34
+                            },
                             {
                                 "Name": "Color Intensity",
                                 "Type": 31
@@ -91,17 +103,34 @@
                                 "Type": 31
                             }
                         ],
-                        "AttributesRawData": "AACAPwAAAAAAAAAAAAAAAAAAAD8AAAAAAAAAAAAAAAA="
+                        "AttributesRawData": "AABAQAAAAAAAAAAAAAAAAAAAgD/YGNM+AAAAAAAAgD9Qv/E+AAAAAAAAgD8AAIA/AACAPwAAAAAAAAAAAAAAAAAAgEAAAAAAAAAAAAAAAAA="
                     },
                     "EditorAttributeList": {
                         "AttributeCategories": [
                             {
                                 "Attributes": [
+                                    {
+                                        "ValueFX": 3.0
+                                    },
+                                    {
+                                        "Color": [
+                                            1.0,
+                                            0.41229891777038574,
+                                            0.0
+                                        ]
+                                    },
+                                    {
+                                        "Color": [
+                                            0.47216272354125977,
+                                            0.0,
+                                            1.0
+                                        ]
+                                    },
                                     {
                                         "ValueFX": 1.0
                                     },
                                     {
-                                        "ValueFX": 0.5
+                                        "ValueFX": 4.0
                                     }
                                 ]
                             }
@@ -150,7 +179,7 @@
                         "$type": "MultiplayerSample::EnergyBallComponent",
                         "ExplosionEffect": {
                             "ParticleAsset": {
-                                "guid": "{D49CE200-BF8B-5DBF-98BD-14CF7C480D45}"
+                                "guid": "{FAEA4FC5-78DF-5608-8DA2-88C6CFB1D281}"
                             },
                             "AudioTrigger": "play_sx_int_energyballtrap_impact"
                         },
@@ -288,7 +317,7 @@
                         "RateOfFireMs": 4000,
                         "FiringEffect": {
                             "ParticleAsset": {
-                                "guid": "{F16C718B-7B3D-5F6B-877C-0CA15AAE7544}"
+                                "guid": "{5A84D0E0-8BF2-5478-B3B9-900F5548754D}"
                             },
                             "AudioTrigger": "play_sx_int_energyballtrap_buildup",
                             "EffectOffset": [

File diff suppressed because it is too large
+ 228 - 199
scriptcanvas/JumpPad.scriptcanvas


Some files were not shown because too many files changed in this diff