Gunfight Performance
I started by refactoring the way we trace projectiles in order to reduce the number of dynamic memory allocations during gunfights and lessen the frequency of framerate hiccups. It’s difficult to say how much this improved exactly because it’s something that makes everything a tiny bit better instead of massively improving a certain thing you can point at and jerk off to.
In other vaguely gun related news, I replaced our decal system. The old system has been using Unity projectors, which in turn are using a very outdated way to project textures onto meshes and are extremely heavy on performance. We had a bunch of bullshit in place to try to work around this as good as possible, but what it ultimately did was force us to use decals very rarely and clean them up as quickly as possible, especially during intense firefights.
I replaced all of that with a concept called deferred (or screen space) decals. We can now render hundreds of decals in less than 0.1ms, which is great news for performance during gunfights. The new system also provides ways to adjust all parts of our physically based rendering pipeline individually to achieve things like pseudo-surface-deformation or wetness effects and Vince is already looking forward to using the new tools in his environment art. As a start I only converted the bullet impact decals to the new system to verify that everything works as it should. Once I’m sure of that I’ll convert all the other stuff and hand the tool over to the artists.
There’s still a bunch of stuff that needs to be done to make gunfights as smooth as they should be - mainly some fixes to the way we dynamically load assets the first time they are instantiated - but overall you should see some good improvements after this week’s update, especially during prolonged firefights.
Vegetation Woes
There was some weirdness that caused certain bushes, trees and other resources to disappear whenever a savegame was loaded - which sucked if you happened to place your sleeping bag inside one of those bushes or tried to hide your house between those trees. This is now fixed. I also went over all tree colliders and made sure they fit the shape of the tree they are attached to and server owners will like to hear that the spawn handler report now contains some more information that can be used to verify that all resources are spawning as they should.
Object Placement Fixes
Construction and deployable placement in caves and on terrain blended rocks finally works as it should again. I also fixed a bunch of exploits that involved placing deployables partially inside players to push them through other colliders or into rocks. There might still be some of those around, but we now have a solid system in place to fix them as soon as they come to our attention. As a side effect of this I changed building blocks to no longer ignore collisions right after placement - instead they also verify their placement position using the same logic as the deployables. And finally the research table and tool cupboard placement guides now actually represent the exact position and rotation of the objects they place.
Other Stuff
- Fixed light bleeding through terrain on the base of shadowed rocks in the distance.
- Fixed light going through furnace walls for a second when walking by.
- Fixed torch still getting lowered into the line of sight if lighting it while already running.
- Fixed incorrect time zone offset of the ingame world.
- Fixed barricade LOD changes being somewhat flaky.
- Fixed arid biome rock terrain texture being way too dark.
- Fixed various situations that could incorrectly trigger noclip kicks.
- TerrainPath now keeps a list of all spawned monuments.
- Added test cave to CraggyIsland.
Next Week
My addiction to Rust resurfaced after last week’s wipe and I’ve been playing a shitload of it over the weekend and whenever I wasn’t busy
working on Rust. During those gaming sessions I found a ton of minor and not-so-minor issues and I’ve been quite busy trying to get around to fixing them all. This means next week will be much of the same as this week: fixing, polishing and continuing to integrate and tweak all of the new stuff I added over the last few weeks. A somewhat wider field I’d like to approach in the near future is to look into player movement and see how I can fix some or all of the annoyances it’s currently causing.