Regarding Client Performance Optimization
By STAFF_Ines
Sep 30th, 2016
Hello, my name is “Chase”; I am the TOS Dev team programmer in charge of client optimization. As we all know, client optimization has been one of the most requested features from the ToS community. There has been some improvements through other fixes, but there is still work to do. We are currently investigating solutions to this problem and we’d like to update you on the process.
Current Status
To optimize effectively, measurements are very important. A regular play pattern should be recorded and measured so that it can be compared with future results. In this process, replay function and performance visualization tools are used. So far, the optimization process has been focused on scenarios of either a situation involving one player or multiple monsters. The work has been done with the data from such scenarios. Through this, we have successfully achieved a few positive results in PvE environments. What we are focused on at the moment is the situation where a player is placed in a crowded place i.e. at big cities.
City Environment Analysis
We have captured a crowded city from our Japanese server and measured it via the replay tool.
From our observations, we determined that a considerable bottleneck effect was occurring during animation updates, and after a more detailed analysis we concluded that the major source of the problem was in the morphing function. Morphing is the process that gradually changes one image into another.
We use this process in ToS to create our unique style of animation you see in character hair movement, for example. The function itself is quite simple, but the intensive CPU processing it requires does tend to create some bottleneck issues. To solve this, we applied multi-threading, allowing each of the different objects to be simultaneously processed by its respective CPU core.
Results
The results we obtained after applying the multi-threading function exceeded our expectations. In our internal tests, we observed performance improvements of up to 1.5 to 2 times in a 4-core CPU, and 1.5 to 3 times in an 8-core CPU. FPS was steadily increased and occasional framerate spikes were significantly reduced. For reference, the specifications of the PC used for testing are as follows: CPU - i5 3570; graphics - GTX650; OS - Windows 10.
One thing to consider, however, is that this multi-threading process might cause hidden bugs that are unseen at the time of testing. That is why testing sessions to see if newly worked-in codes do not cause any errors are needed. After this process goes through the testing and is included in a patch, we expect a great performance increase especially in areas crowded with player characters.
Future Plans
First, we intend to continue exploring multi-threading. Starting with morphing, we want to extend the process to gradually start separating other tasks that occur before and after it, such as effects where there is room for further improvement.
Another aspect we’re tackling is related to resource loading. The slight performance drops that can happen whenever a character meets a new NPC or monster in-game are a problem we are seriously taking in consideration. We expect resource management measures will help a great deal in solving this.
I am constantly keeping an eye on the feedback our players leave on the forums concerning FPS drops in their particular gaming environments. Rest assured that we will continue to work hard to solve the main issues that affect a considerable part of our player population.
As you can see, there is still room for further optimization besides the measures explained in this blog post. Also, after the optimization patch is applied, there might be some discrepancies between the observed results from our development environment and the actual result on the environments of our users. Your feedback after the patch on how much it improved and what your computer specs are will help our development immensely. We strive to solve the client performance issue until the day it no longer is a top issue.
Well, that’s it for now, I’ll keep working hard to bring you guys even more good news. Thank you for reading this rather long and technical stuff; cheers.