blob: 09e28634cdae727c91994fe0f0aea603debf6a69 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
### Wave Function Collapse
This an implementation of very primitive tile-based wave function collapse.
It uses tiles to generate an image, similar to this:
![Demo 0 of the program](../plain/demo/demo0.png) ![Demo 1 of the program](../plain/demo/demo1.png)
There is a script to download a couple of tilesets
that are copied from [mxgmn's repository](https://github.com/mxgmn/WaveFunctionCollapse)
### Build
To build use `./build.sh`
To build and run use `./build.sh run`
To clean use `./build.sh clean`
To download the tilesets use `./download-tilesets.sh`
Two files will be build in the bin directory,
`bin/gen_tiles` and `bin/wfc`
I don't want to use Makefile, because I don't like it,
and the project is not too big, so a shell script is enough.
### How it works
Firstly `bin/wfc -h` can be used for some info on program arguments
The main program `bin/wfc` uses the tiles in `files/tiles`, which are ppm files.
There is a file called `tiles.dat` in the same directory that holds information about the tiles, and it enables `bin/wfc` to generate the tile rotations
The `bin/gen_tiles` generates the `tiles.dat` file and copies the required tiles from the tileset
There is a file called `config.h` under the src directory which is used to specify things about
`tiles.dat` and basically configuring `bin/gen_tiles`. More info in the file as comments.
### Limitations
1. One the connection are saved, and no other tile data, so the circuit tileset
doesn't really work
2. Only tile based wave function collapse, I dont understand the other more complex one
### References
[Mxgmn's Wave Function Collapse README](https://github.com/mxgmn/WaveFunctionCollapse)
|