Not sure if this is intentional, but a colleague recently traced an issue he was having back to the double-ticking of a BaseManager when he ejected from play. He uses the Manager as the hook for his custom AI engine.
Thought this was worth mentioning! Simply create your own BaseManager class (we use them as Managers) and eject during play, you’ll see the Game Instance ticks twice per frame often causing severe slow-downs.
Basically he has implemented several custom Managers which inherit from both UObject and FTickableGameObject.
The way to trace the double ticking is fairly simple, just insert a breakpoint in the ‘Tick’ Function of his Manager class and also in the Character class in his level. The Characters tick once for each Character that’s in the level, and in regular play, the Manager does as well.
He uses the Manager class to hook into his custom AI engine, but when Ejecting, the Manager ‘Tick’ function is called twice before the characters, and continues to do so. He traced the issue back to ‘Engine.cpp’, Lines 1225 and 1020.
Because in ‘Eject’ mode the Editor and the Game are both ticking, both of those lines call Tick on the Managers, and so the Manager ticks twice.
Sorry for the delay in getting back to you on this issue. I just tried to reproduce the issue that you described, but had some trouble doing so. I have some questions that will hopefully clear things up and allow me to reproduce this.
What version of the Engine are you using?
Is UBaseManager a custom class that has been created in your project? I was not able to locate this class in the Engine source code.
I was unable to build the project code after adding a class that inherited from both UObject and FTickableGameObject. Would it be possible to get the code for one of the manager classes that you have created?
Are you certain that the issue is located in lines 1020 and 1225 of Engine.cpp? When I looked at that file it only had 173 lines.
Do you happen to know where this issue was reported previously?
We have not heard back from you for a few days. Were you able to get the additional information? I will be marking this issue as resolved for tracking purposes, but please feel free to re-open the post at any time with any additional information you may have.