The Performance Update [Rust]
ELT-StaffSadikReis 0 Comments · Likes · Like · 6th Sep 2018

Bandit Camp Performance
There were quite a few optimizations made to Bandit Camp this month. From excess draw call reduction via art and code, as well as new ways of drawing trees and you can see in Diogo's and Andre's Tree rendering related sections.
There has been some optimization on the art-side of the town as well. Damian has adjusted the LOD distances on dozens of small objects to make them LOD and cull quicker. Swamp cabins were given an additional LOD level and their LODs were merged to help with occlusion. Small foliage, such as reeds and water lilies, were also made to cull quicker.
The trees present in the Bandit Camp and buildable swamps have seen a significant performance overhaul. Previously, they consisted of two materials each, however we have decided to merge their textures into an atlas. As a result, the number of drawcalls generated by the swamp trees (which make up a significant portion of the scene) was halved.
Most of these tackled CPU performance, while only some really tackled GPU overhead. We figured it was time to move on to other optimization tasks when performance was decent and finally scalable or GPU dependent, which means it can be played properly well if players lower the game's graphics quality, resolution or get a more powerful GPU. Our goal for this patch was 50-60 fps at 1920x1080 on a GTX 1060 (3GB) with default settings.
There is still a lot of work to do, and the Bandit Camp may still get slow with a lot of players. The cost of rendering players and NPCs themselves are a problem which we also plan to address as soon as possible.

Graphics Jobs
Over the past few months we have made a huge collective effort to eliminate the majority of client-side CPU performance bottlenecks. This month, however, as we eliminated the last big ones, we ended up at a point where Unity's CPU-side rendering was essentially clogging up our main thread. However, the complexity of our scene just didn't match the inflated rendering times. Thankfully Unity had been working on a solution.
We've enabled  graphics jobs in Rust this month. This is a relatively new Unity feature that greatly reduces CPU overhead by making better use of multithreading. It's a somewhat risky move as Unity is still considering it an experimental feature, and in past releases we encountered significant issues with it and had to roll it back, but we've done thorough testing and couldn't find any issues we weren't able to work around this time. In our testing it significantly improves performance and Rust is now utilizing the GPU a lot better than before and is no longer CPU bound on most hardware, which means graphics settings actually have an effect on frame rate.

Garbage Collection
We profiled, tracked down and fixed various memory allocations that could lead to stuttering caused by the garbage collector. The main areas affected are:

  • Ambient sounds
  • Image effects
  • Prefab pooling
  • HUD (name tags, team indicators)
So as you can imagine, given the frequency those elements are being used in the game, this added up to a pretty significant performance issue.

Workshop Skin Downloads
[color=rgba(205, 65, 43, 0.8)] ANDRÉ STRAUBMEIER
In early August we released an update to include all workshop skins in the main game install so new players no longer have to download hundreds of megabytes while playing. We were able to limit both download size and the amount of disk space used by those skins using texture compression to ensure this is a future proof system. Future skin releases will still be downloaded from the workshop until the next game update is released, at which point they will be included in the update download.

Max Tree Meshes
[color=rgba(205, 65, 43, 0.8)] ANDRÉ STRAUBMEIER
I implemented a system to limit the amount of tree meshes to render independently from how many trees are actually around you. This is done by forcing all trees that exceed the limit to be rendered as billboards, only rendering the trees closest to the camera as meshes. This has the advantage that thick forests have less of an impact on performance, so if you're suffering from performance issues inside forests make sure to enable this. You can adjust the number of trees to render in the graphics settings.

Prefab Pooling
[color=rgba(205, 65, 43, 0.8)] ANDRÉ STRAUBMEIER
I implemented the third, and hopefully final, iteration of prefab pooling this month. The old prefab pooling system could reuse prefabs once instantiated. However, the pool was starting out empty when joining a server, which for example meant some lag could occur the first time you fired a gun. This was causing frame drops in many situations and made the overall performance feel rather terrible. The new system solves this and as a side effect is much more efficient for the garbage collector since any dynamic memory allocation from Unity's game object instantiation is done in the loading screen and immediately cleaned up before even entering the game.

Camera Movement
[color=rgba(205, 65, 43, 0.8)] ANDRÉ STRAUBMEIER
Rust uses a physics based character controller. This means both the player and the camera move in fixed time intervals with the rest of the physics system. The problem is the physics system only runs at 32 frames per second by default to avoid excessive CPU load. This meant only the camera rotation (mouse input) could take advantage of high frame rates and not the camera movement (keyboard input), which is locked to player movement in first person view. I found a way around this so the camera is now both moving and rotating in every frame, which makes things look a lot smoother on hardware that can handle high frame rates.

