Irregular stuttering on mobile

Hey people,

i have a big issue, at least for me. I created an infinite scroller based on the 3D sidescroller template provided by epic but im running into stuttering on mobile. Even in the editor, if you look right at the moving actors, you can see some slight irregular stuttering happening.

Here is some insight how my game runs:

  • On game start i spawn 4 actors, they work as a world chunk so i can infinetely recycle them and create a world the player can walk on.
  • One chunk is made out of 1 floor mesh, 3 rock meshs, around 10 grass meshs and some foliage (palms and bushes are created random)
  • All meshes are instanced and not highpoly (e.g. one palm has around 700 verts)
  • The world is moving towards the character and the character is constrained on this axis so it won´t move with the world
  • To move the world i use the tick event in gamemode. I define the first chunk as my “head” like in a linked list and move it every tick like this: Moving Actors posted by anonymous | blueprintUE | PasteBin For Unreal Engine 4
  • After the first chunk is moved, i loop through all other chunks and resposition them based on the position of the chunk before + its worldsize.
  • After the first chunk reaches a certain position left from the character, it will be detached, its next chunk becomes the new head and the detached chunk will be reattached at the end of the chain.

I tried my luck with the profiler but the values it shows me are like chinese for me and the documentation about the profiler is not helpful. It says how to profile but not how to evaluate given data.
Besides that i can´t believe that the way i move the actors around is that heavy to calculate for any hardware.
Im using a Nexus 5 to test on a mobile device.

Maybe any of you can give me a hint how i could improve the game or engine settings to run the game more smoothly cause the stuttering is acting like a game breaker in an infinite scroller with obstacles.

Thanks for your time!

Hey man, did you find a solution? I’m facing a similar problem now.
UE 4.19.2

Hey kShadowcraft, sadly i haven´t found a real solution.
I optimized my scene more. For example i exchanged the grass meshes with planes and grass textures on it. That saved me a lot of frame drops and stuttering.
On iOS Vsync seems important and smoothes out a lot of stuttering.

Hope i could help you a bit =)

Have a nice day

Thanks for the prompt response.

Not sure if this helps you, but for me atleast i’m able to run the game without much stuttering. Of course, now I’ve run into Flickering issues (object, or parts of sprites appearing and disappearing), but atleast no more background stuttering.

So what I was wanting to do originally was have a series of planes in the background, each of them with different panning materials so as to create that parallax background effect in my 2D game (also infinite side scroller with obstacles).
However, the materials were stuttering a lot, even after using console command “r.vsync 1”, especially on the mobile preview, and on the device itself. The more time the game was on, the more it had started to look like a slideshow than a smooth pan.

So after searching for 2 days online, and lastly your question, I decided to do the old loop the sprite animation. So I created an Actor with 2 sets of same background sprites. Then I placed it in level one folled by other and then controlled their movement and synced it using global delta seconds multiplied to speed of movement. the sprites start moving in the opposite direction of the character(who animates in place). Then as the 2nd sprite is in the middle of its appearance on camera, the 1st sprite is set to be behind the 2nd sprite thus creating an endless loop. Now the stuttering does not happen on mobile.

But like I said, now I’ve got flickering issues to deal with, so not sure if this was the best idea. Hope there is a better solution to prevent all the stuttering and flickering on Unreal.

Hey kShadowcraft,

thank you for sharing your experience.
Your loops seems to go the same way my loop goes and i guess it’s the best practice to do it like that.
The big lags are gone but there is some kind of micro stuttering happening from time to time and i have the feeling it comes from the engine itself.

Best regards