Unity VS Unreal Engine 5 - Performance Tests

preview_player
Показать описание
The performance of an engine can be an important factor when making a game. If you are making a game with a lot of objects or high poly meshes, which engine you use could greatly affect how good your game looks and performs.

In this video I'll do a few tests for both CPU & GPU to test which engine is best. However, it's hard to have the same settings in 2 engines, so keep in mind the results are not 100% accurate.

The results:

For physics simulations & collisions, unity won in FPS, but UE5 won in CPU % used, probably because it has a max to the CPU % used by simulations. So unity might be better if its the main part of your game, else UE for low CPU, especially if the rest of your game is CPU expensive.

For updating many objects every frame, UE c++ did very good, much better than Unity or UE Blueprints, but unity DOTS managed to win by pretty far too. However, DOTS isn't completely ready to make full games yet, so you might still prefer to use UE5.

For static meshes, UE5 with nanite is unbeatable by very far. You can have virtually unlimited high poly meshes in your world.

For skeletal ( moving ) meshes, UE5 and Unity are pretty much equal. UE5 had slightly worse performance, but it has better quality imo so it's worth. Also, in UE5 you can easily add LOD to your meshes so when they get far away they don't cost as much to render. So I think both are more or less equal.

COMPUTER SPECS:
CPU: AMD Ryzen 5 2600 Six-Core 3.40GHz
GPU: MSI Gaming GeForce RTX 3060 12GB 15 Gbps GDRR6 3 fans
RAM: 16Gb ( 2x8 )
OS: Windows 10

---------------------------------

Subscribe for game making tutorials, other game-making related content and to follow my projects with the dev logs !

0:00 Full Comparison
1:38 Physics Simulations & Collisions
6:30 On Frame Object Updates
10:10 Static Meshes
12:25 Moving Meshes
13:30 Recap
Рекомендации по теме
Комментарии
Автор

Very nice video. Of course there's always more to test :) A few extras for next video.

Unreal's version of ECS is called MassEntity system
You can compile down to c++ in Unity by enabling the "Ill2cpp" option in build settings.
You can also compile Unreal blueprints to cpp

Octamed
Автор

A year ago I was deciding weather to go with unreal or unity I saw that video of yours too, in the end i chose unreal just because I had a good experience on c++. And i think it was a good choice after all.

maan_
Автор

Quality Rendering is also a point, but the winner is clear there i guess

Good video <3

milankiele
Автор

Nice work. Definitely a few improvements that could be made to isolate what exactly is causing the issues but at that point you'd really have to get into the territory of hyper-optimizing for engine specific features. In general I'm going to assume the much higher quality rendering and shaders in Unreal probably contributes more than anything to the lower framerates in most of those tests. There's also the consideration of things like instancing, batching, and render paths. A real hardware-limit-pusher would be to render many different meshes with many different materials, maybe even throw a variety of moving realtime lights in there just to see. It would certainly go a lot further to simulate a realistic scenario that would likely happen in-game. Also a side note, my personal experience with Unity when using animated meshes is that the Animator will bring most machines to their knees after only a few hundred instances in view. I'm not sure if you used the Animator or just a basic animation clip using the legacy system but it can make a huge difference in some cases. Granted, with those kinds of numbers any engine would be better off using some kind of LoD and switching to fixed-frame texture-baked animations that are done entirely on the GPU. Overall, this is still a valuable starting point for consideration. Thanks for taking the time to measure and document all of this stuff!!

jamesclark
Автор

It appears to me that you're doing DOTS very, very wrong, have you used the Jobs? And Burst? Because is that why Unity did these things, the HPC#

diadetediotedio
Автор

Hi! You've done very cool research! Can you make the same test on physics but with "Tick Physics Async" enabled in UE5 project settings? It has to improve the performance.

BorisTen
Автор

I don't think that CPU usage is a good idicator. For games, low CPU usage is only useful for longer battery life on mobile devices.
Unity's newest physics simulation is multithreaded, so high CPU utilization can be good for performance. It would be like comparing RAM usage. High RAM usage can also be a good thing.
Ideally you would compare performance without any rendering with identical testing scenarios.

assemblyrtsdev
Автор

I have switched over from Unity C# to Unreal C++. And although i do appreciate the work you have put in this - i will have to argue with most of the results besides the blueprint system. But on blueprint system - the only fair comparison would be to use Unity's visual scripting tools against it.

