Non-patch week, but we’re busy investigating and optimising, and we have an important poll about gunplay.
I spent far too many days this week observing the helicopter in action and calling it in on unsuspecting players (sorry about that), but I did learn quite a bit about how players are dealing with it and found quite a few bugs/exploits. It’s amazing how much you test and try and balance something beforehand and how quickly it all goes out the window when the community gets their hands on it. I’ve seen countless helicopters shot down without killing anyone. Here’s a list of changes to expect to show up on Dev this weekend
- Tool Cupboard ‘exploit’ will be fixed.
- More rocket strafes in general, not just when target line of sight is lost.
- Door Gunners will switch targets on the fly instead of spamming the last known position of a player they are targeting. This means you won’t be able to kite the door guns anymore while your friends take the helicopter down.
- Crates will actually be unlootable until the fire goes out (looks like the flames weren’t enough of a deterrent).
One thing that was made very much apparent by the introduction of the helicopter was how slow our bullets really are. You have to lead the helicopter way too much. I’m thinking we should double the speed of bullets which will effectively make them hitscan at short range, increasing the responsiveness of gunplay in general. We’ve got a poll in Garry’s section for you guys, so we can gauge how you feel about this.
With the helicopter being a big hit–and assuming I get all the bugs fixed–I’d like to investigate adding some PvE encounters for the early game and not just the endgamers
The server performance has been suffering for a couple of months. The actual framerate is fine, but every minute or so there’ll be a freeze, so I’m doing some investigation into why that is. The main culprit seems to be the amount of garbage we create.
The biggest source of garbage right now is the network system. When we send an updated entity to the client we fill a protobuffer with info, turn it into binary, then send it to Raknet (on the native side). This has worked well but it’s creating garbage on creation and turning itself into bytes.
So I’ve dived headfirst into the problem. I’ve added object pooling to the generated protobuffer classes. This wasn’t as complicated as it sounds and was actually a lot of fun to get working properly. These protobuffer classes are used all over our code though, so there has been a bunch of edge cases that I’ve needed to go through and verify one by one. When we were sending a protobuffer over the network, we were making it generate a byte array and then pushing the byte array to the network system. Now we pass the protobuffer the network stream and it writes directly to it. The idea being that it’s now writing directly to native, so there’s no garbage to be collected.
All this is mainly theory. It’s making the situation better in theory. Because this wasn’t something we tracked and quantified before there’s no way to know what kind of difference it’s making, so I’m working on a bunch of diagnostic tools so this shit can be flagged up better.
Have you noticed how sometimes you’ll shoot something in Rust, it’ll get destroyed, and it’ll stop playing the impact sound straight away? Or when you shoot your gun and switch away the shoot sound will stop playing abruptly? Or when you shoot another player and they turn into a ragdoll the blood effects will stop playing? Well I fixed that this week too.
We’re gonna start having a poll on every devblog to feel out how the community feels about certain things that are on our mind. This isn’t a referendum, we’re not going to stop thinking for ourselves and do whatever the result is. It’s just to gauge opinion.
I finished the last week/weekend off with a number of hotfixes which went live over the course of the weekend.
- Fixed building parts slowly spawning on join (now done in the loading screen).
- Fixed external walls and gates being placeable partially inside of players.
- Fixed metal and stone barricades being easily destroyable with arrows.
- Fixed all events being run on server restart.
- Fixed a number of decal projection distances.
- Fixed mushroom/hemp pickup particle effect.
- Fixed oil survey crater.
- Fixed certain pink particles on OpenGL.
- Fixed null references in shader variants.
I’ve been working on combining building colliders on the server side for a while, and this week I finally finished it off and pushed it to the dev branch. This will allow server owners to have much bigger intervals between their wipes, especially on high population servers. It might also improve server physics performance, but it remains to be seen how that theory holds up on servers with 200 players.
Entity Visibility Checks
While implementing collider batching I realized how silly our checks for “get all entities around this point” and “is this entity visible from this point” are. Code that does these kinds of queries was scattered all over the place, with no unified way of doing things. This is especially bad when you want to optimize these checks since you cannot just optimize one central spot but instead have to poke around in ten different files.
Long story short, I ripped all of that out and centralized it. This is great for collider batching since there’s now a single point where I have to do the batched collider to individual collider lookup, and it’ll also be great for any future optimizations we add.
Speaking of optimizations, while refactoring the entity visibility checks I came across the sad state of server side dynamic memory allocations. I went ahead and converted a bunch of our bigger allocations to a pool allocator. All you need to know is that it makes things faster and eliminates garbage collections. Some of that also branched out into client side code, so things have gotten a bit nicer there as well.
Gib performance has been horrible for a while, so I added a few quick fixes for the major causes of that. Gibs will need some more love in the near future, there’s still much to be improved.
- Impact effects now get the exact terrain material at impact (sand, dirt, …).
- Added correct AI obstacle shapes to building pieces.
- Fireballs use better sound balancing (client side performance).
- Run the garbage collector in the loading screen (join, respawn).
- Added deploy volume that uses the newly added unified entity OBB.
- Clamp AF between 1 and 16 (fixes silent errors).
There are a number of things I’d like to look into next, but I’ll have to see how many of them I’ll be able to fit in before patch time next week. The two biggest things I’d like to address are effect/decal pooling as a client side optimization and improvements for the procedural maps with the possibility of adding the first draft of Vince’s new sex dungeons*.
Water 2.5 Rivers
After fixing a few bugs left over from the last update, I switched back to working on the water. Local reflections are still work-in-progress; I’m using a few more days to polish them in preparation for next week’s update. Finally did some work on the rivers and they’re shaping up nicely to fit the ocean. This work will naturally be extended to lakes as well (e.g. Hapis).
Rivers now fade away nicely into the background as expected as they are now affected by global fog and atmospheric scattering:
A higher perspective no longer shows a flat opaque surface across the river bed:
Transitions to ocean now look more seamless:
Please note that there’s no wetness around river beds yet. I’m leaving that for a later iteration.
Water 2.5 Bug Fixes
You might have noticed this artifact before, when walking around ocean water:
It affects all GPUs and platforms. It’s now been fixed and available on the development branch. It’ll be up next week as part of the stable update.
I took the opportunity to change the water mesh code in order to get rid of this insane clipping bug that has plagued AMD users for a while:
- Disabled shader warmup by default on OSX (run with -shaderwarmup 1 to enable it).
- Fixed Depth-of-Field effect ignoring water surface.
- Fixed hang or crash when changing quality setting in GL/OSX.
Polish local reflection code. Polish river code. Extend changes to lakes. Cleanup, test and submit Water 2.5 for next week’s stable update.
Progress on the clothing pieces from last week has unfortunately been kind of slow. I’ve run into a few software/technical issues that I’m working on getting fixed, but I’ve still managed to get a little work done.
I should have the problems sorted out, so I can get back to doing more actual work instead of just troubleshooting.
I completed the low poly version of the red dot sight. I also started texturing it. I still need to add more dirt and scratches to it, but it’s coming along.
I also worked on adding edge wear and dents to the flashlight and silencer high poly models. Once I’m happy with how they look, I’ll begin work on the low poly versions.
Continue working on the add-ons. I need to go over the holosight again as the dents and scratches needed more work to look realistic.
Managed to get a bunch of the surface decals and FX done this week. So we now have
I still have cloth, bone, rock, tundra and water to do.
Started work on the blood effect system. Basic decals for entry/exit wounds are in. Blood spurts are working, but there is still a bunch of work to do getting everything to hook up.
- Finish the surface decal/affect work.
- Work up a bunch of blood splatter/spray decals.
- Take a look at improving the bleeding out effect.
More work on the female. She’s nearly done on the texture work!
In some spare time I’ve been splitting up the AK47 into parts similar to how the SMG is, which means the AK will eventually have the same functionality for customisation as the SMG. Awesome! I’ve also started to go over the texture for the AK47, because it sucked pretty badly. The way we’ve done it for the SMG is to split the customisable parts into their own UVs, which gives us better resolution overall.
Here’s a sneak peek.
Finish the texture work and onto the LODs!
Some fixes to view models this week including:
- Rocket Launcher – Fixed snapping when going to ironsight, added dryfire sounds.
- Hammer – smoothed out anim speeds.
- Bow – Made viewable again, fixed popping on drawn idle loop, improved transition when cancelling arrows.
- SMG – dryfire fix.
- Salvaged sword – fixed snapping on hit reactions.
I also added a hold state for both the bean can & F1 grenades meaning it can now play an animation while you’re holding it, as opposed to the totally static pose it had before.
So this week I’ve been working on a bunch of silencer/suppressor add-ons for guns. I’m Googling and downloading so many books on homemade weaponry at this point that I’m sure it’s just a matter of time before the FBI raids us, so I’ll try and get as much of this stuff done for tom to model before a SWAT team comes for us. Been trying some different ideas of what you might be able to create with bits of junk you might find lying about, from a simple bottle stuffed and wrapped with cloth to oil filters (these work great IRL, too :p). Also in the beginning of some improvised scopes, I imagine these would naturally go well with the bolt rifle but maybe an M1 type gun might be pretty sweet for these too further down the line.
More work on scopes and other addons.
This week I finished up silenced gunshots. Getting them to sound subdued enough to feel stealthy but still sound impactful enough to make you feel like a badass when you are blasting people was tricky, but I had a lot of fun with it!
I started working on new sounds for the survey charge, tree impacts (I want to pitch these up/down depending on the size of the tree you’re hitting), and wooden door impacts.
I’ve also spent a bit of time cleaning up and organizing our mixer (the thing that all sounds get routed through for final volume/eq/effects before they reach your speakers). I’ve made gunshots temporarily lower the volume of smaller in game sounds and ambience, which makes them feel louder without actually having to raise the volume of the sounds at all.
Some people on reddit were interested in a bit more of a behind the scenes peek at how I’m making some of our sounds, so here’s a little breakdown of one of the extra gunshots I did last week.
I started this one off with this gunshot sound that I found. I chose this one because I liked the little metallic cling and some of the boominess of it.
It’s a nice sound, but it’s not beefy enough, so I add a quick burst of low end to it. This was made with a synthesizer by taking white noise and filtering almost all of the high end out of it using a lowpass filter with the resonance cranked up (which essentially focuses the sound on a certain narrow band of frequencies).
This is where the whole thing is at now.
It’s sounding a bit better, but it feels like it’s still lacking some punch, so now I’m on the hunt for something to add some nice body. The nice woody tone in this stapler recording caught my ear, but it’s not sitting with the rest of the sounds quite the way I want. I played with it a bit and ended up pitching it down a bunch so it had a nice knock to it. Once it’s pitched down it also has a little bit of a clack after the main punch that contributes nicely to the echo/reverb after the initial bang of the gunshot.
Here’s where we’re at now:
Echoes and reverberation are a really important part of an awesome gun sound, so I went on the hunt for a gunshot with a nice tail on it. I chose this one.
The ringy metallic part of this sound was a little too strong, and the reverb is a bit too quiet so I applied a bit of EQ to it and added some subtle distortion to make the reverb a little crunchier (EQ first, distortion second)
That last one contributes to the general tone of the gunshot nicely too. This is where we’re at now:
It’s sounding pretty good now, but it feels like it’s lacking some snap in the higher frequencies. I wanted a nice airy burst so a nailgun seemed like a good option. I pitched the sound down and shortened it up so it would sit nicely with the rest of the gunshot.
And, again, here’s what the whole thing sounds like now. The nailgun snap is kind of hard to pick out of the whole, but you can feel that the previous version sounds a little bit weaker in comparison.
The tail still feels a little lacking to me so I took a firecracker sound, EQed the low end out, and faded it in a bit so I’d mainly get the reverberation from it.
This is placed a little bit after the initial gunshot so it acts as an echo. One thing that I’ve found really helps with gunshot sounds is to give them a bit of a one-two punch so instead of just a BANG you have more of a BA-BANG. The little bit of space helps make them feel stronger. You’ll notice that the sub bass punch I added near the beginning is delayed a little bit for this same reason.
This one is a little hard to pick out individually as well, but it adds more space and airiness to the reverb tail. We’ve got all the separate pieces of the sound in place now.
All that’s left to do is add the final layer of polish. First I compressed the sound a bit, which lowers the volume of the loudest points in the sound. This means I can turn the volume up without the max volume going up, which helps to bring out the quieter portions of the sound. I’ve also added some tube saturation (a subtle form of distortion that emulates old vacuum tubes). The saturation helps make the sound a little more full. Finally a touch of EQ at the end to add a little bit more lower-mid range (which also helps things sound a little more full and warm). I also used the EQ to make a narrow cut in the high frequencies to quiet down some of the metallic ringing that was enhanced a little too much by the compression and saturation. Here’s where we ended up!
I think it’s really cool that people are taking an interest in some of this, so I’m going to try to start recording some video while I’m working on cool shit to give you guys more peeks behind the scenes. If there’s specific sounds or other things you’re curious about feel free to ask!
Shameless plug: If you like weird uptempo bass music check out these tunes I wrote that just came out ;D
Next week I’m going to finish up the sounds I started this week and do a bit of general clean-up and fine tuning.
*Now I’ve said that, he has to make it.