Download

NetMulticast during Tick

I come across some problem, while implementing multiplayer for my game. Basically I make some calculations in tick on server, NetMode < NM_Client, than runs NetMulticast fuction, to send some data to all clients.
That causes that not client can establish connection properly to server. I have at start “Received non-control bunch during login process” error, than “Received control channel close before open” error.
Can’t I do that in Tick, or it will be changed in future releases ? Can anybody explain me connection flow? I will be most grateful.

Hi biszop. I’m curious about this too. Have you created an answer hub question for this issue?

Not sure, but this probably wouldn’t work because every receivers frame-rate could be different.

It’s probably really bad practice to write network code that ties into framerate at all. Use timers/delays instead. Just a guess!

Also i belive that if you send RPC calls to fast e.g: every frame.
The engine will not send all the RPC calls to limit bandwidth consumtion.

Please note: I can not find the documentation for it atm but am prety sure RPC calls never should be done in Tick.

Not sure exactly what you are doing, but if you are doing calculations during the Tick method on the server, you could store the calculated data using replicated variables that will automatically sync with client, this would be a lot more efficient than doing RPCs every tick, and would be easier to implement too!

Hope this helps!
Connor

Sending RPCs during Tick is definitely not a good practice as it will consume your bandwidth. Can you explain what you are trying to do? There’s probably a better way, but we need to understand what you’re trying to accomplish

Thanks for all the answers.
In short I have a variable in anim instance that I wanted to update on all clients, along with sever in exactly the same time, as frequently as possible.
And yes, it was better to switch to replicated variable and to on replication function, the only small difference was that this function won’t fire on server automatically. I will stay with that method.
The other thing is that problem, or maybe not, with RPC multicast function. Is there a chance that calling it too soon may cause some connection problems, and I don’t even think about calling it in each tick, but early in game flow at all.