The contents of this post still apply after the Empires Update. Please check for any later replies I make under this thread for information not important enough to update this topic.
Decided to make a topic about my findings on performance/optimization on AO today. A lot of the stuff here might just straight up be wrong so don’t take my word for it!
Note before going ahead: all of the information I’ve collected here come from 1 MicroProfiler dump and should not be used as a single source of evidence for any problems with AO’s optimization. It is important to test on multiple times and on multiple devices.
What I found
When I dumped the MicroProfiler and opened up the memory flamegraph, I noticed that the thing taking up the most memory allocation was “new Texture”. I’m not too aware if the “new” prefix refers to the construction of new instances, but I am going to assume such , so does the game have a bunch of texture instances, and if so wouldn’t it be possible to use custom materials which got introduced instead? I checked Devas of Creation, another big MMO-RPG on Roblox, as well as the game I program for, PSYCHIS, and I wasn’t able to find any “new Texture” timer/thread - all of this could definitely be a whole bunch of non-sense but i want to mention it anyways.
(Memory flamegraph by memory allocations size for an AO client session ran without preforming any actions after ~2-3 minutes)
Another thing related to memory which i have no proof/information for, but I’ve noticed depending on the server the player is in, memory can vary from about 2700-3000MB - at least during the first few minutes of just having had loaded in - which leads me to believe that there is definitely something server-related (possibly with instances not being destroyed/cleaned up?) causing this memory consumption. Vetex is probably already aware of this.
I honestly don’t have anything more to say about memory related stuff, I can definitely look into it more, but I probably wouldn’t be able to find much more at least memory related. Here’s another memory flamegraph if it finds any use though - these tests have already probably been conducted anyways.
(Memory flamegraph by memory allocations count for an AO client session ran without preforming any actions after ~2-3 minutes)
As for analyzing the CPU flamegraph, many of the threads present would be fixed if there weren’t as many humanoid instances in the game - as far as that is what I have come to believe. If it’s possible for them to de-load based on distance and sight, it would do great work. I believe Vetex has already made this optimization as said on the trello that “player characters now unload based on distance from your own”, but I am unsure if this includes NPCs as well if they haven’t already been doing this. If they are, it would be definitely good to check as to why humanoids are being such a detriment to client performance despite being de-loaded.
(CPU flamegraph for an AO client session ran without preforming any actions after ~2-3 minutes)
Anyways, as for networking, I wanted to see if AO uses any networking library. I obviously cannot see through the MicroProfiler, so I am wondering if AO does. If it doesn’t, adding one definitely could be good. One that I use live-in-production for the game I work on, is ByteNet by ffrostfall. It’s great.
It can actually help client performance - probably not in AO’s case since the problems stem from other places - but more importantly it helps with ping.
Final remarks
Anyways, that’s all I’ve got for now. I’ll update this topic/thread with any more of my findings/suggestions/questions.
If anyone has found anything else, add them here. Or if anyone has any questions or things you want me to look at - as long as they’re within my reach - I am more than happy looking into them!
Resources
Some articles definitely worth taking a look at, and I’ll be adding to these as I find more WELL WRITTEN ones.
Device Specifications
These are my specs I used to conduct these tests:
CPU: AMD Ryzen 5 5600X 6-Core @ 3.70 GHz
GPU: Nvidia RTX 3070
RAM: 32.0 GB