Unreal engine is A BEAST with a very steep learning curve. Out of the box it comes very clunky performance heavy and a real slug when it comes to workflow. BUT!
C++ is a lower level programming language and that gives you more performance and control. If you can't handle a fast car properly - you will hit a wall. From my experience - Working on a C++ project ( It's not the same as blueprints based project with C++ code in it ) - Things that would take me a serious questioning on if it's viable on Unity - Unreal get's done without a hitch. I think it's more than twice as performant. I would even say it's safe to say that more than twice.
Physics - I can easily put like 5 - 10k balls ( More performance heavy than a box due to collider ) and drop them in a shaking giant box - it will handle it on like 30fps IN EDITOR with high scaling.
I think what happened here is - the script you wrote was badly optimized and simply overloaded it.
Graphics - no comment here.
Unity DOTS - Check unreal ECS and then test it. I'm not sure if it works better than Unity Dots, but again - it's not fair to compare a feature, that requires extra steps to set up With defaults of Unreal although it has it's own version of it.

I like Unity, but Unreal Destroys Unity in all of these categories.
Downsides of Unreal - Much harder to learn, C++ requires a lot of extra work as it's lower level, and less learning material.

janisnorins
Автор

FPS do affect CPU load.

GeForce Experience sucks, you should use RivaTunner statistics server (comes with MSI afterburner) you are able to see all data you need, GPU usage, temp, VRAM usage; CPU cores usage, temp; RAM usage; FPS, Frametimes (FPS time-graph).

These tests were not equal situations so the results are basically worthless. Ideally if you want to compare physics (which is CPU based) performance you do physics and nothing else, no shaders, no shadows, low resolution, etc. *On which the results is not only how many but how precise.*

Then you will want to compare GPU performance so you do cubemaps, shading, shadows, post-processing, etc.

Then logic, NPC path, NPC nodes (their brains and behavior trees).

3D Animation performance, 2D/3D GUI performance (with and without limited refresh rate).

Then at the end, everything at the same time (not necessarily a stress test, just a real life scenario).

Don't worry, if you don't have the sufficient time (or technical knowledge) to do it, if you do it make sure to tell that these tests should be grabbed with a grain of salt.

Use each engine features to their advantages. If the end result is the same on both, then it's valid.

Splarkszter
Автор

As already pointed out in another comment a more fair comparison would've been to use the MassEntity system in Unreal. But this is an interesting video nonetheless!

Xperto_
Автор

I would like to see a comparison between UE5.1 Aparatus ECS+ Plugin and Unity DOTS

tylergorzney
Автор

Could you please do a better physics benchmark test? This one is pretty flawed to be honest... For instance, you are instantiating objects every frame, so its not a pure physics benchmark, a better approach would be to set the amount you want to instantiate at the start and then spawn them all at once in a single frame. Then you can use spheres instead of cubes and just let them all fall and roll around, that way there is also no script attached to actually give a command to a rigidbody to change its velocity every frame, if you want to test physics, then let physics update the rigidbody velocity internally, by just dropping the object and not having any scripts interact with it.

With that approach you can easily test pure physics in both engines a lot better I think.

Finally, you could use the Unity Profiler which is 1000x more accurate than the Debug Stats window in Unitys Game Window, actually that one that you get in the free one that displays FPS and thred latency is completely broken for years now and people know its not giving accurate info so you buy Pro Unity version and never look back, but I dont have the monero for that as an indie hobby dev so its fine, and I dont expect you to get it for a benchmark video, but just letting you know Unity Free Debug Stats is broken...

ezlsduc
Автор

I'm assuming you use Defoult 2022 render. Not HDRP or URP. I couldn'tcan't seem to find your hardware spec. Thanks for the comparison!

SoaringSimulator
Автор

Disable GI in Unreal.. else GI calculation bog down test

utkarshshukla
Автор

To make it more apples to apples you should use Unity HDRP so the visuals would be much closer on both.
And of course, MassEntity on UE.
Great job!

tomtomkowski
Автор

Unity DOTS does not improve performance but improve QOL for developer's to make multithreaded games. Do you use Burst with DOTS ? without Burst and multithread code DOTS can't release all performance he can made.
UE same problem. You can't compare UE and Unity if you don't use multithreaded code because on single core it depends of your CPU if it's an Intel or AMD and it result with wrong bench results.
Thanks for the video!

mihawka
Автор

Make kerbal space program style physics simulation with great graphics to determine which one should ksp 2 been built with

jjeeqq
Автор

More conclusion pls? What does this mean in reality

Netbase
Автор

I am looking to make a marching cubes voxel mesh generator. Based on this, it seems like Unity is the better choice? Not sure if I understood correctly or not

saicher
Автор

I'm sorry, but I can't seem to find your specs in the description. Am I dumb, and if yes could you help me?

LetHerWar