I have a networked multiplayer setup where each player has “skills” that passively affect their character movement such as running, jumping, swimming, etc. One of these is “Climbing” which affects the walkable floor angle property.
For most of these properties, UE4 seems to use “Replicates Movement” to handle it smoothly. For instance, if an actor is replicated and the movement is replicated, increasing the maximum walk speed will look just fine without any further adjustments.
This is not true of the walkable floor angle. With two clients connected to a dedicated server, client 1’s walkable floor angle is adjusted from 0 to 30 then stands on a slope. Client 2 can see Client 1 move up the slope, but they are perpetually shown as falling as Client 2 doesn’t know that Client 1 can walk on this slope.
In my current setup, I load a character’s saved skill values when they connect. I then run a function to “Apply” them (basically, evaluate that a skill level of “10” in running equates to “100” to the “max walk speed” and set the value on the character, looped through for all skills). This is all done within the character blueprint on “Begin Play” and executed only on the server. But as I mentioned above, while this will allow all clients to move on the appropriate slope, all other clients will still see you as falling.
To fix this, I created a separate multicast function, taking in the walkable floor angle and applying it to the character. My thought process was that this would tell all clients that this character was able to walk on this slope. The problem is even though this is set to “Multicast”, it only executes on the client that owns the character.
It seems to me that clients are not allowed to execute RPCs from an actor they do not own. This is a problem for me.
When a client connects, I need the server to run code for all clients to update this walkable floor angle. But if I can’t run a RPC for a non-owner, Client 2 can’t tell Client 1 that Client 1 needs to apply its skills and “broadcast” the floor angle to everyone else.
I’m not sure if this makes sense to anyone else and my setup is pretty messy at the moment so it’s tough to traverse through everything that’s happening, but if this sounds familiar to anyone or you have suggestions on where to execute this I would greatly appreciate it.