So what has been happening with Scraps in the last two weeks? Let’s find out…
One thing I did was switch the whole terrain effects system around because previously, each vehicle would check through each of its wheels and see if it was touching the ground, and if it was, it’d generate the appropriate effects for the terrain underneath (like grass particles, dust clouds etc).
I realised that a smarter way to do that would be, instead of having every object check whether it’s on the terrain and create effects, to remove all that stuff and have the terrain notice when objects were on it and create effects for them.
There’s one negative, and it’s that only the base terrain can create collision effects, whereas previously any object that a vehicle was on could generate appropriate effects. But most (currently all) non-terrain surfaces are metal or wood or something else that shouldn’t produce dust or dirt anyway, so it’s not a big deal. I can always allow objects in the world to have their own FX scripts if they want colliding objects to produce sparks or whatever.
The positive part is that instead of every object that touches the terrain needing to generate its own effects, now all vehicles (and indeed any object) touching the terrain will throw up dust or dirt or whatever as appropriate, based on how fast it’s going and how hard it’s hitting. Special cases can still be made: E.g. When wheels collide they can throw up more dirt if they’re spinning.
I made a dumb video that shows this off, and also shows something else new: Camera shake.
In the video I’ve just dropped in a bunch of default Unity-engine spheres there with no extra scripting on them, but you can see that when they roll along the terrain, dust comes out behind them.
Some weapons shake the camera a little when they fire. Lots of weapons shake the camera a lot. But don’t worry; it doesn’t scale linearly! The amount of shake added when the camera is already shaking scales down, so a vehicle with a hundred guns isn’t unusable, and the vehicle is the video is about as much shake as you can ever possibly get. It just adds a nice feeling of weight to cannons and so on.
About half of the last fortnight was spent adding and changing code around to support multiplayer lobby stuff. For instance, when selecting your vehicle you now get a preview of the scrap cost, so you can see what will fit within the current game’s selected limit. Example:
That’s the vehicle select screen that players can access from the game lobby. All the “Unknown”s are from old save files that don’t have the new price data stored – they’ll start showing prices once they’re saved again. A couple of things related to this:
- To allow the price preview without having to look through all the parts in every vehicle you’ve saved, vehicle save files now store the cost of the vehicle. However, when a vehicle is actually selected the price is re-calculated based on the actual parts on the vehicle, so don’t bother thinking about hacking your save file to make all your vehicles cost nothing!
- On top of that, the price list is calculated in a separate CPU thread, so any delay in loading the prices doesn’t delay the screen showing up or stop you from loading something. I’m trying to allow for a situation where someone has hundreds of vehicles saved.
On top of that, lots of small fixes and tweaks as usual. Work continues.