I enabled the plugin and i set it up on begin play and it does indeed merge parts together and saves me a good amount of draw calls, however im still losing quite a bit of frame rate due to them all being LOD 0. I have NO IDEA how im supposed to call to generate the LOD model. Usually ill use 3 LOD’s, or even 4 depending on the model but when its merged i guess thats not something it does automatically?
Edit: Looks like it actually is doing it automatically. The issue was somehow my skeleton mesh had its LOD reduction settings messed up and was almost always using lod 0
The other issue could just be camera proximity:
Some people put the character as the controlled one and still expect it to LOD down (based on what, I have no idea).
Merging meshes wouldnt net you performance due to drawcall count, but to skeleton bone count.
Generally each part has a full skeleton and 0 need to keep the 8 to 10 skeleton which move exactyl the same in memory.
So if you have too many drawcalls or a GPU bottleneck, you should be looking at other things to optimize rather than mesh counts (cpu bottleneck first).
Thats essentially what im working on now is narrowing down ways to improve. Although you say merging isnt going to net me performance with draw, it did indeed net me performance. I went from 15k draw calls, to 5k.
555 of them on screen.
A large amount of those 5k draw calls are likely materials from that ai.
Its a skeleton with 3 skeletal parts (body, left shoulder armor, right shoulder armor) as well as 2 static parts (sword and shield).
You must be dealingnwith many instances of the same/similar, which is fair.
To optimize the material you have to transoform it into a single one that covers the whole mesh.
If all the objects you merge use the same material, the merge will combine them down netting you a single drawcall (not really but in theory) per mesh.
The problem (not that much of a problem) with that is you essentially loose out on stuff like eyes/gums etc which are normally done as a separate thing for better looking final results - you could always change materials based on LODs by creating custom LODs first so as to preserve more detail (ei more materials) in lod0.
It’s actually a fairly common request/procedure.
Btw, if you were hitting a GFx bottleneck from too many skm, you were probably also hitting a CPU one from the bone load - merging is always better no matter what.
With the 555 skeletons on screen as pictured below, i get a good steady 60 fps roughly but thats only because i have disabled: Animations and Movement Comp.
You had also mentioned something about bone load? So i changed the AI’s skeleton to be a simpler one with less bone options and it made no difference unfortunately. I’m probably thinking about it wrong tho. More info on this? Also, i forgot to tag you in the above message.
The movement component is heavy.
First of all it contains tick stuff (in c++).
So you could change the tick group options to regain some bandwidth.
But either eay it automatically does replication and a lot more possibly useless things.
(Any need to replicate 555 meshes?)
The animations have their own memory load.
You can work around it with animation sharing.
Its what you need to do vast armies.
You may want to have a look at a few talks for the Assassins Greed based in france (unity?) where they had to optimize things for crowds of thousands.
Definitely: custom movement component for anything needing more than 100 instances at the same time.
Definitely animation sharing.
Definitely custom tick groups for things that are not other replicated players.
Definitely - repeat your benchmarks at full screen on a free standing exe with the engine closed as the engine itself overloads stuff…
Ps:
As you have the merging already setup, i had some success merging multiple models into pre-set lines.
So a line with the skeletons can have 10 skeletons which move as a unit retaining some automation…
Regarding tick groups, i know nothing about how this affects performance (if at all). You say bandwidth, but not fps performance? I’m less worried about bandwidth (like packet size right?) vs fps performance for the moment.
As for replicating 555 meshes, its just the standard test ive been sticking to so i can see the difference my optimization do for fps. That being said however, i have a far net cutoff point (so mobs load in from further out) because it just looks really cool Well, that and even if i shorten it up, if i want a big event where loads of AI are invading a town then i want to be sure it can handle a good amount of them, like these 555 guys. Also player dungeons can have 500+ AI in them, however those guys usually wont be so close together, you might see 100 on screen at one time and thats spread out.
I do have them being optimized in zones though, as you can see below. If they are a distance out from a player, it’ll optimize the AI based on distance zones. I also had set it up to change the tick since we dont need to see perfect ticking from far back.
Beyond 15k the system despawns them and saves info about them to be respawned when an invoker is within less than 15k distance.
Simply spreading these 555 AI out further but while still within 15k distance, my FPS was 28-34 roughly. So naturally the more spread out or further out they are, the more performant they are. These 555 are all close up, fully visible, and thus are using all options and tick so they are the most demanding vs the game naturally running where they wouldnt be like this. This is purely good for testing and making improvements, but also as i said previously if i want a sort of town invasion then there would be many mobs close together and on screen so i’d like to atleast consider the demand its having and how i can upgrade performance further.
This is interesting, i have never heard of animation sharing. I’ll have to look into this but i would assume its along the lines of if 2 AI are moving at the same time, make them do the exact same animation movements so instead of 2 AI running different frames of the same animation, it’ll have them run the same animation frame, something like that? That could most definitely work to optimize the farther out AI in the 10k-15k range, maybe even for the 5k-10k guys too. Am i understanding that correctly?
I would assume by this you’re saying if i have more than 100 AI, those are the ‘instances at the same time’ so i should look into a new custom movement. Anything reputable out there you know of thats way more performant than UE’s ? Atleast for AI.
This is something i’ve been doing as well, i always do my test in a ‘play in standalone’ so it fires up a dedicated server and a seperate client. The performance i get by doing this vs performance from building my client/server is pretty much the same, although built might be very slightly better. For all this performance testing tho it seems to be working great for testing without having to constantly build client/server.
I’m not entirely sure i understand what you’re saying here, but 1 thought that comes to mind is of a video i saw in the past where a group of AI would move together in a triangle formation or square formation, all together. I would think thiss what you’re saying, but i’ve never seen or heard of any options in UE that this can be tested with.
Do it yourself if it doesn’t need replication. The simpler it is, the better off your perfomance.
In fact, you can even do replication if you make it just work as a simple sweep and report thing that only offers minimalistic options (such as in air or on floor).
Before getting further.
Qe are assuming you have a CPU bottleneck caused by the movement component and animation - but remever that this is an educated Guess.
You should really try the stat tools to make sure.
With that in mind.
You more or less have it right for the animations but it goes further than that.
If you have all the same characters with all the same vertex, you can essentially instance a material shader that plays your animation.
The system should do some of that too under the hood.
It is, you just have to make it custom and its complicated if not impossible without c++ because of bone naming…
In the end it was easier to dump the skeletons alltogether and just use a shader to achieve top performance for an army of 10k…
Thanks for all the info thus far! Its sounding like my best bet is going to be either custom move comp (if i can find one that somebody has released + is optimized), as well as animation sharing. I’m not sure how viable it would be to change my AI’s to Apawn instead of the Acharacters but i know i’d get a heft performance upgrade there. I tried that over a year ago and couldnt get it to work for my needs since they cant roam on navigation mesh (i think thats what my issue was, cant quite remember).