1
\$\begingroup\$

I'm currently working with replication in Unreal Engine and am wondering whether I'm using RPC Functions too much.

Most of my functions that are called on the server are unreliable. For example, I was setting the character's collision to overlap a channel instead of block based on if they were in a Hiding Spot or not, but it wasn't being called on the listen server, rather only on the client. Whenever the client would try to collide with the actor, the client would try to walk straight through, but since the collision change didn't get called on the server it kept flicking the client back. Once I set the function to Multicast, it completely fixed this problem. I do this for most things: either call them on the server or multicast.

Is this an appropriate way to implement these mechanics, or should start using replicated variables more often? I'm not using RPC on every single thing; I know when something is too ridiculous to use an RPC on. It's mostly just little things like changing collision, or setting the position of something.

How do I determine whether to use RPC or another replication strategy for a given mechanic, or evaluate whether I'm over-using RPCs?

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Calling for collision sounds too much. Rpcs should be called for user inputs/ actions. The server can figure itself out that a collision happened. \$\endgroup\$ Commented May 17 at 14:05

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.