The game I’m making involves lots of animated skinned mesh NPCs (none exceed a triangle count of 1500; most are 1000 or less). There will occasionally be up to 30 on-screen at a time, although it is usually fewer.
It seems as though ANY amount of these NPCs will cause performance issues on my phone (Pixel 7 Pro), while gameplay is constantly smooth on my PC. My phone does not struggle with roblox games normally.
All of these skinned meshes have their RenderFidelity set to Performance, yet there is NO visual nor performance difference between that and when RenderFidelity is set to Precise.
Am I missing something? Is there a better way to make the performance better for mobile? Thanks.
Only thing that i can think of is adding a “Performance Mode” that can optionally be toggled off/on for anyone having performance issues. This will obviously degrade visual quality but it’ll boost performance in the process.
If the performance is bad, it might not be the NPCs themselves. It could be unoptimized script(s). You should run a debugger of some sort to figure out the exact problem.
Unfortunately any amount of graphical changes that I’ve tried so far has not made any noticeable difference. I will try to figure out how to use a debugger to find issues in scripts.
This might be the issue… on both mobile and PC it shows high memory usage from 800-1000 MB, but this seems to be consistent throughout the game regardless of whether or not the NPCs are actively spawned.
It’s really frustrating that RenderFidelity seems to make absolutely no difference, as I have it set to Performance but to no avail.
Ok I had a play around with making an admin menu that you can use to disable certain scripts on all NPCs, and it seems like the main culprit is because I was setting the NetworkOwner of each NPC to whoever they are currently targeting. The default Roblox animation scripts are also causing some lag. I can spawn hundreds of my NPCs without any scripts and there will be no noticeable lag.
Anyone know of a good way to make it so the NPCs aren’t several studs behind the player when they are attacking? They are all melee attacks, but if the NetworkOwner is set to the server they appear far away when running at the player while simultaneously attacking, yet still landing hits.