Skip to content

Commit c5bd576

Browse files
committed
Update readme; Restore simple tilemap example;
1 parent c85535e commit c5bd576

File tree

6 files changed

+113
-42
lines changed

6 files changed

+113
-42
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ What's not (yet) implemented:
3030
- Wrapping.
3131
- Tile probabilities.
3232
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.
3335
- Rules editor.
3436
Currently it's possible to "learn" WFC rules in running game only, not in editor.
3537
Rules can be edited by modifying sample maps, using standard editor tools.
@@ -39,6 +41,14 @@ What's not (yet) implemented:
3941
In cases when a cell can be rotated (`GridMap`), the algorithm treats each combination of tile type and rotation as a separate tile type.
4042
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).
4143

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+
![Screenshot of project settings dialog with plugin enabled](screenshots/enable_plugin.png)
51+
4252
## How to use
4353

4454
### WFC2DGenerator node
@@ -73,6 +83,17 @@ It may make sense to create and keep a minimal scene with generator, sample map
7383

7484
If some of tile combinations produced by generator don't look good - try adding a negative samples map and place those combinations there.
7585

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+
7697
### Advanced use
7798

7899
`WFC2DGenerator` node is a high-level convenient wrapper for lower-level components.
Binary file not shown.

addons/wfc/examples/demo_wfc_2d_gridmap.tscn

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ start_on_ready = true
8787
render_intermediate_results = true
8888
8989
[node name="Node3D" type="Node3D" parent="."]
90-
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)
9190
9291
[node name="Camera3D" type="Camera3D" parent="Node3D"]
9392
transform = Transform3D(1, 0, 0, 0, 0.714082, 0.700062, 0, -0.700062, 0.714082, 0, 16.1111, 23.1593)

0 commit comments

Comments
 (0)