First of all, I’ve integrated some of my recent work on Scraps into the builder demo release, which as always is available here. In this release:
2014-04 – 0.2.10.0
– Weapon tracers are now a post-render effect. Improves visibility at distance, and faster to process
– Added camera shake effects
– Added more terrain dirt FX
– Removed skidmarks effect
– Some graphics tweaks
– Added a screenshot key (F2 by default).
– Price is now in scrap (S) instead of dollars ($)
– Further performance improvements for loading complex vehicles, and picking up or removing lots of parts at once
– Vehicle price previews in save/load/select dialogs
– Fixed view clipping through some objects. General improvements to looking around in-game
– Part tooltips now show mass in the selected way (kg or lb), instead of always kg
– Added workaround for a bug which caused weapon hit effects to sometimes appear in the wrong place (related Unity bug: http://bit.ly/1ekF3EQ)
– Minor engine sound fixes
The skidmarks code was always bad (complex and performance-intensive) and it also didn’t port well to the way I’m doing FX now: Vehicles used to create their own terrain FX, but now the terrain creates FX for any objects on it (see last fortnight’s post). Skid sounds and smoke remain.
The skidmarks code was also probably the only thing in Scraps that I didn’t really write myself – It was modified code originally from the Unity Car Tutorial (Unity’s tutorial code is free to reuse), and they’d used an… interesting method of drawing the skidmarks. Their method was clever, but it basically created a 3D mesh out of all the skidmarks in the scene every frame and then threw it out and did it again the next frame. Those thrown-out meshes would then get disposed of by the C# garbage collecter, using up a whole bunch of frame time a couple of times every second.
So that’s been thrown out, but some other new dirt FX are in. The new camera shake effect (also mentioned last time) is pretty nice and IMO adds a much better feeling of force to vehicles with big arrays of weapons. It does have limits on it, so it’ll never shake the screen to the extent that it becomes unplayable.
I’m not adding anything super exciting (like new parts) right now because I’m focusing on getting the actual game working well first: I like the freedom of being the sole developer on Scraps but I do have to prioritise carefully. So, I apologise that these playable updates aren’t super interesting and probably won’t be for a while.
Behind the scenes, things are a bit more interesting. I’ve been working largely on the multiplayer lobby for the past couple of weeks. In the lobby the host can choose a map, select the scrap cost limit etc, and players can choose a vehicle, chat, and indicate they’re ready. The basic networking setup is working and it’s possible to start games, connect to them etc, but the whole lobby area still needs some work before we can finally make it right into an actual game.
The multiplayer prototype I have is sort of the opposite of that – it’s like a stripped-down version of Scraps that’s pretty much only the in-game stuff. I’ve also been tweaking some of the networking system there, but that still all needs to be ported into the main game. In the prototype, everyone drives a set type of vehicle, which is much simpler than the main game where people’s vehicle choices need to be passed around, verified by the server, shown correctly on everyone’s computers etc.
The server needs to load up vehicles it receives to verify that they’re within the cost requirements and haven’t been messed with somehow (they shouldn’t have unknown parts, floating parts, or parts overlapping). It can skip the visual stuff, but it still shares most of the loading code with build-screen vehicle loading, so that’s spurred the further reduction in loading times that you’ll see with big vehicles in the latest builder update.
There are three options for a multiplayer game of Scraps:
Join: Find a game and join it via LAN or Internet.
Dedicated Server: Scraps has a server application that can be run separately to the main game, so that a PC can host a game without someone playing. It has an optional GUI that shows settings and status messages, but can also be run in no-GUI mode where it’s all in the background.
Host: From Scraps, you can host a LAN or Internet game. Hosting actually starts a local no-GUI server in the background and connects you to it, but the process happens invisibly. You’ll be dropped into a game lobby where you can then choose the details of the game. This is similar to the Dedicated Server option except that the server PC also has a player, and that player has some extra privileges (namely, they can change game settings).
The intention is for Scraps to have a Master Server online, so that anyone can create an Internet game and register it with the Master Server for other players to find. People looking for a game to join can then search for games and find people’s servers. Of course you can also play locally on a LAN.