Performance Improvements - Changes To The Missile System!
Missiles are one of the most widely used weapon types in New Eden. Interchangeable damage across all four types, lack of transversal dependence, high DPS, immunity to tracking disruption, and no need for capacitor are all significant benefits to the pilots of ships equipped with launchers. These punishing offensive tools, whether they be lights, rockets, heavies, torpedoes, or cruise missiles, represent a serious threat to all capsuleers.
They also represent a serious challenge when it comes to client performance. The previous implementation of missile graphics code did not treat these popular weapons quite the same as other assets in space. Insufficient optimization for the nature of the objects has left them using more resources than other similarly sized, frequently encountered objects and because missiles stay in space until detonation or fuel exhaustion, they had the potential to become a drag on client resources in scenes where launchers abound.
With the Triglavian Deviant Automata Suppressors as inspiration (they are remarkably good at cleaning up missiles, after all), the Audio & Graphics Group decided to take a look at missile graphics and make some improvements in order to improve the performance of clients running missile heavy scenes.
Please be aware that these changes do not affect the application of missile damage, or the related code for calculating velocity, flight time, explosion speed, and other related values. Only the visual appearance of missiles and missile explosions in the space scene are affected.
A series of controlled tests populated the scene to establish a baseline framerate value (without restricting the interval) across the machines meeting EVE Online’s recommended specifications. Adding a continuous flood of missiles from all entities in the controlled scenes dropped the framerate significantly. The delta between the two values provided a gauge by which to evaluate the results of any changes.
Efforts focused on several areas determined to affect missile performance:
- Damage locator selection
- Missile mesh Level of Detail (LoD)
- Explosion spawning
- Clean Up
When a capsuleer activates an offensive module in New Eden, the graphics engine goes through a process to determine how best to display the effect of that weapon on its intended target. To keep things interesting but not slog down the client with complex math, there are several predefined points on each model than can be hit by a targeted weapon. These points are referred to as “Damage Locators.”
For the immediate effects of turrets, the graphics engine runs a series of virtual functions on the list of available damage locators. These function calls to select the most appropriate locator occur quickly, with minimal performance impact, and the effect plays immediately. For missiles, however, the selection process is significantly more complex, integrating flight arcs and target orientation.
While virtual function calls are normally not tremendously taxing, having many of them running in a tight loop can be more expensive than necessary. The new implementation cuts down on the complexity of the loop, reducing the drag which results from these virtual function calls. Essential elements are still present; missiles won’t fly around after fuel depletion or remain in space after explosion, and appropriate damage locator selection will still ensure that the missile stays on target. But a good chunk of processing power can now be dedicated elsewhere.
Missile Mesh Level of Detail (LoD)
Late in 2017, missiles were out of line with the V5++ work already long completed on other ships and structures in space. An investigation showed that adopting a box-rendered, ray-traced missile would reduce complexity, curtailing work that would almost never be used in client. The result is visible in the client now: a low detail mesh, a mote of light (called a “blinky”), and a trail particle effect representing exhaust.
Even the low detail mesh has some cost, though, and with some launchers simultaneously firing multiple warheads per salvo, that cost can be significantly magnified. To cut it down further, level of detail (LoD) rules now apply to missiles. At specified distances, the engine will cease to draw the mesh, letting the simple blinky and smoke trail convey the positional information for missiles for viewers at longer zooms. This ensures that no gameplay information is lost, but no extra pixels are drawn by the engine.
With the impact effects of missile explosions, it was possible to go one step further than applying LoD to loaded assets. At longer distances, these effects are incredibly small on screen, conveying minimal information but at the premium price of memory and drawcalls. To cut that price down, the engine will now not even load the explosion unless the camera is close enough for it to be seen. As a result, system resources remain available without any detriment to the quality of the space scene.
The most significant improvement to overall client performance, however, came from a series of defect fixes and optimizations in one of the surprisingly resource intensive steps of the process: scene clean up. When objects in space are removed from the scene, many different systems in EVE’s codebase need to know. The overview updates, the targeting icons shift, the tactical overlay adjusts; countless different elements of the interface constantly pay attention to what is present on grid and when something leaves, they notice. The biggest savings in the missile rework came from changing the way EVE’s various game systems react to the removal of an object. These changes, which began as a way to improve missile performance, actually affect all heavy scenes where large numbers of objects leave the grid at the same time. Static observers of large fleet departures, smartbomb fleet pilots, and even casual Jita 4-4 undock tourists may be able to recognize the benefits of the adjustments to scene clean up. But the improvements shine brightest in the results of the comparison test using missiles.
After incorporating all four of these changes, the test environments on the selected platforms successfully returned new values for the performance tests. The results indicated that overall the performance impact of missiles had been reduced by between 10% and 20%, depending on the platform. This reduction in performance cost is better contextualized, though, by observing the associated framerate increase. Across tested platforms, the changes resulted in a minimum average framerate increase of 50%. The greatest improvement reflected an average total gain of 76%.
Test Environment 1:
Test Environment 2:
The Audio & Graphics Group is always searching for ways to improve the experience of capsuleers in space, and this work is only one of the projects in progress with that aim. Even now we have our sights set of other effects, assets, and environments to optimize more effectively in future releases. In the meantime, we hope that blowing things up with rockets, missiles, and torpedoes will be easier to enjoy in this release and look forward to further enabling your immersion in New Eden.