Selectively freeze some actors

Hi guys.
I’m working on a multiplayer RTS, and due to some complex network stuff, i need sometimes to completely freeze some actors (not all, let’s say about 90% of the world actors) on some clients. This means animations, movements, particle effects, etc on that actors needs to halt for 1 to n frames, and then continue as nothing happened when i decide it.

Looking around i found 2 proposed solutions:

  • Pause the game : i need to freeze the actors independently. Pausing the game will pause it for every player, so it’s not viable.
  • Change Global Time Dilation : since the system is deterministic, for a very short pause this may do it, but for long pauses this can create tons of problems.

I was thinking about using a Tick forced to 0 when i need it: since in UDK every actor was responsible to tick its components, it was easy: however, i noticed now every component gets ticked indipendently by its owner, so to obtain the custom tick, i would need to overwrite nearly every component class.

Is there a way to get in the middle of the ticking process to alter it? Or do you have any other idea?

Obviously, i wanted to avoid to iterate throught every actor every frame to enable/disable the tick

Actors have a property called CustomTimeDilation that only affect that actor, so that may work for what you want. You could group all the affected actors in some array and iterate over them and set this maybe. Never tried it before though so not sure if it works properly.

Also just realized this question was old but figured some people looking might find an answer here.

2 Likes