Super secret new content preview #7/10: "Procedural and hand-crafted"
This update is going to end up giving away a bit about the new game mode but that's OK, I'll explain everything at preview #10 and that's not too far off anyway.
So, in the new game mode I wanted levels that are a bit different every time. Each one short but always something new. The standard solution to that is to use procedural generation, and have the code create something that's different every time. But procedural can also mean bland, generating the same things with the same rules in different places, and for every game where it works well there's one where it doesn't.
I'm taking a sort of a hybrid approach here which with some luck will almost give you the best of both worlds. Here's a complete map for one "world":
That's big - it's over 7km long. But when a level generates it just takes a small chunk of that complete terrain, starting anywhere along it, and putting travel in a forward or reverse direction. I'm still tuning the exact length that'll be, but it's in the region of 1.5 or two kilometres.
Then within that area, things get more complicated.
Throughout the whole level the road is your guide.
Spawn on the road, leave on the road.
Within the level I can hand-place scenery, walls, turrets, enemy vehicles etc. A lot more stuff than the level will actually need. Then I tell the level generator OK, spawn some stuff in the level for a total of about x amount of scrap, and about 60% of it (or whatever) should be in stuff that attacks you, and the rest should be harmless (like crates). It then looks at all the groups of things and probabilities within the selected section of the map and decides what to spawn.
I've set it up so I can pack the entire contents of the level up so instead of having a bajillion things spawned in the world and then deleting most of them (which would waste a bunch of time and RAM), everything in the level is stored only as information about that thing, and then only what's selected is spawned. Everything can be unpacked (basically, spawn everything) so I can edit it, and then packed again for in-game use. In Unity engine terms it basically stores the prefab used, the position and rotation, and then any other custom information that particular thing needs to configure it.
But the key feature is that I've also set it up so I can create everything in groups with custom spawn probabilities. Here's an example of one group of things that could be selected to spawn:
This whole thing - the roadblocks, the turret, and the two crates - has a "normal" chance of spawning so it has about as much chance as anything else to be selected. If it's too close to something else that's already selected, or its scrap values don't work out with what the level needs, then it probably won't be chosen.
But within the group itself, it can choose different subsets of things to spawn as well. This subset will be chosen as soon as the level generator looks at it, so that it can know exactly what scrap value it'll have.
The roadblocks in the middle are set to always spawn the concrete barriers OR the wooden walls, but but never both. So it'll never actually look like the above in-game.
Neither the crates nor the turret are guaranteed to spawn at all, even if the group is chosen - you could get just the roadblocks. But somewhere between zero and all three will be chosen, with one of the crates in this case being a rarer spawn than the other. I could also set it to only spawn one thing out of three, or 1-3, or 0-2 or whatever. And the spawners can be nested so one of the choices could be another spawner with its own mix of guaranteed things and sub-choices.
But even as it is there are 16 possible combinations of just that one small set.
For AI vehicle spawns, I can now define patrol paths so they can patrol around, or just sit and wait.
Right now most of the code for level generation is done, as is most of the stuff to put in the levels, but I still have a lot of work to do in actually populating levels and in the actual framework of the new game mode. Sometimes it feels like things are progressing at a decent speed, sometimes it doesn't, but rest assured that I'm working on it.
See you next weekend.
Scraps: Modular Vehicle Combat
Moment Studio
Moment Studio
2020-12-18
Action Indie Singleplayer Multiplayer
Game News Posts 61
🎹🖱️Keyboard + Mouse
🕹️ Partial Controller Support
Mostly Positive
(156 reviews)
http://www.scrapsgame.com
https://store.steampowered.com/app/350150 
The Game includes VR Support
Scraps Linux [960.68 M]
Scraps lets you create a vehicle that’s great or a vehicle that sucks. Maybe your vehicle falls over when it corners or doesn't have enough power to fire its weapons – that’s okay. Maybe it doesn't need an engine because it moves by firing its cannons backwards. You decide what you drive.
Your design choices aren't just cosmetic - they're truly functional and at the very least affect the weight and balance of your vehicle. Battle in single-player against the AI, on LAN, or over the Internet. Easily host your own LAN or Internet games. Using the Scraps demo version, your friends can join a LAN game even if they don't own the full game.
language Note:
The only complete language at this time is English, but partial in-game translations are selectable for Russian, Danish, Dutch, Norwegian, Romanian, French, and Swedish.- OS: Tested on UbuntuGraphics: Radeon HD 6570 / Mobility Radeon HD 5850. Shader model 3.0.Network: Broadband Internet connectionStorage: 1 GB available spaceAdditional Notes: Broadband is only required for Internet play.
- Graphics: Radeon HD 6570 / Mobility Radeon HD 5850. Shader model 3.0.Network: Broadband Internet connection
- Storage: 1 GB available spaceAdditional Notes: Broadband is only required for Internet play.
- OS: Tested on UbuntuGraphics: Radeon HD 5750 / Radeon HD 6750MNetwork: Broadband Internet connectionStorage: 1 GB available spaceAdditional Notes: Broadband is only required for Internet play.
- Graphics: Radeon HD 5750 / Radeon HD 6750MNetwork: Broadband Internet connection
- Storage: 1 GB available spaceAdditional Notes: Broadband is only required for Internet play.
[ 5951 ]
[ 1903 ]