o3de-multiplayersample
o3de-multiplayersample copied to clipboard
Chaining RPC calls don't function as expected in response to player health event
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:
- pull down https://github.com/allisaurus/o3de-multiplayersample/commits/respawn-rpc
- build server& game launcher, then run editor
- hit
ctrl + g
to play game, stand in front of energy cannon to deplete armor. - when armor reaches 0, observe
NetworkMatchComponent::OnPlayerArmorZero(...)
fires and callsRPC_PlayerArmorZero(playerEntity)
- 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
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.
Functionality has been fixed. @allisaurus is this still worth keeping open?
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