1 free read left. Create a free account for unlimited reading + AI research.
Create free accounthey this is Jonas I'm one of the developers of Islanders which has procedurally generated islands and in this video I want to share everything I've learned about randomly generated levels so far I think there are a lot of advantages to using randomly generated levels they basically provide an infinite amount of content to your game so it's worth looking into from a game design perspective and the only question left to tackle is how do you do it so welcome to the ultimate guide on how you can create procedurally generated levels for your game pretty much no matter what game it is and obviously you'll get an in-depth look on how the island generator Works in Islanders as well start with handcrafted levels that has two big advantages first of all you'll see what makes for a fun level in your game and you'll have to figure that out before you start procedurally generating anything and then secondly maybe your game is just better off without procedurally generated levels and if you don't try handcrafted levels then you're kind of lacking that comparison later on between handcrafted and procedurally generated if the handcrafted levels are
way way better and a lot more fun than obviously you should go with the handcrafted levels don't automatically assume that you have to do procedurally generated levels because in some cases handcrafted levels are just way Superior that's pretty much exactly the way we started with Islanders we started with handcrafted levels first that helped us to figure out what we even wanted to create so after a bunch of prototypes and experiments this was finally the handcrafted level where we were like yes this is pretty much what we want let's try to generate islands like that as you can see here the islands in the final game pretty much live up to the same quality standards that's how we knew that procedurally generated levels would work otherwise you would have probably gone back to handcrafted next thing that matters is that you automate one thing after another try to break problems down into smaller tasks don't just uh try to make one big bam and now it speeds out entire levels no really try to break it down to into smaller um tasks let's have
a look at how we broke the problem down in Islanders here the first problem we tackled is generating a random zent plane by the way the way we do that is we just pick a random zent plane prefab and scale it around randomly step number two would be to add this mountain here it appears and as you can see just with those two steps there's already quite a bit of variety if we add the third step we get another mountain now every once in a while we get a ruin on these islands and now that the next step is to place a big detailed Mountain that's basically your main building area right there that step looks sophisticated but really it's just exactly the same it's just here a randomly placed prefab and then once we have got all of this enabled we have an entire terrain generated as you can see here breaking it down into smaller steps definitely demystifies the entire process quite a lot just for funes let's
have a look at the other steps as well we get a couple of small Islands surrounding the island we get a couple of these small rocks placed on the grass area and these are just placed by trial and aror for example these ones want to be placed on grass so they're just dropped on random positions on the island and when they land on a nice position that I want to stay on they can stay there as you can see we even can select a heat map for where we want most of the rocks to spawn once again the size and where they can can be spawned and then here we have a little bit of extra settings to push these to the edge a lot of these rocks here are placed at the edge of the island cuz usually that looks a little cooler one thing we do in Islanders is we use a lot of trial and error to place objects for example the gold patch is just dropped at random positions onto the island and if it hits the correct kind of ground for example you want to place it on Stone then it just checks
did I land on Stone and is the space uh empty that I'm occupying and if that is the case then it is placed there otherwise we just keep trying new random positions until we find a position that works same for the trees they're just randomly dropped and if they land on something they're not supposed to land on we just delete the tree and drop it in a different position and as you can see we get a randomly placed gold patch on our Island and for the stue we even have some settings to make could prefer narrow spaces kind of as a tradeoff cuz the statue gives you bonus points for a lot of things so um it's usually a bit more fun if the statue is placed in challenging positions where there's not a lot of space and the statue can find these places automatically once again simply by trial and error it's placed on a random position then it checks how much space it has around it and then it just tries a couple of positions and goes for the one with the least amount of building space and as you you can see now we get trees flowers and flower
groups once again these trees are just placed randomly sometimes in groups of three because they just look a little nicer when they're grouped together a little bit and I think also the trees are pushed to the edges a little bit because having them to spread out in the open here looks a little weird as well sometimes same goes for the flowers but apparently on this map the flowers are mostly spawned on the Rock and on the beach and then the very last step are these small Cosmetics here which includes grass clouds and waves now if we hit generate you get a bunch of cloud planes and these things we see here are waves and here we can see a couple of small grass shafts I think you can probably see what I mean here generating an entire Island like this can seem pretty overwhelming at first but if you break it down into smaller tasks like placing a couple of grass shafts or placing a couple of rocks on an island it really becomes a lot more manageable when you generate a level it's usually makes a lot of sense to go from Big to
small so for example in a dungeon if you want to procedurally generate a dungeon it makes a lot of sense to first of all generate the basic dungeon layout with where the rooms are where's the entrance where's the exit once that has been successfully generated then you go further into details and place a couple of additional walls and then you can go even smaller and place a couple of enemies a couple of items I think the the general rule of thumb for a automating your level generation is go from Big to small create the base layout first and then slowly but surely go smaller and smaller into the details next up I highly recommend you don't automate everything sometimes as I've said handcrafted is just Superior so even in an entirely randomized level it's cool to have a couple of constraints and maybe mix it with a couple of things that you crafted yourself for example in Islanders we have a couple of pre-built Islands or a
couple of pre-built Island pieces that are just used as building blocks basically in all of the islands we do not generate every single vertex of the geometry one by one no we obviously have some hand oops we obviously have some handcrafted objects in there and that makes things a lot easier we as humans can just Place objects with more intent for example the bridges and the ruins in Islanders are very very often predefined objects um because would just be too complicated to teach the level generator how to place those so we basically just place them ourselves in a way that make sense and then integrate that into the rest of the procedurally generated Island don't automate everything use constraints mix the procedurally generated stuff with the handcrafted stuff that I think makes it a lot better the next tip I have for you is an interesting one randomize the randomness if you imagine a giant field um and and every single field can either be black
or white and then we randomize that every single time yes it's random every time but it as you can see it still looks very very similar right pretty much the same thing happens when you just fill a couple of random enemies into a level but you fill the same kinds of enemies into a level every single time yes of course all of those enemies are randomized but it still feels like the same kind of noise every single time so what you need to do do to make it feel different or to make your noise look different is you need to change the enemy distributions you need to randomize the randomness so maybe in one level we have a lot of white pieces in another level we have a lot of black pieces maybe in one level all of the white pieces are on the left hand side in one and in the under level they're on the top side or whatever and if you convert that to enemy distributions in your level that's pretty much the same thing you don't want the same kinds of enemies in every single level um what you want is um maybe a little bigger
areas where there's just one kind of enemy you know just uh pure Randomness is pretty boring sometimes you need to randomize the randomness a little bit to make it more interesting we randomly pick one of these presets here these are all Island presets for example this one here creates desert islands this one here creates normal Islands this one creates islands with a mountain in the center this one creates ruin Islands here we have a separate color generator and when I hit generate color scheme you can see the island doesn't change the color scheme does and there are ton of different really cool color schemes and moods and once again obviously these colors are not R generated entirely randomly they obviously have restrictions and these restrictions are defined here in these color setups and one of these color setups is just picked randomly for example one color setup is for generating rain color schemes one color set up is for generating snow color
schemes so these are basically the presets for for generating colors and these right here are the presets for generating islands and obviously both of those things happen at the same time we get a new color scheme and we get a new island so this is how we make sure we get a lot of very different islands and Islanders by using different presets we combine with each other we basically pick a random level generator randomly and that's how we random our Randomness and make the results a lot more interesting my next tip would be to keep it simple I really want you to take something away from this video so I want to show you how to create randomly generated levels in unity but this same technique will work in other game engines as well all we need is a very very simple script it looks like this all it takes as an input is a list of Game objects it can create and this is literally the entire script as you can see here we have a list of Game objects then in this line we select a r game object to spawn from this list then we
spawn that game object and then we destroy this game object and every single one of these placeholder objects will just spawn one of these four random tiles as you can see here that's the four tiles I put into the list so every single one of these placeholder objects will destroy itself but create one of these level Parts instead so now if I hit play I get a randomly generated level very very easy just a couple of lines of code and it looks different every time now I think the cool part is that this simple script allows you to do even more for example what if we create another object then put all of these tiles in here and then what if we just create a couple of different layouts see let me duplicate that layout and then how about in layout to these buildings block building blocks here are a little further up and so are these and let's say layout 3 has a hole in the center cuz now what we can do is create an empty game object and call this spawn random layout we use our create random script here drag in our random layouts
and now one of those layouts will be spawned randomly so now sometimes we get a hole in the center sometimes we get the normal layout and now sometimes we get the stair layout so as you can see here if you're just a little bit clever about this this already opens up a ton of opportunities for example what happens if we take one of those tiles here and then spawn random objects on those tiles as well and you can go really really complex with just a very simple script like that you can just add a couple of Spawn positions here and then those spawn positions will choose randomly between health pack enemy item so if you don't know where to get started then this is a good way to go about it I guess you don't even need to do the style based there are a lot of ways this can be done just need to be a little clever about it and I literally made this within half an hour 20 minutes this is very very easy to make Islanders is out now on Steam so if you want to support this channel you can just get the game on Steam for five bucks highly appreciated once again hi to all of the
newcomers Channel's growing like crazy I don't know what to say hope you enjoyed and see you next time bye [Music]
Procedural level generation offers a scalable method for creating infinite game content, but successful implementation requires a structured, iterative approach. The primary thesis is that developers should prioritize handcrafted design during the prototyping phase to establish quality benchmarks and identify core gameplay loops before automating the generation process. By breaking complex environments into smaller, manageable tasks—moving from large-scale structural layouts to granular cosmetic details—developers can demystify the generation process and maintain consistent quality.
The methodology for generating environments, as demonstrated in the development of the game Islanders, relies heavily on trial-and-error placement algorithms. Rather than calculating every geometric vertex, the system utilizes predefined, handcrafted assets as building blocks. Objects are dropped into random positions and validated against specific constraints, such as terrain type or available space, with invalid placements discarded and retried until a suitable location is found. This hybrid approach, which mixes procedural logic with intentional, human-designed elements like ruins or bridges, ensures that the resulting levels remain functional and aesthetically cohesive.
To avoid the monotony often associated with pure randomness, developers should employ a strategy of "randomizing the randomness." This involves using presets for different environmental themes, color schemes, and enemy distributions, which are then selected randomly to create distinct variations. By layering these presets and utilizing simple scripting to spawn randomized layouts or objects, developers can create complex, diverse levels with minimal code. Ultimately, the most effective procedural systems balance automation with deliberate constraints, ensuring that the generated output adheres to the design standards established during the initial handcrafted phase.
Jonas Tyroller · 2019