This was another fun project! If you'd like to support the channel and get access to project source code, I just made a Patreon: www.patreon.com/RachelfTech. Thank you in advance for any support over there, but also just for being here and watching my videos, I really appreciate it! 🙌
I wanted to suggest you CNN or GAN's, but it takes to long time to train them. What you can use pretty quickly are Markov Chains. You have then to provide examples or have the transition weights. In my opinion with this approach you would avoid to build in the middle of the grass or have empty space like her 23:02
Ive spent a lot of time programming procedural algorithms in the past for games. I would suggest combine Wave Function Collapse with another algorithm to automatically generate a floorplan on the castle. Then set the bottom objects to those rooms. This will make a more organized castle generation. Look up dungeon generation algorithm to find a good one if this is a path you want to take.
I was tinking similar. When engineering a building you also build a hirachy of constraints and requirements. Like how many people will live in the castle. Then you derive what rooms they need and how big those needs to be. Then alignment etc. By making this hirarchy you eliminate design choices that would be possible, but not what people want. Like butting the bathroom as a connecting room between your door and your kitchen.
@@jackturner7814it's exactly what she showed in the video. You have a set of tiles which have constraints that indicate what sorts of tiles can be on any of its sides. You then initialize one of your map spaces with one of the constrained tiles, and update the possible values of any surrounding tiles based on which one you picked. You continue oats, doing this for all the tiles around those ones (removing an option from one might make one on the next one over have options that are impossible, for example) and so on. If you have a space with no possible values, you'll have to backtrack or restart, since all spaces must be filled - otherwise, do it all again with another random tile selection on another random tile.
The joy you exude explaining your projects is super contagious and inspirational. I am currently working on my own desktop pet, inspired by your previous project (mine is a squirrel).
I do appreciate the tight but not miniscule scoping you use for these projects. Enough so that it's not just 'wow, look at this cool algorithm' (although depending on who you talk to some of that sort of thing might work well for the youtube algo gods), but not so much that you only release one video every 3 years. Hope you can remain excited about things!
Thank you! I'm still figuring out what scope works best for these videos, but I do like how they've been turning out so far! I'll probably continue doing a mix of projects around this size and a bit smaller; aiming to post around once per month :)
@@jtw-r Yeah, that's a great additional point. It's soooo easy to burn out all that early enthusiasm just pushing for one more feature/bug fix... "Morning" brain is a much better investment!
@@RachelfTechI'm sure you've looked into this way now than a casual viewer has, but if I've learnt anything about UA-cam channel growth from people's 100k,1 million retrospectives is mainly that it's never quite what you thought it would be, but as long as you can bring the same enthusiasm to the the idea that works, you can at least keep the mental health in decent shape. I'm sure you learnt a lot of those lessons from your guitar channel though!
This is so freaking cool. I think the most interesting part for me was the bug hunting.. the visualizer you made to see exactly what the algo was doing. So satisfying, so cool.
I appreciate your videos, you do a good job of keeping it entertaining without really hiding your debugging journey. I also like how you go about troubleshooting. For instance, your approach to visualize the algorithm isn't something I almost ever do but it seems really wise to figure out what's going on.
I love that you show all those struggles, imperfections and "I have no clue what I'm doing" situations of game design. You are super smart about the algorithm part but when it came to Blender I had to laugh because so many of us "techies" with no art background came across those same problems. Like when you said "I had to UV-unwrap my tiles but had no idea how to do" and then proceeded to do everything wrong, I just felt that so much :D
Great video. I appreciate the part about pop_back vs pop_front, and that you returned to it rather than just letting it be. I've seen too many engineers who just accept the "seems to work solution," when they can't explain why alternatives fail. The name "wave function collapse" is quite silly though. I know you didn't name it, but I hadn't heard of it before, and the first few times this video showed up in my feed I assumed it involved quantum mechanics somehow and skipped over it, figuring it wasn't a practical technique.
Man, these videos are so great. Always inspires me to keep my heart in gamedev. The projects are fun and I learn something from each video (though probably not nearly as much as you!)...and the delivery (it always seems like you're on the verge of laughing or something) just make for a really enjoyable video. It's just nice to have some purely fun explorative content in this space.
This is such a great project. Thanks for sharing your process and it looks great!
19 днів тому+1
great video! this seems fun to do. i knew about this algorithm and the references you showed but never tried myself, or seen anybody do it for a hobby project. for the height issue: maybe just lower the max height of the space so you dont get anything that tall? or dont allow pieces collapse that has only air around them so it would ground the generation process. it would feel like the castle is growing form the ground upwards and not materializing from every direction all at once
I'm starting to notice a pattern in your love for squishy birds. I absolutely love these projects and the progress you are making on them. Keep up the great and inspiring work, it's so exciting to see.🐥
Another excellent video. I've always been fascinated by procedural generation. Reading Notch's devlogs of creating Minecraft map generation was inspiring. I never understood exactly how it worked, but I do understand how to solve Sudoku (made my own solver years ago). I could follow what you were doing, but tackling something like that is way beyond me atm. Still struggling with TileMaps. Was fun to watch you get it working. Learning of EditorScript will help out in duplicating all my TileMapLayers while trying to create a season transition using tileset crossfades in my current project. Probably a dumb way to do it, but I don't know of a better one yet. Seeing the tools you use helps us beginners out.
Great video! Love the project, the result turned out beautiful!!! When you were dealing with all the tall towers and thinking about how to reduce their frequency, it immediately made me think about weighted randomness, which is ultimately what you implemented. A real simple way I often go about this, is by generating two random values and always picking the lower of the two values, this will give you a linear distribution where the higher the value, the lower its frequency. If you need more of an extreme, you can just do the lowest of 3, 4 or more values, and that will give you more control over it. Anywho, love your work, especially all of the generative stuff, keep em coming!
I ran into the same problem with WFC not being able to finish the generation. I used a red symbol with no constraints that was placed when no solution to the existing WFC state could be found. Then created new tiles to fill the gaps for these cases. It was like 15% more tiles i needed in the end.
I didn't really understand the algorithm itself until I saw the "debug" visualizer with the red blue and green blocks, then it all clicked for me instantly. Great video!
When I would fall asleep at the keyboard, wake up long enough to save, & come back later to find that I'd "fixed" something with a method I no longer recall, much less how to implement across the rest of the code...
Cool project. The thing is, when doing these PoC’s or small demo projects, you learn so much that will make you even better at the next project. I’ve been coding software for many, many years, and it’s funny how we all struggle with the same problems solving the code. I hope, whoever build these AI tools will focus on AI that can spot these mistakes we make, so coding will be a lot faster in the future. Right now AI is only good for making boiler plate code. I use Blender for Isometric tile sets. I use a sun ray instead of a point light to ensure that light fall equally on the models to not have the shading on a flat surface change. I also put all tiles into the same Blender files in different groups and build a script that will show, rotate and render all tiles from four angles.
New to Godot but a developer with some experience, I discovered your channel today and I'm already a fan! I devoured all your videos. I like your way of seeing things, solving problems and explaining concepts, it all speaks to me a lot. You seem to be a curious person, who gives 200%, who does not hesitate to rush headlong even into an area that you do not master, to search again and again to find THE solution and then share it. A true soul of a developer, rare, precious, never lose that. Unfortunately, my financial situation does not allow me to help you but know that my heart is in it! PS: Sorry for the quality of the English, it's not my original language. Google helps a lot but I don't know if I managed to transcribe all the expressions of my language.
I tried to do some WFC stuff before and hit all the same things you did, and then I gave up! Your video is inspiring me to take another crack at it. you rock!
woah! really interesting surprise to see this channel after I followed your other guitar channel, I had to come into the video and see the guitars to really be sure haha, your channel was an inspiration for me to get back to guitar playing and I've been getting back into gamedev so it's really cool to see this!
That looked like fun! Well done! I've done a ton of procedural generation, for no good reason really. One thing I recently did which was a lot of fun and really challenging, was generating whole cities, with streets and buildings. Especially if you want to streets to not be a perfectly square grid.
Wow ❤ this project is so cool - hats off girl 😊👏❤️ Im not in game dev thats random pop probably 😅 but your passion speak for themselve - very inspiring 😊
This video is so relatable and awesome. I was obsessed with the idea of a WFC castle a while ago, and I am glad there are non-lazy people like you to actually put ideas like that into action
Awesome work! WFC is such a cool algorithm for procedural level generation, never used it myself but always looked like a very fun thing to create. Well, a full thing to have created, I always imagined it being a frustrating thing to actually create/debug due to all sorts of weird edge case possibilities!
As a fan of procedural generation this was very enjoyable to watch, seeing so much progress in half an hour feels like programming with super powers :)
I think you could add more rules/constraints that could make more castle-looking structures. Things like, requiring it to create an enclosed geometric shape, walls on the outside are always shorter than walls on the inside, corners always have a tower, etc.
Instead of picking a random point in the 3d space, run the WFC from the bottom layer first, then as it gets taller, eventually only the columns under the spires will be left, and they'll naturally choose a top.
Really cool stuff! The final product looks really nice, and it was interesting to see some of your findings! I have to say, I'm quite confused as to why it was faster to pop off the front of the array rather than the back... makes me think it was implemented as a queue instead of an array. I also feel like there's gotta be a faster way to propagate those constraints, but don't know what the algorithm would be off the top of my head. I feel like it'd be something related to adding the tiles around a changed tile to a stack and see if any of their constraints change, adding the tiles around *that* to the stack if it indeed did get more constrained. Edit: Just remembered doubly-linked lists, couldn't have been implemented that way
Thank you! I think in my case it's not that the pop front operation itself was actually faster, just that the algorithm ended up being able to resolve constraints faster in that order compared to the other way around. And yeah, I'm sure there are optimizations you could do to speed up the propagation! It's definitely not the fastest algorithm in general, but I also didn't spend much time thinking about optimization for this project.
This is sick! I tried to implement a wave function collapse map generator myself and like you said i totally overcomplicated it. I was trying to generate constraints using a python script in blender that would identify vertices along the edges of some very low poly pieces and would calculate if it lined up. Looking back it was definitely a failure on my part to understand that WFC should generate constraints from an example output lol
I'm not so sure that WFC should _always_ generate from a single example; as another commenter noted, it can be useful to have a no-constraint block to drop when no block within constraints can be found: Upon review, you can then see where an example wasn't complete enough to demonstrate all potentials, & add the missing block type (including to any examples) going forward! Working on paper, with explicit step-by-step rules & paper tiles, can be illuminating in this regard; you're still doing wave-function-collapse, but your desired concept is the 'example' & _you_ are forced to find all the rules necessary to produce that concept repeatably yet with variation. There again, you may likely find points that can't be filled with the pieces ules you initially established. The example might not _always_ need to be monolithic or even strictly defined; just iterating through ruleset variations, can sometimes _reveal_ an ideal example that we didn't even know the full details of until we tried building them a few hundred different ways.
if you want to have some more structure you can do multiple layers of wave function collapse. first you collapse a meta-structure, then you fill the meta structure will the actual tiles in the second collapse
Great video! Pretty sure the normal map for your bricks is flipped in the Y direction. The depth might be inverted as a whole but I think the Y direction is just flipped which is why they look odd.
Great project! My only nitpick is that seems to me like the brick texture has the seams going out instead of in - so either the normal map or the normals themselves should be inverted. A great spot to see this is at 24:13
The problem with lighting was most likely normals being generated smooth. When you see shading weirdness, turn on the "view normals" mode in your viewport. And to fix that, set the bottom edge to "crease" in blender.
Thing hovering on top of grass is the grass texture wrapping around and showing bottom row of pixels on very top, you can fix that by switching texture sampling from wrap to clamp.
It would be so cool if the generative castles were a maze players could try and solve. They could either start from the outside trying to make their way to the center or from the center trying to make their way out. Adding more birds of varying colors could also be a fun way to earn points, it would be super cool if the birds only generated along paths that "could" lead to the end. Oh! And if it needs a story element it could be a Kind or Queen player looking for their missing crown. Or a little Knight character searching for it on their Majesties request. Each play through would be different keeping it interesting with a near limitless number of unique levels for one to go through! Okay now to step away from my own head for a moment lol, this was so much fun to watch. I felt like I learned something, I won't lie and say I'm gonna try this myself but I definitely wan to give it a try sometime in the near future. Just need to figure out where to start before diving in head first. Love the concept, 11/10 bird design, look forward to the next vid. :)
There was a company called Subversion that build a city generator, all the way down to the insides of buildings. Looked really good. The only problem was that they couldn't figure out a way to build a game around it.
I would have constrained the algorithm to start from the bottom and work up. That way, you wouldn't have the problem of randomly selecting a top grid cell that you _have_ to place something in. Usually, that's how buildings are constructed: from the bottom up. You could even add dynamic rules such that a wall tile is only valid as long as it doesn't have 5 or more wall tiles below it, or a spire can't have 5 or more spire tiles below it. Then you could better control the different castle size parameters. Might be difficult to save those kind of rules as a resource though. The suggestion from one of the top comments to generate a floor plan first is a step up from that as well.
I've done a lot of procgen projects over the last 25 years but only recently have I started experimenting with hydraulic erosion. It seems obvious to me that the kind of mountain ranges you see in California or the northwestern coastal USA should be computable with a hydraulic erosion algorithm that's lattice-based, but I've really been struggling getting it to not just look like rock formations that have eroded into sand. Including a talus angle helped, but I still haven't been able to get those sharp angled ridges forming properly, which is what I'm going for. I assumed that IRL they form by large shallow flows eroding, and the erosion narrows as it grows deeper - but apparently the opposite is what happens. Instead, a narrow stream forms and stuff basically falls into it, while it keeps eroding deeper, resulting in the classic V-channel and angled ridges. Anyway, just thought I'd share a little bit of info about what I've been doing since you've shared your pursuits with us randos on here :]
Quick advise: Your normal maps are inverted by the end of the video, you just need to invert the green channel in photoshop or anything similar. I think Godot uses open gl normal map format and yours were maybe done for direct X :D
Fun! :D You could add a "Hide and seek" mode where you have to look around the castle to find the bird, once found/clicked the bird will find a new hiding spot :))
I wondered about doing generated castles after seeing Townscape. It certainly looks fun to try, but I think the constraints of wave function collapse possibly aren't enough, in that they're great for filling in smaller details, but the bigger picture isn't working. E.g. you need castle walls to form contiguous enclosements. So as others say, there's another algorithm needed somewhere, or maybe several iterations of the WFC algorithm run at different scales of the structure. Maybe you can achieve it with components collapsing that aren't visible, like "inside-of-wall air" blocks?
Yeah you could definitely do more with it/modify the algorithm to make things more traditionally castle like! Would be interesting to explore further :)
I think the problem with the high castles is caused by the pop_front/pop_back thing. In WFC you sort by the "entropy" of a tile so the tile being picked is the one that has the least options, so for this it should start generating from the bottom (we know it's not going to be a tower, only a castle floor or empty). You seem to have the order wrong making it so that it starts from the top. Which does mean it's *faster* because it can immediately eliminate a lot of options from the tiles below, but it does mean the quality of the result is less. A fun thing with WFC, optimizing for speed in this case means optimizing against quality.
I think my code is actually correctly picking from the cells with the fewest options first, it's just that the top of the map actually ends up with fewer options than the bottom because I pre-fill empty tiles around all sides of the map to prevent cut-off castles. And this results in fewer options for cells at the top of the map, because the only tiles allowed are castle top pieces. Also, the pop_front/pop_back part is for propagating constraints out from the chosen collapsed cell, and it's not actually used in the selection process for choosing which cell to collapse initially. So I think, in my case at least, a way to fix the tall spires would be to actually not choose cells to collapse based on entropy and instead manually choose to always go from bottom to top. Could be worth trying out at some point!
This was another fun project! If you'd like to support the channel and get access to project source code, I just made a Patreon: www.patreon.com/RachelfTech. Thank you in advance for any support over there, but also just for being here and watching my videos, I really appreciate it! 🙌
I wanted to suggest you CNN or GAN's, but it takes to long time to train them. What you can use pretty quickly are Markov Chains. You have then to provide examples or have the transition weights. In my opinion with this approach you would avoid to build in the middle of the grass or have empty space like her 23:02
Ive spent a lot of time programming procedural algorithms in the past for games. I would suggest combine Wave Function Collapse with another algorithm to automatically generate a floorplan on the castle. Then set the bottom objects to those rooms. This will make a more organized castle generation. Look up dungeon generation algorithm to find a good one if this is a path you want to take.
I was tinking similar. When engineering a building you also build a hirachy of constraints and requirements. Like how many people will live in the castle. Then you derive what rooms they need and how big those needs to be. Then alignment etc.
By making this hirarchy you eliminate design choices that would be possible, but not what people want. Like butting the bathroom as a connecting room between your door and your kitchen.
Game dev (Tech artist) here: What is the wave function collapse algorithm? I only know the term from beginning quantum mechanics...
@@jackturner7814it's exactly what she showed in the video. You have a set of tiles which have constraints that indicate what sorts of tiles can be on any of its sides. You then initialize one of your map spaces with one of the constrained tiles, and update the possible values of any surrounding tiles based on which one you picked. You continue oats, doing this for all the tiles around those ones (removing an option from one might make one on the next one over have options that are impossible, for example) and so on. If you have a space with no possible values, you'll have to backtrack or restart, since all spaces must be filled - otherwise, do it all again with another random tile selection on another random tile.
The eternal problem. "This works and I have no idea why... do I leave it?" 😂 Great video.
sometimes it seems like it only works when you type random things that have nothing to do with anything
The joy you exude explaining your projects is super contagious and inspirational. I am currently working on my own desktop pet, inspired by your previous project (mine is a squirrel).
Thanks so much! That's awesome to hear! 🐿️
I hope you make a tutorial. Any advice? Wanna make one myself.
I do appreciate the tight but not miniscule scoping you use for these projects. Enough so that it's not just 'wow, look at this cool algorithm' (although depending on who you talk to some of that sort of thing might work well for the youtube algo gods), but not so much that you only release one video every 3 years.
Hope you can remain excited about things!
100% and I love that she recognises that she has done enough in a day, and should come back with a fresh set of eyes.
Thank you! I'm still figuring out what scope works best for these videos, but I do like how they've been turning out so far! I'll probably continue doing a mix of projects around this size and a bit smaller; aiming to post around once per month :)
@@jtw-r Yeah, that's a great additional point. It's soooo easy to burn out all that early enthusiasm just pushing for one more feature/bug fix...
"Morning" brain is a much better investment!
@@RachelfTechI'm sure you've looked into this way now than a casual viewer has, but if I've learnt anything about UA-cam channel growth from people's 100k,1 million retrospectives is mainly that it's never quite what you thought it would be, but as long as you can bring the same enthusiasm to the the idea that works, you can at least keep the mental health in decent shape.
I'm sure you learnt a lot of those lessons from your guitar channel though!
This is so freaking cool. I think the most interesting part for me was the bug hunting.. the visualizer you made to see exactly what the algo was doing. So satisfying, so cool.
I appreciate your videos, you do a good job of keeping it entertaining without really hiding your debugging journey. I also like how you go about troubleshooting. For instance, your approach to visualize the algorithm isn't something I almost ever do but it seems really wise to figure out what's going on.
Thanks so much!
I love that you show all those struggles, imperfections and "I have no clue what I'm doing" situations of game design. You are super smart about the algorithm part but when it came to Blender I had to laugh because so many of us "techies" with no art background came across those same problems. Like when you said "I had to UV-unwrap my tiles but had no idea how to do" and then proceeded to do everything wrong, I just felt that so much :D
ive had this in my watch later for weeks and im glad i finally watched it this is dope im subbing
Great video. I appreciate the part about pop_back vs pop_front, and that you returned to it rather than just letting it be. I've seen too many engineers who just accept the "seems to work solution," when they can't explain why alternatives fail.
The name "wave function collapse" is quite silly though. I know you didn't name it, but I hadn't heard of it before, and the first few times this video showed up in my feed I assumed it involved quantum mechanics somehow and skipped over it, figuring it wasn't a practical technique.
Next project: Ok..I was not done with the Castle Generator...
Amazing project! I understood like 5% but it was really entertaining to watch!
😄, thank you!
Love to see this project growing and you growing along
Thank you! :)
Man, these videos are so great. Always inspires me to keep my heart in gamedev. The projects are fun and I learn something from each video (though probably not nearly as much as you!)...and the delivery (it always seems like you're on the verge of laughing or something) just make for a really enjoyable video. It's just nice to have some purely fun explorative content in this space.
Really happy to hear that, thanks so much! More coming soon :)
This is such a great project. Thanks for sharing your process and it looks great!
great video! this seems fun to do. i knew about this algorithm and the references you showed but never tried myself, or seen anybody do it for a hobby project.
for the height issue: maybe just lower the max height of the space so you dont get anything that tall? or dont allow pieces collapse that has only air around them so it would ground the generation process. it would feel like the castle is growing form the ground upwards and not materializing from every direction all at once
I'm starting to notice a pattern in your love for squishy birds. I absolutely love these projects and the progress you are making on them. Keep up the great and inspiring work, it's so exciting to see.🐥
Thanks so much! 🐔
Another excellent video. I've always been fascinated by procedural generation. Reading Notch's devlogs of creating Minecraft map generation was inspiring. I never understood exactly how it worked, but I do understand how to solve Sudoku (made my own solver years ago). I could follow what you were doing, but tackling something like that is way beyond me atm. Still struggling with TileMaps. Was fun to watch you get it working. Learning of EditorScript will help out in duplicating all my TileMapLayers while trying to create a season transition using tileset crossfades in my current project. Probably a dumb way to do it, but I don't know of a better one yet. Seeing the tools you use helps us beginners out.
Saw Townscaper and wanted to know how to and your video was the best learning experience... Thanks for you work 👍
Awesome to hear, glad it was helpful!
Great video! Love the project, the result turned out beautiful!!!
When you were dealing with all the tall towers and thinking about how to reduce their frequency, it immediately made me think about weighted randomness, which is ultimately what you implemented. A real simple way I often go about this, is by generating two random values and always picking the lower of the two values, this will give you a linear distribution where the higher the value, the lower its frequency. If you need more of an extreme, you can just do the lowest of 3, 4 or more values, and that will give you more control over it. Anywho, love your work, especially all of the generative stuff, keep em coming!
Thanks so much! That's a cool way of handling weighted randomness, thanks for sharing!
I ran into the same problem with WFC not being able to finish the generation. I used a red symbol with no constraints that was placed when no solution to the existing WFC state could be found. Then created new tiles to fill the gaps for these cases. It was like 15% more tiles i needed in the end.
I didn't really understand the algorithm itself until I saw the "debug" visualizer with the red blue and green blocks, then it all clicked for me instantly. Great video!
That's awesome to hear, I'm glad the visualizer helped!
"It doesn't work and I don't understand why".
"It works and i don't understand why".
The programmer's dichotomy 😅
When I would fall asleep at the keyboard, wake up long enough to save, & come back later to find that I'd "fixed" something with a method I no longer recall, much less how to implement across the rest of the code...
Cool project. The thing is, when doing these PoC’s or small demo projects, you learn so much that will make you even better at the next project. I’ve been coding software for many, many years, and it’s funny how we all struggle with the same problems solving the code. I hope, whoever build these AI tools will focus on AI that can spot these mistakes we make, so coding will be a lot faster in the future. Right now AI is only good for making boiler plate code.
I use Blender for Isometric tile sets. I use a sun ray instead of a point light to ensure that light fall equally on the models to not have the shading on a flat surface change. I also put all tiles into the same Blender files in different groups and build a script that will show, rotate and render all tiles from four angles.
Neat! Fun to see both your process and your result. And the click-on-bird thing is totes adorbs. :)
Subscribed!
New to Godot but a developer with some experience, I discovered your channel today and I'm already a fan! I devoured all your videos.
I like your way of seeing things, solving problems and explaining concepts, it all speaks to me a lot. You seem to be a curious person, who gives 200%, who does not hesitate to rush headlong even into an area that you do not master, to search again and again to find THE solution and then share it. A true soul of a developer, rare, precious, never lose that.
Unfortunately, my financial situation does not allow me to help you but know that my heart is in it!
PS: Sorry for the quality of the English, it's not my original language. Google helps a lot but I don't know if I managed to transcribe all the expressions of my language.
Thanks so much for the kind words, I really appreciate it! It's great to hear people are enjoying the format of the videos :)
This was a dope experiment to try out. Learned a lot without having to struggle to sort it out myself hahaha. More! More!
shout out to the godot & vscode editing combo. love the coding focus serious face😄 thx for making this
I tried to do some WFC stuff before and hit all the same things you did, and then I gave up! Your video is inspiring me to take another crack at it. you rock!
This wasnt only fun to watch, but also very inspiring. Thank you very much for sharing! 🙂
I'm so happy to hear that, thank you!
woah! really interesting surprise to see this channel after I followed your other guitar channel, I had to come into the video and see the guitars to really be sure haha, your channel was an inspiration for me to get back to guitar playing and I've been getting back into gamedev so it's really cool to see this!
Glad to hear people are randomly finding me here too! So cool to hear, thanks for watching :)
This looks great fun, it's really good having something like this + just building and building.
That looked like fun! Well done! I've done a ton of procedural generation, for no good reason really. One thing I recently did which was a lot of fun and really challenging, was generating whole cities, with streets and buildings. Especially if you want to streets to not be a perfectly square grid.
Thank you! That definitely sounds like a fun project as well, something I'd like to experiment with in the future too!
Okay, just found this channel with this video, love it, subscribed!
This is an awesome walk through for something I've wanted to grok for a long time. Thanks!
You are quickly becoming one of my favorite game programming channels. Keep up the great work and thank you!
Thank you so much, I really appreciate it!
This was the first time I've seen wave function collapse, so thanks for the explanation!
Very cool video. I've just started using godot and am really impressed with what can be done in it.
Wow ❤ this project is so cool - hats off girl 😊👏❤️ Im not in game dev thats random pop probably 😅 but your passion speak for themselve - very inspiring 😊
YOU are my favourite youtuber ever sooo helpful
I barly understand a word, but I love what I see (generators are SO awesome!) and your happy energy. :)
Such an exciting project! Well done 🥜
Thanks so much! :)
Youre a huge inspiration for a godot game developer like myself!! Keep making awesome stuff
Thanks so much, I really appreciate it!
This is so cool! I remember when Townscaper first came out I was so impressed by this kind of algorithm. Super fun to see more of this!
Nice video which I enjoyed watching!
This video is so relatable and awesome. I was obsessed with the idea of a WFC castle a while ago, and I am glad there are non-lazy people like you to actually put ideas like that into action
This was a very fun and informative video, thanks for sharing.
Thank you! 😁
Awesome work! WFC is such a cool algorithm for procedural level generation, never used it myself but always looked like a very fun thing to create. Well, a full thing to have created, I always imagined it being a frustrating thing to actually create/debug due to all sorts of weird edge case possibilities!
Definitely ran into some frustrating debugging moments 😅, but it's really cool when it comes together!
As a fan of procedural generation this was very enjoyable to watch, seeing so much progress in half an hour feels like programming with super powers :)
your smile is contagious, I keep smiling I dunno why
I love your videos, keep it up!
Thank you!
Absolutely gorgeous😦
I think you could add more rules/constraints that could make more castle-looking structures. Things like, requiring it to create an enclosed geometric shape, walls on the outside are always shorter than walls on the inside, corners always have a tower, etc.
Another WFC video, what a good day
That was fantastic to watch! :D
This was lovely!
Thank you! :)
woooweeeee very impressive! nice project
Your videos are so entertaining. I love how happy you are talking about programming, it reminds me of The Coding Train.
Thanks so much!
Instead of picking a random point in the 3d space, run the WFC from the bottom layer first, then as it gets taller, eventually only the columns under the spires will be left, and they'll naturally choose a top.
"but I was struggling with this and decided to take a break" is so relatable lmao
respect, I tried to implement this aswell and failed miserably on the constraint generation. You made it look so easy lol.
So amazing!!!
Hii great work !! just wanted to feed the algorithm and also say I love that I can actually hear you smiling all the time when you talk 😆😁
Thanks so much!
good job! keep it up!
omg this is so cool!!
Thanks. I really enjoyed watching this video.
So happy to hear, thanks!
This was a great video :) Thank you.
Thank you!
Really cool stuff! The final product looks really nice, and it was interesting to see some of your findings! I have to say, I'm quite confused as to why it was faster to pop off the front of the array rather than the back... makes me think it was implemented as a queue instead of an array. I also feel like there's gotta be a faster way to propagate those constraints, but don't know what the algorithm would be off the top of my head. I feel like it'd be something related to adding the tiles around a changed tile to a stack and see if any of their constraints change, adding the tiles around *that* to the stack if it indeed did get more constrained.
Edit: Just remembered doubly-linked lists, couldn't have been implemented that way
Thank you! I think in my case it's not that the pop front operation itself was actually faster, just that the algorithm ended up being able to resolve constraints faster in that order compared to the other way around. And yeah, I'm sure there are optimizations you could do to speed up the propagation! It's definitely not the fastest algorithm in general, but I also didn't spend much time thinking about optimization for this project.
This is sick!
I tried to implement a wave function collapse map generator myself and like you said i totally overcomplicated it. I was trying to generate constraints using a python script in blender that would identify vertices along the edges of some very low poly pieces and would calculate if it lined up. Looking back it was definitely a failure on my part to understand that WFC should generate constraints from an example output lol
I'm not so sure that WFC should _always_ generate from a single example; as another commenter noted, it can be useful to have a no-constraint block to drop when no block within constraints can be found: Upon review, you can then see where an example wasn't complete enough to demonstrate all potentials, & add the missing block type (including to any examples) going forward!
Working on paper, with explicit step-by-step rules & paper tiles, can be illuminating in this regard; you're still doing wave-function-collapse, but your desired concept is the 'example' & _you_ are forced to find all the rules necessary to produce that concept repeatably yet with variation. There again, you may likely find points that can't be filled with the pieces
ules you initially established.
The example might not _always_ need to be monolithic or even strictly defined; just iterating through ruleset variations, can sometimes _reveal_ an ideal example that we didn't even know the full details of until we tried building them a few hundred different ways.
if you want to have some more structure you can do multiple layers of wave function collapse. first you collapse a meta-structure, then you fill the meta structure will the actual tiles in the second collapse
You make games now! Awesome!
Great video! Pretty sure the normal map for your bricks is flipped in the Y direction. The depth might be inverted as a whole but I think the Y direction is just flipped which is why they look odd.
worked on something similar in college but much simpler definitely was a fun challenge translating the high level algo into actual code
narrator rachel: now I decided for real I am done
devlog rachel: now for real I am done
these cuts make me chuckle
Great project! My only nitpick is that seems to me like the brick texture has the seams going out instead of in - so either the normal map or the normals themselves should be inverted. A great spot to see this is at 24:13
You did good!
How are you so talented at everything!??
Wow, impressive!
The problem with lighting was most likely normals being generated smooth. When you see shading weirdness, turn on the "view normals" mode in your viewport. And to fix that, set the bottom edge to "crease" in blender.
your freaking awesome.
Thing hovering on top of grass is the grass texture wrapping around and showing bottom row of pixels on very top, you can fix that by switching texture sampling from wrap to clamp.
Those are some crazy looking castles
It would be so cool if the generative castles were a maze players could try and solve. They could either start from the outside trying to make their way to the center or from the center trying to make their way out. Adding more birds of varying colors could also be a fun way to earn points, it would be super cool if the birds only generated along paths that "could" lead to the end. Oh! And if it needs a story element it could be a Kind or Queen player looking for their missing crown. Or a little Knight character searching for it on their Majesties request. Each play through would be different keeping it interesting with a near limitless number of unique levels for one to go through! Okay now to step away from my own head for a moment lol, this was so much fun to watch. I felt like I learned something, I won't lie and say I'm gonna try this myself but I definitely wan to give it a try sometime in the near future. Just need to figure out where to start before diving in head first. Love the concept, 11/10 bird design, look forward to the next vid. :)
Respect! 👍
Good idea for a beast.
Every time I see one of your titles I think "Hell yeah you did!"
There was a company called Subversion that build a city generator, all the way down to the insides of buildings. Looked really good.
The only problem was that they couldn't figure out a way to build a game around it.
I would have constrained the algorithm to start from the bottom and work up. That way, you wouldn't have the problem of randomly selecting a top grid cell that you _have_ to place something in. Usually, that's how buildings are constructed: from the bottom up. You could even add dynamic rules such that a wall tile is only valid as long as it doesn't have 5 or more wall tiles below it, or a spire can't have 5 or more spire tiles below it. Then you could better control the different castle size parameters. Might be difficult to save those kind of rules as a resource though.
The suggestion from one of the top comments to generate a floor plan first is a step up from that as well.
Bucket list item to learn this 😭 so many ideas forever. No time tho
Going down the rabbit hole of bird click = tweet is too relatable
I've done a lot of procgen projects over the last 25 years but only recently have I started experimenting with hydraulic erosion. It seems obvious to me that the kind of mountain ranges you see in California or the northwestern coastal USA should be computable with a hydraulic erosion algorithm that's lattice-based, but I've really been struggling getting it to not just look like rock formations that have eroded into sand. Including a talus angle helped, but I still haven't been able to get those sharp angled ridges forming properly, which is what I'm going for. I assumed that IRL they form by large shallow flows eroding, and the erosion narrows as it grows deeper - but apparently the opposite is what happens. Instead, a narrow stream forms and stuff basically falls into it, while it keeps eroding deeper, resulting in the classic V-channel and angled ridges. Anyway, just thought I'd share a little bit of info about what I've been doing since you've shared your pursuits with us randos on here :]
I WILL LAY DOWN MY LIFE FOR SQUISHY BIRD
cool project!
Thank you!
these birds look HILARIOUS
Quick advise: Your normal maps are inverted by the end of the video, you just need to invert the green channel in photoshop or anything similar. I think Godot uses open gl normal map format and yours were maybe done for direct X :D
Interesting, will take a look, thanks!
@@Tapsin Looks like my normal map was indeed for Direct X, good catch! I'll just leave as is for now but good to know for future projects! Thanks :)
@ oh yes it was just a tip for future Rachel. Amazing videos by the way
@@Tapsin Thank you! :)
Fun! :D You could add a "Hide and seek" mode where you have to look around the castle to find the bird, once found/clicked the bird will find a new hiding spot :))
That would be fun! 😁
very nice work ***hand-clap hand-clap hand-clap***
I wondered about doing generated castles after seeing Townscape. It certainly looks fun to try, but I think the constraints of wave function collapse possibly aren't enough, in that they're great for filling in smaller details, but the bigger picture isn't working. E.g. you need castle walls to form contiguous enclosements. So as others say, there's another algorithm needed somewhere, or maybe several iterations of the WFC algorithm run at different scales of the structure. Maybe you can achieve it with components collapsing that aren't visible, like "inside-of-wall air" blocks?
Yeah you could definitely do more with it/modify the algorithm to make things more traditionally castle like! Would be interesting to explore further :)
great video thx
I think the problem with the high castles is caused by the pop_front/pop_back thing.
In WFC you sort by the "entropy" of a tile so the tile being picked is the one that has the least options, so for this it should start generating from the bottom (we know it's not going to be a tower, only a castle floor or empty).
You seem to have the order wrong making it so that it starts from the top. Which does mean it's *faster* because it can immediately eliminate a lot of options from the tiles below, but it does mean the quality of the result is less.
A fun thing with WFC, optimizing for speed in this case means optimizing against quality.
I think my code is actually correctly picking from the cells with the fewest options first, it's just that the top of the map actually ends up with fewer options than the bottom because I pre-fill empty tiles around all sides of the map to prevent cut-off castles. And this results in fewer options for cells at the top of the map, because the only tiles allowed are castle top pieces. Also, the pop_front/pop_back part is for propagating constraints out from the chosen collapsed cell, and it's not actually used in the selection process for choosing which cell to collapse initially.
So I think, in my case at least, a way to fix the tall spires would be to actually not choose cells to collapse based on entropy and instead manually choose to always go from bottom to top. Could be worth trying out at some point!
Man, that orientation problem in Blender is so familiar. :P
Cool project!