You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+21Lines changed: 21 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -30,6 +30,8 @@ What's not (yet) implemented:
30
30
- Wrapping.
31
31
- Tile probabilities.
32
32
It's currently not possible to control probabilities of certain tile types being "observed".
33
+
- Lazy/dynamic generation.
34
+
For some games it may make sense to generate parts of level dynamically when they are (about to) become visible to player.
33
35
- Rules editor.
34
36
Currently it's possible to "learn" WFC rules in running game only, not in editor.
35
37
Rules can be edited by modifying sample maps, using standard editor tools.
@@ -39,6 +41,14 @@ What's not (yet) implemented:
39
41
In cases when a cell can be rotated (`GridMap`), the algorithm treats each combination of tile type and rotation as a separate tile type.
40
42
So, you have to specify possible adjacent tiles for all rotations of each tile (in fact, just few are enough - the algorithm is able to infer other combinations automatically in most cases).
41
43
44
+
## Installing
45
+
46
+
This addon is [available in Godot Asset Library](https://godotengine.org/asset-library/asset/1951) and thus can be installed using editor's built-in addon manager.
47
+
Alternatievely, you can download an archive from [releases page](https://github.com/AlexeyBond/godot-constraint-solving/releases) or from current branch.
48
+
49
+
**Important:** in order to make `WFC2DGenerator` node available, you should enable the plugin in project settings after adding addon files to the project:
50
+

51
+
42
52
## How to use
43
53
44
54
### WFC2DGenerator node
@@ -73,6 +83,17 @@ It may make sense to create and keep a minimal scene with generator, sample map
73
83
74
84
If some of tile combinations produced by generator don't look good - try adding a negative samples map and place those combinations there.
75
85
86
+
### Preconditions
87
+
88
+
By default the generator will read exsting tiles from a map node it generates content for and will place other tiles to make them fit with existing ones.
89
+
This behavior makes it possible to combine WFC with other procedural generation algorithms (or manually pre-made level pieces): the previous algorithm may place some tiles and let WFC fill the remaining space.
90
+
However, this way it is only possible to specify the exact tile that should be placed in specific cell.
91
+
The preconditions API allows to limit possible cell contents in a more flexible way - by defining a set of tiles allowed in given cell.
92
+
93
+
The addon includes a [precondition](addons/wfc/problems/2d/preconditions/precondition_2d_dungeon.gd) ([example](addons/wfc/examples/demo_wfc_2d_tilemap_dungeon.tscn)) that generates a random set of connected road cells surrounded by wall cells a.k.a. a "dungeon".
94
+
The user can configure which tiles are "roads" and which are "walls" using custom data layers (in case of `TileMap`s) or metadata (in case of `GridMap`s) of the tiles.
95
+
It isn't likely to fit specific needs of any actual game but it may serve as an example and/or starting point.
96
+
76
97
### Advanced use
77
98
78
99
`WFC2DGenerator` node is a high-level convenient wrapper for lower-level components.
0 commit comments