alexeybond / godot-constraint-solving Goto Github PK
View Code? Open in Web Editor NEWWFC (Wave Function Collapse) and generic constraint satisfaction problem solver implementation for Godot 4
License: MIT License
WFC (Wave Function Collapse) and generic constraint satisfaction problem solver implementation for Godot 4
License: MIT License
Hello,
I want to preface with how much I appreciate this addon as it offers a very complete and relatively easy to use integration of WFC. I am trying to make a custom Precondition2D that uses perlin noise (Or simplex noise) to create denser forested areas and plains that are to be populated by WFC. However, I am having trouble understanding how to use the bitset object and the mapper object. I'm also uncertain on how to add the custom precondition to the generator. Would it be possible to have a small crash course? The dungeon example isn't super explanatory...
Hello, how to make it use empty space in the sample? With walls in a GridMap it gave an error assert(mapper.size()>1) because it was only one tile type. Actually there are two types: wall and empty. Add another wall type, it runs but it fills target region with solid wall, ignores free space in positive sample.
I am encountering difficulties using WFC2DPreconditionDungeon
with the GridMap demo. Specifically, I am unsure how to set metadata for grid tiles, such as "wfc_dungeon_road" and "wfc_dungeon_wall." I have attempted various combinations, including setting the metadata for each MeshInstance3D within the library-source, but have been unsuccessful in retrieving the metadata in the code (the assert(not passable_domain.is_empty())
in /wfc/problems/2d/preconditions/precondition_2d_dungeon.gd
always fails).
Is it possible to use WFC2DPreconditionDungeon
with gridmap?
How can I set the metadata in my grid tiles?
Suppose that I want to add WFC2DPreconditionDungeon
with the gridmap demo, what are the steps that I should follow to set the "wfc_dungeon_road" and "wfc_dungeon_wall" metadata to the mesh?
Am I supposed to set metadata for each MeshInstance3D inside the library-source?
I can contribute by adding some documentation regarding that part when everything will be more clear.
After using the addon I feel like I'm still struggling with the same thing: creating a proper sample.
Trying to imitate the one in the example scene will quickly hit limits, like when you have multiple types of ground tiles or you want to create different kind of biomes.
I feel like this might be a nice priority to have for the docs, feel free to close if that's not the case tho.
I see according to the features implementation it is not yet added. Is there any known workarounds or any current plans to add it to this plugin? If i want to add trees on top of tiles already placed, with the current features this is not possible (see image below.)
Hi, as the title mentions, I am trying to follow the how-to: https://github.com/AlexeyBond/godot-constraint-solving#how-to-use but I can't seem to get the WFC2DGenerator node to appear in my node search window. I'm not sure if I need to do something more after installing the plugin or not.
Any advice?
Hello. Again not an issue, but just want to ask/discuss the plugin.
I am trying to dynamically load chunks of the world as the camera moves around. Basically the algorithm would basically just load the tiles in the world that are visible on the camera. Is there an easy way to rerun the WFC algorithm on a different Rect2i on the same TileMap?
Thanks!
Wouldn't the speed be better using C# or something else? I'm not trying to offend anyone, but I'd really like to know what was the benefit of picking gdscript. Read multiple times that iteration is faster in other languages etc.
Hello, to make a lock and key dungeon:
Generate your dungeon with the locked doors.
How to make a series of separate walkable regions with wfc? And maybe also ensure that there is somewhere a certain tile (door) between each A -> A+1 region. And maybe a way to find the door of each region, so a key can be generated and linked to it.
Hello, I've just started a project and was really curious on using your WFC generator to help generate my isometric world map.
I was reading through another Docs request about good samples, and I'm trying to understand exactly how to make good Positive samples and Good negative samples. Currently, I am trying to generate a city scape using the WFC, but the generator seems to generate a lot of combinations that were either not given in the positive sample or it would generate combinations that were normally regarded as bad from the negative sample.
It would be useful to have some visual examples of how the generation logic is supposed to function so that we can work around it. For example, if I place a tile by itself on the negative sample example will that be understood that that tile should never be placed, or will it understand that I mean to say that that tile should never be alone? As in, it should always have at least 1 neighbouring tile.
Here I have what I'm using currently, and I have complete matrices = false added to the base code.
In case you want some context on the blocks, they're just for visual reference I know it looks nothing like a city lol
But the tiles should represent:
grey = exterior tiles,
black = road tiles,
green = wall tiles,
red = interior tiles,
orange = door tiles,
blue = end of road tiles
Prositive Sample
Negative Sample
Result (Long Road is prebuilt by me)
Hi there! I've been busy messing around with your addon and trying to find a way to generate rooms that connect in a 2D Tilemap. I was going to try to mess with the rules, but am unsure how it works.
Do you know any good resources on how to use your WFCRules?
Hi,
Thanks for the amazing work, it really helps for me to understand WFC better. I'm just wondering if it's possible to have path constraints when we generate the map, so that there's always a path connection between 2 points on the map, to avoid only a bunch of disconnected rooms or areas? Thanks in advance!
Similar like: https://boristhebrave.github.io/DeBroglie/articles/path_constraints.html
First of all, this is an awesome plugin. I apologize for making an issue post as there's no discussion post options. This is not an issue, just a question. Does this plugin respect the various properties painted onto the tile? e.g. custom data, physics, navigation, etc?
After working on layered map support, I realized that it'd be better for me to use this for my game rather than trying to make my own solution, because your solver works like a charm and you seem to be very comfortable with it and keeping it up to date.
What I'm missing for my game is mostly multi-layers (which is being done in #4) and tiles probability.
This issue is mostly to open the discussion on how it could be implemented and what the solver should accomplish to be considered as working with probabilities.
In order to be considered done, the solver would have to be able to read a weight from each tile in a tileset, tile by tile. Setting this info could be done using different methods, one of which being using custom property painting in the tileset editor (or even using the built-in probability property), the other being using some kind of configuration resource for more advanced cases.
A feature that's not required per se but that could be interesting would be to have conditional weights, for instance tile A having a weight of 5 next to tile B but weight of 2 next to tile C, that's a more advanced case that would probably only be solved using a custom resource or a custom ruleset (maybe tile aliases or something to help with that?)
If we're using the built-in approach to have a basic probability system, we could simply read the tile's properties to grab probability from that, then using it to computed a weighted random when picking the tile in the solver (I'm failing to see where tho)
Using a more custom approach would require giving cells a probability using a config resource, which could be useful to handle Scene Tiles (which is something I'm doing in my game to have collectable elements placed directly as tiles so they match the grid perfectly).
Maybe we should just make it either support both approaches or just the custom one so worst case, everything can be done with it even tho it'd be worse in terms of DX
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.