I dont understand what am I doing wrong but if I apply this rule (wall if 5+ neighboors are walls, floor otherwise) and I start with roughly 50/50 or 60/40 initial distribution, after the very first iteration I'm left with huge floor-only map with very few walls around the edges. I've tried adding additional rule if zero neighbors are walls, become a wall, that I saw in some tutorial, in which case I end up with a map virtually undistinguishable from an initial random generation, maybe walls/floors distributed a bit more evenly but that's it. I really dont get it how you end up with such nice organic looking maps.
@user-og6hl6lv7pАй бұрын
Thanks for the tutorial. I spent the weekend implementing this into my own project and managed to get it working. However it wasn't so simple just drawing the height map points. The height map points must be normalized for the height map to be coloured correctly, otherwise it ends up looking like bismuth. For anyone who is curious, you need to grab the min and max values of the height map points (v_max and v_min), which can be calculated in during the diamond step loop. Before you pass the height map points to the renderer, each height map value must be normalized: float v_range = v_max - v_min ... float value = (height_map[x][y] - v_min) / v_range
@stevedoetschАй бұрын
Lacularity is the change in frequency between each octave (layer), and persistence (gain) is the change in amplitude between each octave. If you understand that one sentence, you understand how the whole system works.
@stevedoetschАй бұрын
Perlin also invented perlin noise, which he did not copyright, so then he invented simplex noise and copyrighted it, but of course it was too late and most everybody just uses perlin noise now. 😅 So, yes, simplex noise is better, but you have to pay a license fee for it, and the benefit is negligible for most people's uses.
@Dragon20C3 ай бұрын
I didnt understand why you had "count" in the diamond function, looking at your github in the description made it easier to understand, it was used to make sure its inside the controlled grid
@wynniechan33663 ай бұрын
Trying to interpret this and convert what I understand to GML, as I'm working in Gamemaker... I'm having lots of trouble because I feel like some variables are left out. Start and end are used lots in the for loops, but I have no understanding of what those mean, could you offer some insight?
@tortenschachtel94984 ай бұрын
By changing the Lacunarity you _are_ basically zooming in and out every octave except for the first one, since this directly affects the frequency of those octaves. One might say you are zooming in or out on the detail layers.
@turkeyphant4 ай бұрын
3:44 makes no sense. where are these diamonds?!
@le_plankton4 ай бұрын
I love this video
@darkgecko55815 ай бұрын
Loved this video because it was just concept and not a walkthrough of any particular game engine or code. I've been working through a lot of Unity tutorials but my brain needed something meta level to see how the nuts and bolts actually work. Thank you kindly
@WhiteBoxDev5 ай бұрын
@@darkgecko5581 Glad you found it helpful. 🙂
@lln61235 ай бұрын
A very big thank you, I was able to rebuild it in my own little 2D engine and saving it as bmp. Next will be something like using Fragment-Shader instead saving and loading the image all the time...
@DobinSergei6 ай бұрын
It would be nice to add one rule to algorythm. Before all make a mask of bytes, with sizes of map. Using on it a diamond sqare algorythm, with height range = 0..1, we get natural looking areas. Now, we do default diamond square generation of map. But we using not constant rougness, instead we control it with our premade mask. It makes more interesting heights variation. With smaller regions more rough heights variation, and with more steep and smooth plains and hills overall.
@NikoKun6 ай бұрын
Neato. The maps this generates remind me a little of the level design from the old Sega Genesis game Sub Terrania.
@theHiddenStone7 ай бұрын
Reminds me a lot of the old C64 game Ancipital by Jeff Minter. This is a good thing.
@romeo90159 ай бұрын
You are my FAVORITE KZbinr rn. I’ve been playing pygame recently and your videos have been instrumental for visualizations.
@andisarifi580510 ай бұрын
great video!
@sushismitcher22510 ай бұрын
It's really cool, but I'm having performance issues. I'm probably going to create a chunk system so that the tiles only have to check nearby tiles, but I'd love to learn about other optimisation methods. Great video!!
@Dent4210 ай бұрын
6:17 I thought the point of fractal noise was that it looked "similar", independent of the zoom-level? Is this not the same as 1/f (a.k.a. "pink") noise? (Very informative video, btw!)
@marcuthdev11 ай бұрын
14:00 como você fez aquele ruído ficar assim? Estou há alguns dias tentando fazer algo parecido em TypeScript, mas sem sucesso. É para gerar cavernas em um jogo como Minecraft 2D
@lastvirtualdomain11 ай бұрын
im doing something wrong, the edges are great... but at large scales.. it looks mostly square.
@umtbmt239511 ай бұрын
Thank you for your tutorial, but i don't quite get it what's the difference between step and iteration?
@WhiteBoxDev11 ай бұрын
I use the two terms interchangeably.
@llpBR11 ай бұрын
I was looking for a different algorithm to make my maps. I've created one from my mind and necer thought it was a cellular automata also. This one is way simpler and effective. I'll try and it!
@monkey7218 Жыл бұрын
Hi! Great video :D I know this is quite an old video by now but, do you know why you get quite "jagged" walls a lot of the time? Any clues on how to fix that?
@sdbadik9 ай бұрын
For every wall cell, try to apply this: If the wall has 0 neighbors to the left or right, destroy it. If the wall has 0 neighbors to up or down, destroy it as well.
@hatac Жыл бұрын
What happens if the four corner values are the same? I presume you get a flat sea bed, 'swamp', plains or plateau. This gives a uniform sea level. How would you get a highland lake or pond? I presume that would require another algorithm with added passes.
@LKamodon Жыл бұрын
Great video! At 8:55 it was a bit confusing seeing the whole grid being re-generated from scratch as you narrated "you will notice as the iterations increases", maybe you could have increased the iteration counter by pressing 6 multiple times instead. I don't mean to be rude, just trying to provide a bit of constructive feedback. Thank you for making the video.
@WhiteBoxDev Жыл бұрын
Thanks for the feedback! Since the demos are not scripted like the rest of the video, my error-ridden brain takes over and thus we see some explanation quirks.
@svenskazengrodan Жыл бұрын
I really appreciated all your map generation videos. Very pedagogical.
@daka.notatp Жыл бұрын
i followed the tutorial... and it works! but my maps are mirrored diagonaly, from upper left to bottom right, anyone knows why?
@Sketchaphone Жыл бұрын
Thanks for demoing all these different techniques. It's really useful to compare the difference in terrain generation methods for my use cases
@WhiteBoxDev Жыл бұрын
No problem, they were fun to make.
@Sketchaphone Жыл бұрын
what a simple yet effective tweak to generate landmasses. I was looking for different techniques for generating terrain and I'm delighted to see that a modified floodfill does the trick
@sergodobro2569 Жыл бұрын
Respect to pseudocode!
@PolarTop6260 Жыл бұрын
bro this channel is so underated, this channel teaches you procedural generation methods you might of never heard of, that are simple to understand and looks very good, and also teaches you how to implement them
@hamsterbyte Жыл бұрын
Very interesting algo. I'm curious though, did you try any aside from exponential decay? Perhaps logarithmic, linear, or quadratic? I'm not suggesting there is anything wrong with this implementation as it is really quite clever, I'm really more interested in how the decay would fall off if it were implemented with another algo. Gonna throw you a sub for getting me thinking. Great job.
@NathoSteveo Жыл бұрын
Awesome video mate thanks
@GbyP Жыл бұрын
I really needed this so I can finally understand my CS projects for class
@francescocarbone8466 Жыл бұрын
Best work.
@felipecruz9567 Жыл бұрын
nice explanation
@WhiteBoxDev Жыл бұрын
After reaching the 2nd square step at 4:45, I make a handful of manual arithmetic mistakes. I'm sorry about this! Thank you to the people who did the math and commented. My solutions of <6, 7, 7, 5> should actually be <4, 5, 5, 3>. Similar situation with the 2nd diamond step at 5:34. Please follow the algorithm as explained and your answers will be correct. Disappointing mistake.
@jamesmunroe6558 Жыл бұрын
You lost me at 5:23. "The math for calculating each of these values is the exact same as before." Only with our new squares, we have the average of the corner values for x as (2+4+6+5)/4 = 17/4 + R, for y as (4+8+5+4)/4 = 21/4 + R, for z as (6+5+5+4)/4 = 20/4 = 5 + R, and for w as (5+4+4+1)/4 = 14/4 = 7/2 + R. Am I missing something?
@WhiteBoxDev Жыл бұрын
Yes, you are correct, I made some arithmetic mistakes while doing the calculations manually. I'll post a standalone comment about this. Thank you.
@jamesmunroe6558 Жыл бұрын
@@WhiteBoxDev OK thanks, I'm glad I wasn't off the beam - I was worried I'd messed up. I'll stay tuned for your comment so I can complete the exercise.
@gokudomatic Жыл бұрын
I find your work very interesting. Thanks for making those videos. I'm trying to implement a credible infinite world in Godot. I have already a basis, but I struggle to make real continents and oceans. And there's the topic of lakes and rivers that I didn't even begin to think about. That's why your videos are giving me helpful hints. Extra hints for my specific goal would of course be very welcome, as I'm still a real beginner in procedural worlds.
@WhiteBoxDev Жыл бұрын
Good luck with your projects! I suppose the best hint I can give to beginners is that procedural generation is never about just one perfect algorithm or method. A generated world is built with all kinds of algorithms layered on top of each other. The result of each layer can be interpreted by the programmer however they like. It’s all about creative thinking and breaking down the end vision into a series of steps.
@gokudomatic Жыл бұрын
@@WhiteBoxDev Thanks. Indeed, multiple layers are necessary, even just for creating biomes. What I have in mind for continents was the Voronoi noise and opensimplex on top of that. I'd love to find an article containing the good practices for worldmap generation, though. Advanced math isn't exactly my strong point.
@DrCaesarsPalace_MD Жыл бұрын
So cool!! In the pseudo code at 8min you would want to regenerate the random number for each (i,j) cell in the grid 👍
@jay_william17 Жыл бұрын
Nicely done tutorial
@davdav4804 Жыл бұрын
Thanks man, your video is a blessing, I really look forward to try to implement this in my projects ! Thank you so much for sharing and explaining it so well because I work with Unity and I already have a vague idea of how I will try to implement it!
@mikamulperi Жыл бұрын
Thank you! Very clear and understandable video.
@jaxonpetersen5942 Жыл бұрын
The for loop makes no sense
@bike_n_fish Жыл бұрын
Every time I discover a knew procedural generation algorithme I'm like a child before christmass wondering what stupid things I will do with my new toy
@WhiteBoxDev Жыл бұрын
The cool thing about procgen is that you can create your own quirky algorithms just by thinking of little tweaks that might align better with whatever you're making. There are many established algorithms, but what makes them really come to life are the little changes you make.
@emmaccode Жыл бұрын
Nice. Well explained, good code. Thanks. This will be easy to reinterpret and implement :p
@panos3620 Жыл бұрын
Nice!
@zentek5989 Жыл бұрын
This is a cool vibe
@zentek5989 Жыл бұрын
Love how you included two options for playtime, I know a few games that get annoying to listen to because it’s so repetitive