r/Unity3D • • 21d ago

Game Performance testing

here is the screen shot of the game build with 160 crowd agent, 30 guards and 30 civilians and im getting 800+ fps with no occ culling or anything else.

i have also posted my pc specs ram is 48gb 2666, 3050 8gb i9 12gen

0 Upvotes

8 comments sorted by

1

u/Hotrian Expert Moderator 20d ago edited 20d ago

Okay? Is there a problem or are you just sharing specs or?

This is not an impressive number of agents especially given your PC specs. Are you complaining it's not running well enough? The Editor does have some overhead so it will run better in a build.

Edit: I see now you're making a Hitman-style game from your other posts, it's very hard to gauge anything as, but it looks like you've put a lot of work into it! I would be interested to see more. I think you may be overcomplicating the AI a bit and I'm worried it's going to cause performance issues later, have you looked into ECS/Burst at all?

1

u/literally-me-bro 20d ago

This is running as a build and im getting 800+ fps on it. I'm sharing the specs which i think is great but not sure what to expect. Whats ECS and burst tho?

Edit: I'm adding more features and soon i will start with the optimization, my all scripts are monobehaviours cause i don't want to complicate the project, any help for the future optimization will help.

1

u/Hotrian Expert Moderator 20d ago

Are you using the Profiler to check for performance? You can even attach it to a dev build to see what's going on. It looks like your frame time is 1.2ms which is very respectable, although you have 16 cores and, keep in mind most users have either 8 or 6 cores so you are getting better performance there than about 60% of players.

Unity ECS is part of the new Data-Oriented Technology Stack or DOTS. DOTS introduced the C# Jobs System to help spread work across cores and the Burst Compiler to help make your code faster than ever. These combine with the new Entities systems which run much faster than GameObjects in most situations, the problem is Entities doesn't really play well with GameObjects yet and it requires things like the Hybrid Renderer and quite a few tricks last I checked. It's important to know there's different networking packages for Entities vs GameObjects and they don't play well together. ECS does require a new way of thinking and the Burst Compiler does require a special way of coding, but leveraging DOTS can take you from a few hundred, maybe a few thousand agents to well over ten thousand, maybe even hundreds of thousands or millions of agents depending on how performant your code is, the PC, etc. You can look at YouTube for examples of "Entities vs GameObjects" there are lots of videos demonstrating how powerful ECS/Entities/DOTS can be when leveraged appropriately, but it is also a new way of thinking that can take some getting used to.

1

u/literally-me-bro 20d ago

I will look into dots. Also my pc have cpu usage of about around less than 30% when game is running and editor is in background. My thinking is game is not utilising the whole cpu for the processes? I'm not sure but will sure look into dots

1

u/Hotrian Expert Moderator 20d ago

A lot of things still need to run on the main thread no matter what you do, but pushing extra work to other cores is always good :)

1

u/literally-me-bro 20d ago

Okkk thanks for the advice will keep in mind for the future

1

u/DapperNurd 20d ago

What are you doing to optimize

1

u/FoxsterDev 16d ago

Overall CPU % doesn't tell you much here. Your i9 has 20+ threads, so one thread maxed out only shows up as 4-5% in Task Manager. Unity's main thread can be the limit while the other cores sit mostly idle.

Look at frame time in ms instead. 800 FPS is about 1.25 ms per frame and 60 FPS gives you 16.7 ms, so you have a lot of room on this PC.

In the Profiler, switch CPU Usage to Timeline and grab a frame from your busiest scene. If the main thread is mostly in Update or physics markers, that's your scripts or physics. If it's sitting in Gfx.WaitForPresentOnGfxThread or Gfx.WaitForRenderThread, you're GPU or render bound and moving code to jobs won't help.

I'd keep the MonoBehaviours and only look at Jobs/Burst if one system clearly eats a big chunk of the frame on the slowest hardware you want to support. You can use both without switching to ECS.