Terrain Quality
[color=rgba(205, 65, 43, 0.8)] DIOGO TEIXEIRA
A few months ago we deployed an optimization for the terrain shader and textures that involved texture arrays. Because of it, and since we upgraded to Unity 2018, lowering graphics quality had no effect on terrain texture resolution, which means you may not be taking full advantage of lowering graphics quality since rendering the terrain still cost the same.

This issue is now fixed and terrain texture density is now properly downscaled according to settings. Lowering terrain texture density will benefit low-end graphics cards the most.

Tree Impostor Performance
[color=rgba(205, 65, 43, 0.8)] DIOGO TEIXEIRA
Ever since we increased the viewing distance for trees, impostors have become one of the biggest CPU bottlenecks. Rendering thousands of independent objects, even simple ones like impostors, may involve a lot of culling, sorting and drawing calls. As part of the CPU optimization push we made this month, I took the opportunity to tackle impostor performance and wrote a specialized renderer for impostors that maximizes hardware batching potential. While it has minimal effects on GPU performance, it essentially eliminated all CPU cost.
In practice this improvement will benefit some machines more than others. However, the benefit will be apparent when combined with all other changes and you should see an reasonable FPS improvement.
Please note that, unfortunately, due to a Unity bug this optimization is disabled on macOS. We plan to correct this, hopefully on the next patch, as we switch from OpenGL to Metal.

Atmosphere Volume Improvements
[color=rgba(205, 65, 43, 0.8)] DIOGO TEIXEIRA
Last month, when we introduced Bandit Camp, it featured our new atmosphere/fog volumes. As promised in the last update, instead of simply slowly fading in after we walk into the compound, I've updated the volume fog rendering to also work correctly when we're outside looking in.

This makes the transition smoother and less awkward. The entire volume is faded with distance, so after 500m it starts fading away until it's no longer visible. Also fixed an issue where standing at the volume edges would reveal some hard edges forming the shape.

Occlusion Culling
[color=rgba(205, 65, 43, 0.8)] DIOGO TEIXEIRA
Due to this month's CPU optimization push, occlusion culling may be less of an advantage because the CPU cost of running it may overshadow the benefits we're getting on the GPU. We plan to address this going forward by moving most of the work to the GPU. It is only then, without that overhead on the CPU, that the benefits will be net positive in all stages of rendering.
In the meantime, if you notice any lag when rotating the camera or in other instances, you can find a new option to toggle occlusion culling under Graphics Options / Experimental. Feel free to try disabling it (on by default) to see whether it helps with your particular configuration.

Nametag Performance
[color=rgba(205, 65, 43, 0.8)] MAURINO BERRY
Earlier this month a hotfix was pushed out to address a serious FPS issue that had been present ever since the new name tags were added. The improvement will mainly help those clients with slower CPUs, but everyone should have seen a 10-20% FPS improvement.

Smoke Grenade
[color=rgba(205, 65, 43, 0.8)] MAURINO BERRY
I added a new uncraftable grenade this month, the Smoke Grenade. The new ‘nade will obscure the area they are thrown in for 45 seconds, and can only be purchased at Bandit Town for 10 Scrap.

Farming Changes
[color=rgba(205, 65, 43, 0.8)] MAURINO BERRY
I recently changed both corn and pumpkins to be stackable, which should make them less annoying. I removed their condition value as well, so no more 0.1hp pumpkins. I also changed how plants work, so you can only harvest the fruit when it is fully ripe, which now lasts 48 hours before dying.

To combat food spam we changed the rate at which you gain health from health over time to be half as fast, this renders the large Medkit even more useless, but it is due for a rework next month anyway.

CCTV Camera Test
[color=rgba(205, 65, 43, 0.8)] MAURINO BERRY

Some experimental work was done on a CCTV camera system. This will work by allowing you to deploy a laptop on a table and cycle between cameras nearby. Initial tests seemed to indicate this would be viable so we may move forward with this new feature next month.

Bandit Town Recycler
[color=rgba(205, 65, 43, 0.8)] MAURINO BERRY
In a small oversight, we forgot to add the recycler to the Bandit Town. This is now fixed.

The recycler can be found in the wheel house of the dredge.

Repair Bench QOL
[color=rgba(205, 65, 43, 0.8)] ALISTAIR MCFARLANE
A long time community request was to be able to place deployables under the repair bench. You can now do this, and I enabled it on the BBQ as well.

