Timers and Network

So a while ago I did some work to replace all my use of EventTick with Timers to control vehicle movement. This is done on initialisation on the Server for each vehicle - all working fine. Yay. One problem though.

For every player that connects to the server, the vehicle timers seem to include another execution cycle on the function they call. This results on increased speed, trun rate etc. which is undesirable. How do I get around this? Should my timers be centralised somewhere else?

You might be replicating the Initialization, every time a player enters, to all the clients. Try printing something right after you start the initialization to see if the other clients are equally calling this function as it is replicated to the server.

I suspected that might be happening so I added an additional timer running a simple function to increment an int every 3 seconds. Even with 3 players it still only counts up every 3 seconds. Will add something to the initialisation as well to double-check.

Update:
So it still looks like nothing unexpected is happening within the timers and at initialisation, here’s my setup below;

Initialisation

Master Controller

http://i.imgur.com/rcMN82g.png?

Not sure why this is happening - I assume that blueprint is the vehicle class, not your player/player controller?

Can I ask why you’re using timers like this though? Running a bunch of timers at that kind of frequency is much worse for performance than just using a tick function, and is also going to be less smooth (since some frames the timer will fire once, some frames twice).

Yep, it is the vehicle class. I was just splitting them up to see how effective they were at different frequencies, I’m about to make a single timer which will simply call each function and have a single MasterTimer for all movement.

Fair enough, though even if it’s just a single timer, if it’s updating 100 times per second it’s still much better to use Tick.

There seems to be an idea that using Tick is bad, but this is not true. It can be very bad if misused for things that don’t belong there, but this kind of thing is exactly what Tick is for.

Yeah, I was wondering why Tick was “so bad”, or least wondering where to draw the line on it’s use. Seems that after I relocated all my movement logic to use Timers there was nothing left on EventTick which seemed a bit odd.

Guess if I migrate back to using EventTick the problem goes away though I’m still keen to understand WHY this would happen to begin with.

Anyway, thanks for the info.

Yeah I can’t see anything in the blueprints you’ve posted that would explain why it would be happening.

As for Tick, it’s correct to use it for anything that needs simulating with respect to game time, at a reasonably high frequency (i.e. anywhere in the ballpark of your expected frame rate). The real misuse is when people are checking for some condition every tick that will only be true once in a while, in that case it should be timer/event driven instead.