o3de-multiplayersample icon indicating copy to clipboard operation
o3de-multiplayersample copied to clipboard

Chaining RPC calls don't function as expected in response to player health event

Open allisaurus opened this issue 2 years ago • 2 comments

Describe the bug During the course of trying to implement https://github.com/o3de/o3de-multiplayersample/issues/148 , could not get player position/armor/coin updates to take effect via call to Server-->Authority RPC on NetworkMatchComponent. However, the same logic does work when the corresponding controller directly implements PlayerMatchLifecycleBus::Handler

Steps to reproduce Steps to reproduce the behavior:

  1. pull down https://github.com/allisaurus/o3de-multiplayersample/commits/respawn-rpc
  2. build server& game launcher, then run editor
  3. hit ctrl + g to play game, stand in front of energy cannon to deplete armor.
  4. when armor reaches 0, observe NetworkMatchComponent::OnPlayerArmorZero(...) fires and calls RPC_PlayerArmorZero(playerEntity)
  5. no changes to player position or resources are observed.

Expected behavior Player would respawn with full health and diminished coins on call to HandleRPC_PlayerArmorZero()

screenshot of log of handle method firing on server image

Actual behavior Player doesn't respawn and to effects to player resources are observed.

Assets required Code that repros problem here: https://github.com/allisaurus/o3de-multiplayersample/commits/respawn-rpc

Found in Branch built off of https://github.com/aws-lumberyard-dev/o3de-multiplayersample/tree/GameJam_2022_07

Desktop/Device (please complete the following information):

  • Device: PC
  • OS: Windows 10
  • GPU: NVidia RTX 3070
  • Memory: 30gb

Additional context A similar call pattern is made in response to PlayerActivate in this component and seems to work. Unclear if there's a substantive difference in event origin or anything else that'd make this call path different in some way.

allisaurus avatar Aug 22 '22 16:08 allisaurus

Functionality has been fixed. @allisaurus is this still worth keeping open?

lmbr-pip avatar Mar 16 '23 17:03 lmbr-pip

Not sure whether the current implementation is still using the "workaround" (directly implementing PlayerMatchLifecycleBus::Handler vs. calling RPC), I'd say worth keeping open until the correct approach is validated

allisaurus avatar Mar 16 '23 18:03 allisaurus