I want to share this simple small project that may be useful to you if you want:
(As benchmark): Evaluate UE4 for making your next 2D android/ios/html5 game. Benchmark the efficiency of Blueprint and Paper2D to compare with other engines or with old UE4 versions/updates/configs.
(As test demo): Know how the simplest UE4 2D app runs on your device or compare with different platforms.
(As a template): Start your new 2D game or Learning Blueprint tests with the most simplified template possible (205kb zipped project / 35mb shipped .apk).
How to interact with the demo:
Tap or click one of the 4 screen zones to:
More about this little project development and objetives:
There are many benchmarks already done here and there, followed with good discussions and mainly to compare with other engines, but mine has a different objective and scope, and why not to make and share this if anyway I was making this for my own fun and needs.
Currently is a fact that Paper2D + blueprints are relatively slow compared to more lightweight solutions, I did myself a very similar test using the same 128x128 PNG sprite with Smart Mobile Studio (A cute programming thingy that compile Object Pascal syntax to HTML5) and displays 3,000 individually animated Sprites at **40FPS **on my Laptop (see live here) while using this very similar UE4 project when I reach 3,000 sprites I get a painful 9 FPS on same PC. (Will write PC specs later)
** Then, since I’m already decided for UE4 because I’m in love with the editor and Blueprints, my objectives and scope are:**
- Reach the highest performance possible in low-end devices and old PCs/Laptops with Blueprints-only project. (No C++ allowed, If I need C++ to make a simple 2k sprites run at 30FPS, then I better go to non-UE4 solution, but I will not)
- Build smaller packaged projects possibles (APKs, HTML5 projects).
- Do all this with collected tricks, ini configs, console commands… etc
- Don’t asking for a New additional feature to add complexity, talking about drawing call batching or sprites grouping that will limit individual Actros movements, since I think the problem is that drawing simply 3k sprites is suffering from many checks and complex 3D features still running behind, and what we need is to have a way to get rid of them so simple games can run as fast as this HTML5 demo I talked about before; which is not using any caching or instancing optimization.
- Test and keep a report of any new UE4 update to see any improvements or drawbacks.
All in this project is minimal, reduced or stripped-down.
- There is a MyGameMode BP that is the center of the little everything, spawning sprites and handle input sent by MyPlayerController.
- MySprite BP has a Paper2D component and does its animation on the Event Tick with some Sin/Cos math expressions.
- Isabella sprite texture is 128px X 128px PNG with alpha channel. This paper2D sprite uses TranslucentUnlitMaterial. There is also the simplest 3 verts sprite tringle with OpaqueUnlitMaterial.
- All sprites have No-Collision and Generate Overlap events disabled.
- Most plugins are “supposedly” disabled except Paper2D (No matter how hard you try to disable VR plugins in 4.9 their LIB are still included as .SO files inside your APK )
- Project settings are meticulously revised and many features “supposedly” disabled such like HDR, Bloom, Anti-Aliasing, Motion-blur, etc.
- The scene is a single auto-activated Orthographic Camera pointing -Y axis from (x:0, y:600, z:0) and MySprite are spawned at run-time.
- A few console commands are executed at Begin-Play event to set lowest Scalability, unlock FPS limits and more should be added to get rid of remained postprocessing stuff, etc.
My tests and devices specs:
Laptop Toshiba i5-2410M 2.30 GHz, 16gb RAM, NVIDIA GeForce GT 540M, (Yes, I work UE4 with this and I’m happy )
1000 sprites - - - - 31 FPS (35ms)
3000 sprites - - - - 9.4 FPS (106ms) (Switching to triangles or/and disabling Tick Event only add like 2-3 FPS to reach 11 FPS max, almost unnoticeable)
HTML5 on Chrome browser:
200 sprites - - - - 27 FPS (37 ms)
Samsung Galaxy S4 mini GT-I9190
200 sprites - - - - 27 FPS (37ms) (same as HTML5 on my Laptop )
1000 sprites - - - - 4.5 FPS (215ms)
Want to help or contribute?
Thanks! Try this project share your results, your thoughts. Share any tip/config/trick you found to improve it. Any improve will be shared with everyone here. Any other new trick you found on your 2D game to reduce package size, gain execution speed, apart from the official docs (size)(performance)? Plase share it, (or if you post it anywhere I’ll find it )
Let’s help Epic find things that are making our 2D small games having bad performance, and let’s ask them to improve this little things. They are not targeting old devices (obviously) but maybe there are small feasible things that can be made to make UE4 much better than already is. Anyway remember that if you are targeting Samsung S5 and your are happy with 2,000 jumping sprites at 30FPS another team could compete with you with a similar game displaying 10,000 jumping richer sprites at 30FPS running in the same Samsung S5.