<img src='http://files.facepunch.com/garry/2015/March/05/2015-03-05_19-50-48.jpg'> Terrain, Sound, Reinforced and Bug Fixes5 March 2015
The first version of the procedurally generated roads had a couple of issues where they would take pretty crazy routes or cross each other in ways that didn’t really make much sense. Most of those should be fixed now, though improving the road network generation is still an ongoing process. We also added an initial version of bridges which are very much still a work in progress but really help keep landmarks connected.
With roads doing the right thing for the most part we felt experimental and added a proof of concept for rivers. On the one hand rivers are great because everyone wants them and they do a big deal to make landscapes look unique. On the other hand rivers are horrible because they come with all sorts of issues that have to be addressed with workarounds that are more or less ugly. They cause Z-fighting between the river mesh and the terrain mesh, fuck around when the terrain mesh changes LODs and make checks for whether or not something is underwater an order of magnitude more complex. Nonetheless we decided to run with it and added rivers to the procedural maps. There’s bound to be issues with this first iteration - for one you’re not getting wet when crossing rivers - but we’ll solve those as we go along.
A nice side effect of having proper rivers that flow down slopes is that they allowed us to remove a lot of the water at zero level which was previously supposed to kind of look like rivers but really didn’t. This allows for much more terrain elevation and gives us much more freedom when designing the procedural generation. One example of this is a huge increase in the number of mountain lines, simply because we have much more space available for them.
The new terrain shape also gives us a lot more freedom when texturing the terrain. Biomes now depend on both the latitude (how far north or south a position is) as well as the altitude (how high a position is), leading to much more detail and variety overall.
Further changes include a new warehouse landmark, bigger and more condensed rock clusters, improved sand dunes, nicer mountaintops, smoother texture blending and many more I’ve probably forgotten.
When we first moved to Raknet were getting occasional problems with entities being missing on the client. The server was sending them but they weren't showing up. Investigation found that the entities weren't reaching the client - but we had a lot of invalid packets.
I added a checksum to the entity networking process. Players that were missing entities got kicked. The assumption was that these were network issues, maybe people were on a shit internet connection.
But then a lot of people started getting kicked. And it was the same people. The main reason for moving to Raknet was that it's a tried and tested platform, so any bugs were going to be in my code. So I spent hours ripping my code to bits, putting it back together in a different order. No change. So maybe it's some other code overwriting the memory that contains the packets, so I disabled any other native code we had running which could be a problem. No change. So maybe it's some compiler flag in our native dll, maybe it's a raknet define, maybe we're sending too much data and raknet isn't tested for it. All no change.
After reading through lots of feedback from you guys (thanks), I spotted a pattern. It was happening when the packet was larger than the MTU (the maximum size of information that fits in a single packet), so it was only happening when the packet had to be split.
I set up a bunch of logging which confirmed it. Some packets were split and put back together again, and the one that errored out was put back together but we'd received the last peice first. But surely raknet would handle that right? Surely it would put shit back together in the right order?
Nope. We've had no more issues with the dev servers since I applied a fix to this, but I'll be keeping my eyes open.
We’ve tweaked volume levels and finished moving everything over to the new sound system, which gives us a lot more control over how things are played back.
We’ve started working on filtering sounds as they move farther away from the camera so that distant gunshots and explosions actually sound different.
Moving underwater will also play splashing sounds and muffle the rest of the audio now.
As a side effect of all the debugging of the network stuff I did we have now got a bunch of network stat commands. And the bandwidth usage shows on the dedicated server again (and is more accurate now), and player pings show when using the status command.
net.log [0|1] - log all network traffic to a csv file
dev.netgraph [0|1] - overlay network stats on client
There was a network issue where if you were kicked from a server you weren't actually removed. This meant you couldn't rejoin the server because it thought you were already on there.. and the player count didn't go down.
I dropped the ball. If you thought the last version was laggy it was probably because of this. I wasn't converting ping from seconds to milliseconds when working out the lerp. Luckily it was clamped, but you would have noticed that player movements were lagging about half a second behind where they really were (instead of pingtime). Thanks to bilford for pointing this out.
It should be more obvious when you're being attacked by a wolf now because it'll show the damage indicators on the screen indicating the direction.
Dying is still something that sucks right now. Flashing to the "you're dead" screen isn't ideal, hopefully that'll be made better next week.
Vince has finished off the reinforced building grade. The idea here is that the reinforced grade is the top tier, and combines the properties of wood, stone and metal.
We want to get into a position where wood, stone and metal aren't chosen linearly, but they're chosen for their specific properties, but choosing reinforced brings the best of all those properties. It's going to take some time to jiggle that plan out, but that's what we're heading for.
There's a cheat that patches the Windows kernel to bypass EAC. EAC are aware of it, and it'll be blocked/banned next week. So if you were stupid enough to severely compromise the security of your computer to cheat in a game, you've been warned.
The gamma exploit is a long standing problem, and not one that is really easily fixed. We're testing something out that makes it a lot more useless. When something gets really dark now we just cut the colour off and draw it black. We lose a bit of image fidelity here, but it means that everyone is on the same level - and you don't have to feel to play the game all washed out just because everyone else is.
People were going to sleep to look through walls in third person. I changed it so when you're asleep now you're looking through the player's eyes. This involved added a new camera mode, an in the eye mode (which is gonna be used when you die etc too). Admins can switch to in the eye mode using F3, it's pretty fun and has made us want to put it in the game properly.. but if that happens it's going to be months away.
Because of the big terrain changes this update requires a wipe. I'm guessing about half of you love wipes, and about half of you hate them. It's something that is required quite regularly at this stage of development but we're trying to keep it to an absolute minimum.
Only the map needs to wipe - you will keep your blueprints.
- Toned down screen overlays
- Fixed radpills not working
- Window bar upgrades
- Fixed campfire slot count
- Admin noclip (rightshift and L)
- Tweaked loot spawn, weapon damages & other balances
Programming kicked my ass this week. Almost all my time was spent on that network bug, or worrying about it - even typing this now is making my brain itch thinking that it might possibly still exist. Thankfully Team Rust has stepped up and made this post a less boring than it otherwise would be.
Hopefully we're all good to go and next week will be business as usual. Andre killed it this week with the terrain stuff, the world is looking a lot fuller, we're getting the rock maze effects from legacy. So we're making good progress.
Anyway - next week. So next week I have a list of stuff I want to work on. Priority is stats for building damage. Everything needs to be tweaked and balanced. Rendering the buildings is getting slow too, so I'm going to look at batching there. Generally though performance is pretty good. Especially servers - although I'm still seeing memory leaks in the old version, hopefully this update will make things better. Really, the server is performing better awesome, it wasn't that long ago that we were struggling to get over 30 fps after being up for 2 days, now we're seeing 200+fps. So lets hope it stays like that.
If you want to follow this project you can sign up to the mailing list.
We'll only update you about this project, we won't spam you about other stuff or sell your email address.