[color=rgba(205, 65, 43, 0.8)] PÅL TREFALL
This month saw a rewrite of the AI’s sensory, behavior and aim systems. They’re only applied to the scientists at the Military Tunnel this month.
The sensory system lets us update different sensory modules at different frequencies, which allow the sensors that matter to be much more reactive than before. Preliminary steps have been made to make this much more efficient performance wise in the future.
The new behavior system is able to plan into the future and think multiple steps ahead when making decisions. This makes it both easier to design the behavior we want and debug their behavior when they act oddly.

The aim system works on a model of deliberate hits and deliberate misses, so that the AI can control how well they hit their targets based on alertness and timing.
The Military Tunnel Scientists should now stay much more engaged with players. They hear footsteps, explosions and gunfire. They are better at using cover and they have learned to throw grenades and use syringes.
Animals saw another tweak to their roaming. They are now restricted to not roam too far away from where they spawned, which should keep them all from ending up at the coast of the island.

Localized Ambience Performance
[color=rgba(205, 65, 43, 0.8)] ALEX REHBERG
Our system for playing back localized ambience (tree leaves rustling in the wind, waves on the shore, etc) had ended up used in some ways it wasn't originally designed for over the last few months, and we discovered some performance issues stemming from it. The Unity CullingGroups we use to enable/disable these sounds were being updated too frequently. I've made some changes this month that greatly reduce how often we need to update those CullingGroups and have made those updates much more granular, which means they're much faster when they do need to happen.

Hide Signs Option
[color=rgba(205, 65, 43, 0.8)] GARRY NEWMAN
Streamers' dreams have come true: I've added a new option to hide signs which can be found in the options menu. This will hide all player painted signs in-game.

Preview: Cargo Ship Event
[color=rgba(205, 65, 43, 0.8)] DAMIAN LAZARSKI
For the past few weeks, Vincent and I have been hard at work on a new monument. The Lazarus is a large shipping vessel owned by the Cobalt Cargo Shipping Company. It is meant to circle the Rust island and deliver goods to the scientists working there. This large ship will contain valuable loot and will be protected by the scientists that players will have to defeat in order to access it.
While all of the artwork for this monument is currently finished, we decided against releasing it this month. Currently, the ship works only as a static monument and spawns out in the ocean. However, the idea is to have it move around the island. To achieve that, some new game code will be required, and it's not an easy task as players and scientists will have to be parented to a large moving vehicle.
In the meantime, below are some screenshots that will tide you over while you wait:

Preview: New Glove Types
[color=rgba(205, 65, 43, 0.8)] TAYLOR REYNOLDS
I've been working on some new glove types: Burlap, Roadsign and Tactical versions based on some concepts Paul made. I was doing some final fixes when we locked down the patch, but they're all done now so expect them in next month's update!

These are designed to take advantage of the new(ish) first-person clothing and look pretty neat from the first-person view:

Preview: Slot Machine
[color=rgba(205, 65, 43, 0.8)] THOMAS BUTTERS
To expand the casino, I made a slot machine. The winning conditions aren't set yet, and so the conditions will be added at a later date to the texture on the top sign.

Preview: L96 Sniper Rifle
[color=rgba(205, 65, 43, 0.8)] THOMAS BUTTERS
This is the new L96 Sniper Rifle. It's the military counterpart to the Bolt Action Rifle currently in-game, and like the other military grade guns it's expected to not be craftable.

It was super fun making this, so I hope you all have fun using it when you get the chance.

204September 06 2018

NEW Scientists at Military Tunnel throw grenades.
NEW Scientists at Military Tunnel use syringes.
NEW Workshop skins are now included in the main game download
NEW Added prefab warmup to loading screen
NEW Added new prefab pooling system
NEW Added "Max Tree Meshes" graphics option
NEW Added ladder trigger for custom maps
NEW Added high frame rate camera movement
NEW Added Smoke Grenade item
NEW Added "Hide Sign" option
NEW Added multi-threaded rendering
NEW Added occlusion culling graphics option
NEW Added new optimized impostor rendering
UPDATED Scientists at Military Tunnel hear footsteps, explosions and gunfire.
UPDATED Scientists at Military Tunnel use a new aim system.
UPDATED Scientists at Military Tunnel use a new, more reactive, sensory system.
UPDATED Optimized asset bundles
UPDATED Optimized loot panels
UPDATED Fixed various skin icon issues
UPDATED Optimized various dynamic memory allocations
UPDATED Health over time takes longer to convert into health
UPDATED Optimized mesh LOD updates
UPDATED Reorganized graphics and performance settings
UPDATED Optimized low level memory pool
UPDATED Pumpkin and corn now stackable to 10
UPDATED Removed pumpkin condition
UPDATED Workbenches now decay after a long period
UPDATED BBQ allows deployables underneath
UPDATED Repair Bench allows deployables on shelve


Register to our website!

Already have an account? Login »

Who's Online
Online Guests: 1