Im am building a sidescroller game for mobile platform. In the game the player attaches to a spline path, which has sprites distributed equaly anlong the whole spline path. You can travel along the spline but you can also jump from it and go to other splines. I have blueprint(BP_TestTrack) which contains the spline path. In the construction script i determine how many sprites i need to uniformly cover the whole path with sprites, based on the length of the spline and size of the sprite. The sprite is 32x32 pixels white box.But i dont add the sprite directly in the construction scirpt, rather i add another blueprint(BP_BoxCollision) which contains the sprite and box collider(it is used to determine where the collision between player and spline accurs).
The problem i am having is, when i try to playtest on my mobile device (Samsung Note 3) i get very bad preformance(low fps) because of the sprites. I have 4 spline paths which generate about 450 sprites. The reason the sprites are so densly on the spline is because i want it to look like a smooth stroke. I have also checked the draw calls and i get about 230-290 when running tha game, which i know its quite a lot. So the question is how can optimize my perfomance?
I have also to try the following things to boost perforamnce:
- Add PaperGroupedSprite component to my Blueprint BP_BoxCollsions and add the sprite as an instance but it doesnt help a bit or i am setting it up wrong, could not find a tutorial about it and the documentation isnt great.
- Add Paper2D sprite but i get the same performance as above
- Replace sprite with a billboard which actually boosts the performance (about 30-50 draw calls) quite a lot but the problem is the orientation of the billboards allways facing the camera and i did not found a way to change it color during runtime, which i want to do on my sprites later on as the player walks on them.
So really i dont understand why the performance with Paper2D sprites is so bad even though im just using one sprite and basicaly duplicating it along a path, but with the billboard i get great performance.
Im really new to developing in unreal so if i am missing out on something essential please point that out. I hope i have clarified things enough, if not please say so:)