So Im working on a multiplayer game, and Im using both C++ (mainly) and BP, I have set up a basic attack animation on click, it works, I click, then animation plays, the other player who got hit loses health.
I was told that I should untick “Run Under One Process” inside the Advanced Network settings. And after unticking that, the client’s attack always bugs, like it doesnt render that fast, and cant attack that fast. Also other functionalities seems to be glitching too. Server side seems fine.
Should I tick that setting back on? Does it have any impact on the game? I mean if I plan to release my game, it would ship with separate processess and then my game would be glitching all the time? What should I do, how can I solve that latency (if it is latency related) issue?
This is only a development setting. If session is run under same process, it’s sometimes easier to debug and find some issues. In other cases, it’s not reflecting the real use of the networked game.
Yes, exacly
Yes, but just as said before, this is not caused by this “Run Under One Process” option, as this is simply just an Editor option. There is probably a problem with your code.
It’s hard to tell what the real problem is, since I don’t know how you’ve structurized your code related to replication, but just guessing…
there might be no prediction logic in your code - Client is always waiting for the Server responce before doing anything on its side.
That explains a lot, usually what I do is write a function that executes its server counterpart (like, start the function on client, then the client calls the server function).
What can I do about the “prediction logic”? If the client always waits for the server to do something on its side, then I should run the server function which executes the client function?
Well, at this point I would really recomend watching some kind of course or tutorial about replication as this topic is really really wide. Creating anything in networked multiplayer is much more complex than creating the same stuff in singleplayer.
It’s probably better to start with learning resource first than asking for help on forum. It would be faster to learn it in such way.
Client that sends the Server RPC shouldn’t really wait for Server responce. It can fire some of the logic on its own. E.g. pure visual logic (like animations, particles, etc) could be executed right away. This at least creates an ilusion that the game is responsive.