Super secret new content preview #6/10: Less of a preview, more of a discussion
For the first couple of days this week I was working on something that I then decided against. I've got other work done but it's not really ready to show, it's mostly just code that doesn't visibly do anything yet. So let's talk about the other thing I was working on because I'm interested in what people think as well. I do apologise that this isn't much of an interesting "preview."
Part Wreckage
Ever since I started working on the scrap wreckage system for Scraps, I intended there to be two types of drops. When you destroyed parts, you'd be able to collect general wreckage that was like cash you could spend on parts during a game, after using an Evac Pad. That part's in the game now. But there was also meant to be a chance that a whole part would drop when you destroyed one on an enemy. They'd have some amount of damage already applied like say 0-50%.
This got left out initially just so I could get the game out a bit sooner, but I wanted it for the new game mode. Some code was there, and I started adding the rest to get it all working. I got as far as having the part wreckage spawn, but not as far as making the interface for you to spend it, before I changed my mind.
My original idea was that if you picked up a part, it'd now be a free part to use on the Build screen (if you used an Evac Pad - if you died you'd lose it like with wreckage scrap). And so you could end up with a conglomerative scrap creation built of all sorts of scavenged parts, and I figured that'd be cool. But I weighed up the pros and cons again as I was restarting work on it, and I came up with:
Pros: [LIST]
<*>Interstate '76 did it and it was cool. At the end of each mission you'd get salvage parts you could use to slowly upgrade your car. They'd have damage to repair as well. And it was fun.
<*>It'd make enemy drops basically like a loot system in an RPG, which is a time-tested effective system. General scrap drops are like coins and part drops are like gear/items.
<*>It'd encourage interesting builds and often it is limitations that end up inspiring real creativity. Plus it'd provide more variation to the game in general. Work with what you've got, try new things, and building ridiculous vehicles out of a bunch of scavenged parts is well within the Scraps philosophy.
[/LIST]
Cons: [LIST]
<*>Interstate '76 is a different game to Scraps, and while it worked well there, you couldn't buy parts at all – it was all salvage. So the parallel doesn't quite apply.
<*>It could prevent interesting designs as much as it might encourage them, forcing people to use certain parts rather than follow their ideas. I've seen that Robocraft (a game with a similar concept to Scraps) recently switched from a money system to a loot drop system, and everyone hates it, because they can't build what they want. Part drops would similarly stop people from building what they want.
[/LIST]
Ultimately I'm thinking it's actually a better idea to leave things as-is. If I did do it, I'd certainly make it optional in melee mode (the current game mode). If I really want some special weapon to drop from some special vehicle, it could instead drop a "token" that simply unlocks that special part as available to build normally (i.e. buy it with scrap).
Edit: Someone reminded me about selling parts. Selling parts is another complication. If you put a part on your vehicle and then delete it, you get its current value back. But if you can sell salvaged parts for full value then the feature is almost pointless! - the only benefit vs. just getting scrap directly would be that you can't buy damaged parts so maybe you could use something that you couldn't afford new. If you can't sell scavenged parts for their full value, that's gonna be confusing if you're removing things from the vehicle to get scrap back. Not to mention complicating the code. I think this feature was a dumb idea from the start.
Super secret new content preview #5/10
A small taste of things to come.
https://youtu.be/gBy166Hnu5Y
Super Secret New Content Preview #4/10
Scraps vehicles so far always ostensibly have a human driver in a cockpit. Even if they're actually controlled by the AI, there's a cockpit that a person can fit in.
I wanted some mini vehicles as a sort of starter enemy, more like a ground-based fancier version of the drones I showed earlier. Easy enough to code because they're still vehicles, but different. Instead of a human driver in a cockpit they have a Brain CPU.
It's still a key component of the vehicle so the vehicle is lost if it's destroyed, like with the standard cockpits.
I made it a micro chassis to use, that'd be too small for a normal cockpit.
To be clear, the CPU cockpit and micro chassis aren't player usable, at least not with my current plans. They're just for fighting against. Look how cute it is though.
I'm going to be away on family business for a few days next week (actually I'm already away now!) so I'm not sure if Super Secret New Content Preview #5 will make it on on schedule next weekend. But I'm hoping I'll get enough work time in that it will.
Super secret new content preview #3/10
This week I made a flying drone enemy type.
They track you, zip around the place, and are fun to shoot.
Initial tests were interesting, almost boids-like:
I found that for the drones I could use a surprising amount of the same code I used for the turrets which was nice. Apart from the actual flying code, a drone is pretty much a turret that moves. And similarly to the turrets I showed last week, they're made of functional parts just like vehicles. Here's a group of them where the one on the right has lost its heat sink and is starting to overheat, and another gets it heat sink shot off:
(sorry for the huge gif! Webm support will get better one day...)
I gave the drones some basic AI. I won't claim it's anywhere near as interesting as Dave's vehicle AI but it doesn't need to be in this case. They don't "fake" their flying though, they thrust around with real physics, so of course you can shoot or crash into them to throw them off. Hitting stuff way up in the air is tricky and not really good fun, so I've designed them to hover along close to the ground.
You can see the physics at work in this scenario when I first gave them weapons...
Yeah so, standard recoil is a bit much for them. Hence I must confess they are cheating a little now: It was either spend ages writing some smart AI that'd attempt to counter weapon recoil while flying somehow, or just let them have less recoil on their guns. I hate it when AI gets to cheat (vehicle AI never cheats by the way, it only sees what it can actually see and collects only scrap that it really collects) but the pragmatic choice here was obvious. So the drones you see elsewhere in this post are using specially engineered reduced-recoil MMGs.
See you next week.
Edit: I just decided to see if I could 👍 my own post and apparently I can... but I can't un-rate it again. Great.
Super secret new content preview #2/10
I made some stationary gun turrets to use for the currently-in-development new game mode.
I've also written some simple AI for them.
Note that generator and those heat-sinks: They also have inter-dependent functional parts like vehicles. Here's a demo video of everything where I explain what's going on:
https://www.youtube.com/watch?v=vWePrtx9OzE
Super secret new content preview #1/10
Searching for a crash
Not the vehicle kind unfortunately.
Every now and then recently I've been getting automated error reports of a stack overflow exception in Scraps. But no-one's actually reported a problem to me directly, everything seems to be working perfectly for me (and clearly most others), and the error report doesn't come with any additional information.
So just putting out a general plea, if your game crashes or does anything weird, please do let me know and send me your output_log as described on the website Contact page.
Scraps v0.5.4.2
I just wanted to do a small fix-up update today to tidy some things up:
2016-3 - 0.5.4.2 - Some performance improvements, mainly on CPU (the previous terrain graphics upgrade made CPU performance worse)
- Added some grungy texture to scene objects in general
- No more lag spike (one-frame FPS drop) the first time wreckage spawns
- Added a little help dialog thing when first playing a game to point out adding AI players
- Added hover tooltips to the server list that show the full game name, in case it doesn't fit
Bug Fixes:
- Got rid of grass growing through evac pads on the test map
- Missing button click sounds added to lobby screen
- Fixed AI info in the server list going away after 30 mins when the lobby refreshed
By the way, I'm also aware that running the game in DirectX 9 mode (if you don't have a DirectX 11 compatible graphics card) at the moment causes some issues with how the terrain looks. I'm looking into it.
Scraps v0.5.4.1
- Main Menu layout changes
- AI players now show in the server info
- If an AI player gets kicked from a game by a human player joining with no free slots, when a slot is free again they'll now come back... for revenge
Bug Fixes:
- Fixed rotation range calc bug
- Fixed "aim sphere" rotation range visual bug
- Fixed null reference exception that occurred on dedicated servers in no-GUI mode with the new terrain
- Fixed music player playing the wrong track if the track was changed and then changed back to the original track while the original track was still fading out
Playing single-player:
Old: Singleplayer
New: Play->Start A Game, have "Allow other players to join" unticked.
Joining an Internet game:
Old: Multiplayer->Internet->Join A Game
New: Play->Join A Game
Joining a LAN game:
Old: Multiplayer->LAN->Join A Game
New: Play->Join A Game, select the LAN tab
Hosting an Internet game:
Old: Multiplayer->Internet->Host A Game
New: Play->Start A Game, have "Allow other players to join" ticked, and set to Internet
Joining a LAN game:
Old: Multiplayer->LAN->Host A Game
New: Play->Start A Game, have "Allow other players to join" ticked, and set to LAN
"Allow other players to join" is ticked by default, but it remembers what you last set, so if you always play Singleplayer for instance it'll stay unticked once you've set it that way.
Scraps v0.5.4.0
The latest Scraps update adds a little air control, a save format upgrade, tweaked weapon hit forces, and a terrain graphics upgrade.
Full changelog:
2016-3 - 0.5.4.0 - Terrain graphics upgrade. But no more switching to greyscale terrain when in low grav mode I'm afraid
- Magically, vehicle save files are now also PNG image screenshots of the vehicle itself
- Separated weapon recoil and hit force, so they don't have to be the same anymore. Reduced hit forces in general - should help with Medium Cannon spam in particular
- Rewrote the weapon movement range calculation AGAIN. More bugs fixed with it. Hopefully very correct and consistent now
- Added a little air control: Pitch = Throttle forward/back. Roll = Throttle + Steering. More engine power gives more control
- Finally the test map side road is actually 100% flat, right up to the ramp
- Updated uLink and Steamworks.NET to their latest versions
- Added grass density graphics option
Bug Fixes:
- Tooltips now update their text to match language changes without requiring a restart
- Fixed mass from held wreckage not being subtracted after wreckage was offloaded on evac
- Stopped evac pad ambient sound from playing when the pad is turned off (Test map)
Air control
I showed this off in the last update, but now it's live. You can control your pitch with throttle and your roll with turning. You can't control yaw - it's a car, not a plane OK? Practising in Low Gravity mode is a nice way to get the hang of it.
Recoil
Weapon recoil and hit forces used to always be the same, which was arguably more realistic, but it meant that if I wanted a big kick on a weapon it also had to have a big hit. Often because of hit angles and multiple shots hitting in one spot, the hits would end up even worse than the recoil.
I've changed it so that I can set them separately, and reduced some hit forces. Hopefully there's less of a problem with Medium Cannons and Plasma in particular throwing vehicles around now. Of course you can still push your enemies around to some extent.
Save Format
Those are actual save files. When you save vehicles now they'll end up in a new format, which is also a png image - so now it's easier to see what a vehicle is if you're sharing it around.
The easiest way to see your vehicle saves is probably to open the Save/Load dialog in the game and click the button at the top right which takes you straight there.
Hosting these on an image host will most likely break them - you can try, but you're probably better off using a file host of some sort. Anything that won't try to modify or re-encode the image file.
Dev note: There are several ways to do something like this. Gimbal has awesome image saves, as does the Spore creature creator. One potential method is to use the image's metadata fields to add your custom data, although sometimes those have size limits. Another method is to use something in the image itself that's invisible or hard to see, like something in the alpha channel or the least significant bits. Or even just extend the image to have the data encoded in an extra part of it, using all the available colour data.
However, I've done this with the dumbest and simplest method possible: Just dumping all the save data at the end of the file! It was one of the options I've read about so it's not totally unheard of. Sure image hosts will probably break it but all those other methods get broken by image hosts anyway. Seems like as long as you still end the png part of the file properly (works for JPEG too!), every PNG reader that I've come across reads the files with no problem. Scraps just ignores the image part and looks for my special marker, then starts reading the save from there.
Graphics
Scraps' terrain graphics have always been pretty meh, and I wanted to get a better system for new stuff, so I've also back-ported that to the existing maps.
What's actually better? Well, there's nice perlin shadowing on things (how much there is varies with the terrain texture):
Although I had to get rid of the black outline FX on terrain.
Bumpy stuff is... bumpier:
And you can see there that the grass is better too, not just denser. The default Unity grass shader is a simple cutout thing: It takes a texture and says OK, if the alpha value is above whatever, I'll show that pixel, otherwise I won't show it. That gives really crisp but jagged looking grass. It also means that when the terrain engine tries to fade out distant grass, instead of getting semi-transparent grass you get grass that sort of gets cut down more and more at the edges.
I did a literally one-minute edit to the grass shader to make it do "proper" transparency, and the difference is huge!
I don't think Unity has updated their grass shader for a long time. There's a comment about Mac OS 10.4 in there. I was sure I must've killed performance as a tradeoff, but if anything the grass performance seems to be slightly better. Here's my replacement WavingGrass.shader and WavingGrassBillboard.shader if any Unity devs want them, it's like jumping from 2002 to 2012 in one fell swoop.
There's also now texture blending based on heightmaps:
What's happening above is, when there's a mixture of two different terrain textures, it used to just blend, but now it'll show the higher parts of the texture first (based on a greyscale height map I supply it), so the new texture sort if "raises up" out of the other one as it increases in opacity. For Unity devs, most of these new features come from using Tomasz Stobierski's Relief Terrain Pack (it's not exactly drop-in-and-your-terrain-looks-amazing, but it is very good once you bend it to your will).
I also wrote some custom terrain editing tools of my own to let me make stuff faster:
The heightmaps and splatmaps (texture layout) used there are pre-created - my tools aren't that amazing - but it automates a whole bunch of stuff that was previously tedious. It also means I can edit heightmaps and splats and basically just click to update. Without much more work a terrain like the one above starts looking pretty good: