Memory Leak
We discovered a memory leak last week. It was a bug in Unity, we made a repro and reported it; they confirmed and are fixing it. No time-scale though.
The memory leak was in their UI.Canvas system. If you have a canvas that is rendered exclusively by a camera, but then the camera is disabled, each frame will leak memory. We were doing this in the sign system. The camera was disabled because we rendered it manually to a texture, which was used to draw to the screen. So we decided to take the plunge and get rid of the way signs were being rendered.
Sign Painting
Signs were previously rendered by entering text which was rendered to a texture and then drawn above the sign. This worked, but we were hitting a bunch of problems with the memory leak above and Unity erroring out because it ran out of UV space with all the different sized fonts and unicode characters. One of the things we wanted to do for a long time was add painting. We couldn't justify the time spent before because of all the other shit we had to fix, but because this delivered a memory leak fix too it justified itself.
There's not much to say about how it works in the game. It works how you would expect it to:
[embed]http://files.facepunch.com/garry/2015/April/23/Desktop%2004.23.2015%20-%2011.34.41.07.mp4[/embed]
We decided to give you a limited palette rather than having a bunch of RGB sliders. You should probably enjoy this while it lasts, because our future plan is to make it so you draw with stuff from your inventory (charcoal, blood, mud, inks and dyes).
I spent extra care when implementing this system because I expect it to be used in a bunch of other places in the future.
The Rest
- Decay is scaled by how landlocked the building block is.
- Fixed some blueprints being usable in belt bar.
- Fixed solid bushes.
- Fixed not failing to connect properly when server full.
- Improved performance when shooting.
- Fixed sign skybridges.
- Window bars collider is accurate.
- Fixed building placement effects not showing.
- Ragdolls react to bullet/hit.
- Fixed building blocks sometimes not snapping together.
- Fixed it being difficult to add a floor to the top of a wall.
- Dev/Admin can hold F6 to see colliders.
- Dev/Admin can press F5 to see info on what they're looking at.
- Added giveall for admins.
- Added giveto for admins.