Git Product home page Git Product logo

wavefunctioncollapse's Introduction

WaveFunctionCollapse

This program generates bitmaps that are locally similar to the input bitmap.

main collage

main gif

Local similarity means that

  • (C1) The output should contain only those NxN patterns of pixels that are present in the input.
  • (Weak C2) Distribution of NxN patterns in the input should be similar to the distribution of NxN patterns over a sufficiently large number of outputs. In other words, probability to meet a particular pattern in the output should be close to the density of such patterns in the input.

In the examples a typical value of N is 3.

local similarity

WFC initializes output bitmap in a completely unobserved state, where each pixel value is in superposition of colors of the input bitmap (so if the input was black & white then the unobserved states are shown in different shades of grey). The coefficients in these superpositions are real numbers, not complex numbers, so it doesn't do the actual quantum mechanics, but it was inspired by QM. Then the program goes into the observation-propagation cycle:

  • On each observation step an NxN region is chosen among the unobserved which has the lowest Shannon entropy. This region's state then collapses into a definite state according to its coefficients and the distribution of NxN patterns in the input.
  • On each propagation step new information gained from the collapse on the previous step propagates through the output.

On each step the number of non-zero coefficients decreases and in the end we have a completely observed state, the wave function has collapsed.

It may happen that during propagation all the coefficients for a certain pixel become zero. That means that the algorithm has run into a contradiction and can not continue. The problem of determining whether a certain bitmap allows other nontrivial bitmaps satisfying condition (C1) is NP-hard, so it's impossible to create a fast solution that always finishes. In practice, however, the algorithm runs into contradictions surprisingly rarely.

Wave Function Collapse algorithm has been implemented in C++, Python, Kotlin, Rust, Julia, Go, Haxe, Java, Clojure, Free Pascal, p5js, JavaScript and adapted to Unity, Unreal Engine 5 and Houdini. You can build WFC from source, download an official release for Windows, download an interactive graphical version from itch.io or run it in the browser. WFC generates levels in Bad North, Caves of Qud, Dead Static Drive, Townscaper, Matrix Awakens, several smaller games and many prototypes. It led to new research. For more related work, explanations, interactive demos, guides, tutorials and examples see the ports, forks and spinoffs section.

Watch a video demonstration of WFC algorithm on YouTube: https://youtu.be/DOQTr2Xmlz0

Algorithm

  1. Read the input bitmap and count NxN patterns.
    1. (optional) Augment pattern data with rotations and reflections.
  2. Create an array with the dimensions of the output (called "wave" in the source). Each element of this array represents a state of an NxN region in the output. A state of an NxN region is a superposition of NxN patterns of the input with boolean coefficients (so a state of a pixel in the output is a superposition of input colors with real coefficients). False coefficient means that the corresponding pattern is forbidden, true coefficient means that the corresponding pattern is not yet forbidden.
  3. Initialize the wave in the completely unobserved state, i.e. with all the boolean coefficients being true.
  4. Repeat the following steps:
    1. Observation:
      1. Find a wave element with the minimal nonzero entropy. If there is no such elements (if all elements have zero or undefined entropy) then break the cycle (4) and go to step (5).
      2. Collapse this element into a definite state according to its coefficients and the distribution of NxN patterns in the input.
    2. Propagation: propagate information gained on the previous observation step.
  5. By now all the wave elements are either in a completely observed state (all the coefficients except one being zero) or in the contradictory state (all the coefficients being zero). In the first case return the output. In the second case finish the work without returning anything.

Tilemap generation

The simplest nontrivial case of the algorithm is when NxN=1x2 (well, NxM). If we simplify it even further by storing not the probabilities of pairs of colors but the probabilities of colors themselves, we get what we call a "simple tiled model". The propagation phase in this model is just adjacency constraint propagation. It's convenient to initialize the simple tiled model with a list of tiles and their adjacency data (adjacency data can be viewed as a large set of very small samples) rather than a sample bitmap.

Lists of all the possible pairs of adjacent tiles in practical tilesets can be quite long, so I implemented a symmetry system for tiles to shorten the enumeration. In this system each tile should be assigned with its symmetry type.

symmetries

Note that the tiles have the same symmetry type as their assigned letters (or, in other words, actions of the dihedral group D4 are isomorphic for tiles and their corresponding letters). With this system it's enough to enumerate pairs of adjacent tiles only up to symmetry, which makes lists of adjacencies for tilesets with many symmetrical tiles (even the summer tileset, despite drawings not being symmetrical the system considers such tiles to be symmetrical) several times shorter.

knots tiled rooms circuit 1 circuit 2 circles castle summer 1 summer 2

Note that the unrestrained knot tileset (with all 5 tiles being allowed) is not interesting for WFC, because you can't run into a situation where you can't place a tile. We call tilesets with this property "easy". Without special heuristics easy tilesets don't produce interesting global arrangements, because correlations of tiles in easy tilesets quickly fall off with a distance. Many easy tilesets can be found on Guy Walker's website. Consider the "Dual" 2-edge tileset there. How can it generate knots (without t-junctions, not easy) while being easy? The answer is, it can only generate a narrow class of knots, it can't produce an arbitrary knot.

Note also that Circuit, Summer and Rooms tilesets are non-Wang. That is, their adjacency data cannot be induced from edge labels. For example, in Circuit two Corners cannot be adjacent, yet they can be connected with a Connection tile, and diagonal tracks cannot change direction.

Higher dimensions

WFC algorithm in higher dimensions works completely the same way as in dimension 2, though performance becomes an issue. These voxel models were generated with N=2 overlapping tiled model using 5x5x5 and 5x5x2 blocks and additional heuristics (height, density, curvature, ...).

voxels

Higher resolution screenshots: 1, 2, 3.

MarkovJunior repository contains an implementation of the 3d simple tiled model with many tilesets and examples.

Constrained synthesis

WFC algorithm supports constraints. Therefore, it can be easily combined with other generative algorithms or with manual creation.

Here is WFC autocompleting a level started by a human:

ConvChain algorithm satisfies the strong version of the condition (C2): the limit distribution of NxN patterns in the outputs it is producing is exactly the same as the distributions of patterns in the input. However, ConvChain doesn't satisfy (C1): it often produces noticeable defects. It makes sense to run ConvChain first to get a well-sampled configuration and then run WFC to correct local defects. This is similar to a common strategy in optimization: first run a Monte-Carlo method to find a point close to a global optimum and then run a gradient descent from that point for greater accuracy.

P. F. Harrison's texture synthesis algorithm is significantly faster than WFC, but it has trouble with long correlations (for example, it's difficult for this algorithm to synthesize brick wall textures with correctly aligned bricks). But this is exactly where WFC shines, and Harrison's algorithm supports constraints. It makes sense first to generate a perfect brick wall blueprint with WFC and then run a constrained texture synthesis algorithm on that blueprint.

Comments

Why the minimal entropy heuristic? I noticed that when humans draw something they often follow the minimal entropy heuristic themselves. That's why the algorithm is so enjoyable to watch.

The overlapping model relates to the simple tiled model the same way higher order Markov chains relate to order one Markov chains.

WFC's propagation phase is very similar to the loopy belief propagation algorithm. In fact, I first programmed belief propagation, but then switched to constraint propagation with a saved stationary distribution, because BP is significantly slower without a massive parallelization (on a CPU) and didn't produce significantly better results in my problems.

Note that the "Simple Knot" and "Trick Knot" samples have 3 colors, not 2.

One of the dimensions can be time. In particular, d-dimensional WFC captures the behaviour of any (d-1)-dimensional cellular automata.

Used work

  1. Alexei A. Efros and Thomas K. Leung, Texture Synthesis by Non-parametric Sampling, 1999. WaveFunctionCollapse is a texture synthesis algorithm. Compared to the earlier texture synthesis algorithms, WFC guarantees that the output contains only those NxN patterns that are present in the input. This makes WFC perfect for level generation in games and pixel art, and less suited for large full-color textures.
  2. Paul C. Merrell, Model Synthesis, 2009. Merrell derives adjacency constraints between tiles from an example model and generates a new larger model with the AC-3 algorithm. We generalize his approach to work with NxN overlapping patterns of tiles instead of individual tiles. This allows to use a single image as the input to the algorithm. By varying N, we can make the output look more like the input or less. We introduce the lowest entropy heuristic that removes the directional bias in generated results, is defined for irregular grids and is better suited for pre-constrained problems. We implement a tile symmetry system to reduce the sizes of inputs. We visualize partially observed states, either with color averaging or per-voxel voting. Merrell also introduced a method of incrementally modifying the model in parts to reduce the failure rate (which we don't use here). Recently the author created a page for model synthesis and published code.
  3. Alan K. Mackworth, Consistency in Networks of Relations, 1977. WFC translates a texture synthesis problem into a constraint satisfaction problem. Currently it uses the AC-4 algorithm by Roger Mohr and Thomas C. Henderson, 1986.
  4. Paul F. Harrison, Image Texture Tools, 2005. WFC was also influenced by the declarative texture synthesis chapter of Paul Harrison's dissertation. The author defines adjacency data of tiles by labeling their borders and uses backtracking search to fill the tilemap. A demonstration of the algorithm is available on the web.

How to build

WFC is a console application that depends only on the standard library. Get .NET Core for Windows, Linux or macOS and run

dotnet run --configuration Release WaveFunctionCollapse.csproj

Generated results are saved into the output folder. Edit samples.xml to change model parameters.

Alternatively, use build instructions from the community for various platforms from the relevant issue. Casey Marshall made a pull request that makes using the program with the command line more convenient and includes snap packaging.

Notable ports, forks and spinoffs

Credits

Circles tileset is taken from Mario Klingemann. FloorPlan tileset is taken from Lingdong Huang. Summer tiles were drawn by Hermann Hillmann. Cat overlapping sample is taken from the Nyan Cat video, Water + Forest + Mountains samples are taken from Ultima IV, 3Bricks sample is taken from Dungeon Crawl Stone Soup, Qud sample was made by Brian Bucklew, MagicOffice + Spirals samples - by rid5x, ColoredCity + Link + Link 2 + Mazelike + RedDot + SmileCity samples - by Arvi Teikari, Wall sample - by Arcaniax, NotKnot + Sand + Wrinkles samples - by Krystian Samp, Circle sample - by Noah Buddy. The rest of the examples and tilesets were made by me. Idea of generating integrated circuits was suggested to me by Moonasaur and their style was taken from Zachtronics' Ruckingenur II. Voxel models were rendered in MagicaVoxel.

second collage

voxel perspective

wavefunctioncollapse's People

Contributors

action-script avatar ashleyvargas avatar bfontaine avatar chrisfcarroll avatar cocoademon avatar cookingsource avatar grovre avatar j-roskopf avatar kchapelier avatar krychu avatar lamelizard avatar mxgmn avatar nanodeath avatar nornagon avatar pascalcorpsman avatar roberthoenig avatar vplesko avatar wandmalfarbe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wavefunctioncollapse's Issues

3Bricks.bmp is (slightly) corrupt (?)

3Bricks.bmp opens fine in C# (Windows, CLR), opens fine in my editor (Paint.NET), but crashes and burns in Java:

Exception in thread "main" java.lang.RuntimeException: Failed while trying to read 3Bricks.bmp!
    at com.technicallyvalid.kollapse.Main.runOverlappingModel(Main.kt:74)
    at com.technicallyvalid.kollapse.Main.main(Main.kt:30)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
Caused by: java.lang.IndexOutOfBoundsException: off < 0 || len < 0 || off + len > b.length!
    at javax.imageio.stream.ImageInputStreamImpl.readFully(ImageInputStreamImpl.java:346)
    at com.sun.imageio.plugins.bmp.BMPImageReader.read8Bit(BMPImageReader.java:1160)
    at com.sun.imageio.plugins.bmp.BMPImageReader.read(BMPImageReader.java:923)
    at javax.imageio.ImageIO.read(ImageIO.java:1448)
    at javax.imageio.ImageIO.read(ImageIO.java:1308)
    at com.technicallyvalid.kollapse.Main.runOverlappingModel(Main.kt:72)
    ... 6 more

Might be a damaged header or something. In any case, it'd be nice if someone could open and re-save 3Bricks.bmp in a trusted editor.

Entropy Calculation

I'm trying to make sense of the entropy calculation. Line 61 in Model.cs has:
startingEntropy = Math.Log(sumOfWeights) - sumOfWeightLogWeights / sumOfWeights;

and the readme says this is the Shanon Entropy, which should be -sumOfWeightLogWeights with log base 2, though the choice of log base doesn't change the result of the algorithm. I understand that the weights won't sum to 1 once tiles begin to be excluded.

To account for the weights not summing to 1, you'd just need to normalize the distribution by dividing each weight by sumOfWeights, right? So that would be:
entropy = -sum(Math.Log(weight[i] / sumOfWeights) * weight[i] / sumOfWeights)

but I don't see how this is equivalent to line 61. What are the steps I'm missing to go from this to line 61?

Deadlock when collapsing

This is not directly related to this particular implementation of WFC but more of a theoretical and a general problem. Recently I started developing my own implementation of WFC that operates on an unbounded output and tolerates contradictions (algorithm does not stop at a contradiction but instead provides contradictions as part of the solution). While my algorithm is generally working as expected and I am happy with its results, there are certain edge cases where the Shannon entropy heuristic causes a valid non-controversial deadlock to happen (see gliders in Conway's Game of Life). It is not a contradiction but the output is garbage for all practical purposes because the distribution of tiles in the output does not reflect the distribution of the respective tiles in the input at all. You can imagine two lines of certain tiles extending themselves into infinity as they mutually enforce each other. A typical oscillation loop.

Please help me brainstorm for ideas how to overcome this artifact. If I don't get any better ideas then I'm going to deal with this as oscillations are typically dealt with in engineering --- by adding random noise. I would make sure that the output is randomly observed a small distance away from the area that is currently being processed according to the Shannon entropy heuristic. As a result the whole output is scattered with occasional single observations, which would act as an obstacle to the Shannon entropy heuristic. I'm in a situation where a contradiction is the lesser evil than the deadlock.

Usage in a Game

Hi,

I'm interested in using your project in a game called Magical Life. Is there a Nuget package of your project, or some way I can incorporate it into my game? Does your project's license allow for usage in a game?

Thanks,
SneakyTactician

How to implement the autocompletion of the user input?

Hello, awesome work on this algorithm. Really cool stuff.

I'm still reading the code and getting a grip on what's happening, so I don't understand every part of the code yet. But in the readme you give an example of a human started level completed by the algorithm. So I tried to implement that.

I tried manually creating a wave that has only one coefficient set to true on the tiles that I draw, with the rest set to false. I then set that as the wave in the simple tiled model. But this approach doesn't work as the algorithm always fails after about 19 iterations (using the Castle example). (Basically as soon as the propagation reaches the user defined tiles, the result is unsuccessful).

Could you explain how did you do the autocompletion?

Unit tests

It would be a good idea to have some unit tests on this code. Ensure that given an input and some seed, it does a pixel-by-pixel comparison of that output with an expected output image. Would make changes much safer. (I have a few examples in Kollapse, if that helps any).

Generate from a pre-defined output image

Hi,

I'm trying to implement a way to give the algorithm a pre-defined output image containing fixed (already put in place) tiles (in overlap mode).

I do not understand the code very well but I have some ideas.

So on this line the output image is created:

bitmap[x + y * MX] = colors[patterns[observed[x - dx + (y - dy) * MX]][dx + dy * N]];

Is it possible to fill the observed array with our pre-defined image (before running the algorithm)?
What does the array observed do?
Another option would be to put it in inside the init or observer function.

EDIT:

My use-case is specifying an output image where the border is filled with "water" so that you can guarantee that the algorithm always generates "islands". Same goes with "rooms".

Implementation in C

Hi Maxim,

This is not an issue to your repo, but I do not have Twitter, and so no other way to contact you.

We are a group of first years from Imperial College London. Strongly inspired by your repo, we have made a simple implementation of WFC in C. If you are interested please have a look:

https://github.com/ic-pcg/waveFunctionCollapse

Thank you for your amazing repo, it was most helpful!

Support JSON Config Files (like the C++ ver.)

Someone moving to the C++ version (for speed, perhaps) shouldn't have to port their config files to the format supported by that version.

JSON support is currently beeing implemented for that version (Issue/Discussion) and I'll implement it here as well so that there's some common ground between the 2 versions. We've currently agreed to this or (this, fomatted differently) format. Any objections?

Java implementation

I see a Kotlin implementation but it would be nice to have a pure Java implementation.

Reuse parts of outcome as constraints, and still obtain the same outcome?

Screen Shot 2020-06-21 at 13 05 36

Screen Shot 2020-06-21 at 13 05 42

WFC allows us to set some initial constraints to limit outcomes.

One thing I would like to do, is to use parts of an outcome as constraint, then generate again.

The only problem is, given the same seed and parts of its outcome as constraints, I cannot obtain the same outcome again, because observation order is now different (initial entropy are different).

Can I satisfy this requirement without modifying WFC's underlying algorithm? I think I just need a smart way to do weighted randomization at observation step?

(This is assuming the random input is order-independent, for example, if we use a seeded hash function instead of random number generator.)

Neighbor constraints do not always appear to be enforced

Not sure if I'm just doing something wrong here but I tried running the algorithm today on a dummy tileset I made and got some results I wasn't expecting. I've uploaded a zip file with what I was using here: Base.zip

I modified samples.xml with this entry:

<simpletiled name="Base" width="3" height="3"/>

I also had to modify the for loop in Main.cs to let me run the algorithm 10,000 times as there seemed to be a lot of contradictions. One of the results I got looked like this:
image

I don't understand how I got this though, as there are no neighbor constraints that include base_corner_1 on both the left and the right.

Return value of Propagate

Hi!

Thank you for the algorithm and the code! I was translating the code to C++ and everything makes sense to me except this line:

return sumsOfOnes[0] > 0;

Why are we only interested in the number of remaining tiles for the node 0 for the return value of Propagate?

As far as I understand, as soon as the number of remaining tiles for a node (not only the node 0) reaches zero, the algorithm should fail.

I think we can do this check after each call to Ban in Propagate. Or in NextUnobservedNode and we return a special value (e.g. -2) in this case.

Best regards,
Pierre

How to generate an XML data file for simpletiled from an image file?

Hello:
I saw this repo, it looks great. However, when I tried to use the repo to generate some images, I have some issues. I have a simple Captcha image: ABCYQ.PNG.
I want to use it for overlapping, so I put this line in Samples.xml:
<samples> <overlapping name="ABCYQ" N="3" symmetry="2" size="30" periodic="True" limit="5"/> </samples>
But for my PC with 16-core CPU, I didn’t get any results after more than one hour.
Then, I would like to try with simpletiled, so in the Samples.xml, I added this line:
<samples> <simpletiled name="ABCYQ" size="10" periodic="False" limit="25"/> </samples>
But I got run time error:
There is no corresponding data XML file for the image.
I looked at the data XML file for circle image, and I found the circle has been split into 8 parts, the data XML list all each part, and all its neighbor’s part, and subsets parts.
I want to know if there is any helper program, which I can use to split the image like the circle image, and generate all parts like in circle data XML file.
In the above case, I want to get a data XML file which contains 5 distinct parts: as: ‘A’, ‘B’, ‘C’, ‘Y’, ‘Q’. As ‘A’ being the left most one, ‘B’ being second part, which ‘A’ is on the left, ‘C’ on the right, etc…
For more general item, can I get a split program, which can divided any image into 4 equal size parts, as left upper, right upper, left bottom, right bottom.
This way, it will be much easier to run the program, otherwise, for every image, have to create a data XML file by hand, then using simpletiled seems to be impossible, using overlapping is too much time consuming.
Please advise,
Thanks
ABCYQ
,

Infinite loop in OverlappingModel constructor

WaveFunctionCollapse version tested: 1cf308c (HEAD of master as of this writing)

When I run the program with a specific setting and image, I get an infinite loop on line 85 of OverlappingModel.cs in the constructor:

while (residue >= power)
{
    residue -= power;
    count++;
}

This loop appears to be doing a combination division and modulo of "residue / power". When I replace it with a division and modulo, I get a division by zero error -- IE, 'power' becomes zero.

To reproduce this bug, replace the contents of samples.xml with:

<samples>
    <overlapping name="Office4" N="5" periodic="True"/>
</samples>

And add the following png image to your 'samples' folder:

office4

It's possible that this image is simply an invalid input for the parameters given. Maybe there can never be a valid output for this image when N = 5 and periodic = true. If this is the case, I would expect an exception, or maybe an early return with some "invalid state" flag set, or some sort of detectable/recoverable error. If it is a valid input, then obviously I expect a valid constructed object.

Can't run it on Mac OS

I am trying to run it on Mac OS (10.13). I've downloaded the dotnet and installed it as indicated on the main page of this package. I then run with

% ./dotnet run ~/Desktop/WaveFunctionCollapse-master/WaveFunctionCollapse.csproj --project ~/Desktop/WaveFunctionCollapse-master/

and I see:

It was not possible to find any compatible framework version
The framework 'Microsoft.NETCore.App', version '2.1.0' was not found.

  • The following frameworks were found:
    3.1.3 at [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

You can resolve the problem by installing the specified framework and/or SDK.

The specified framework can be found at:

but that URL lists only Windows and Linux versions. How is the Mac version of dotnet supposed to run this if it needs something that doesn't exist for Mac? Apologies, I know nothing about the dotnet world... Am a biologist with background in C and Unix from many years back... What am I doing wrong?

No option for tile with no symmetry

Hi,

I'm trying to add a tile to my tileset that does not have symmetry. Here is the tile:

diagonal2straight

I believe that this tile has none of the symmetry types (X, I, L, etc). Please correct me if I am wrong! However, I cannot seem to define this in the data.xml file; In fact, is it true that because of this line:

char sym = xtile.Get("symmetry", 'X');

There is not currently an option for a tile with no symmetry?
Thanks!

Unreadable

Hello,

The source code is seriously unreadable:

  • indentation is plain weird, not to say totally wrong
  • variable names are meant to be useful for the reader. They should represent something, and their name should clearly tell what. "a" and "b" are not useful to anyone. They could have been if some documentation shows a formula including a and b, but...
  • no commentary. No documentation, and the code is far for self documenting
  • no build instructions. What am I meant to do with? What are the dependencies? etc etc

Those point are seriously hindering the amazing work that this algorithm is. No one is able to understand such code. It's even hard to make use of it.

I can help with formatting, but not refactoring since I obviously can't understand what's going on.

I tried to solve the problem with constraints, but there are too many failures. Is this normal?

Hello!
Thanks for great algorithm, I saw this stuff on reddit and following until nowadays.
Recently, I tried your algorithm with fast-wfc (but you added this with your repo too), and I found this is very fast but also memory-consuming. For make bigger map, I got out-of-memory error.
So I tried make many maps like grid, and patch them together. So I tried to solve the problem with constraints (predefined patterns with up and left line) with same model, but there were too many failures. It succeeds at all.
So my question is, is this normal? I wonder if you have a lot of failures under these constraints. Thanks for advance!

(For reference, number of patterns of my data is around 8,000)

What is the best way to enforce some tiles (simple tiled model) to not be rotated?

Hi!

I am trying to generate a picture where some tiles may only be in the original rotation. But I still want to be able to define adjecency relations on all 4 sides of those tiles? How is this possible?

When using Symmety "X", it won't rotate, but then I can't define which tiles are allowed to be below or above (I think?).

Is there a way to do this?
Are there any workarounds?
What would need to be modified in the code for this to work? I might do it, if it is feasable!

Thank you in advance!

Bug: For some examples, model.Run() returns true when false is expected

WaveFunctionCollapse version tested: commit 333f592 (HEAD as of this writing)

In Main.cs, on line 40, we check to see if the model has found a solution with the given seed. If it has found a solution, we then save a bmp file of the solution. Thus, the expectation is that any bmp file saved via this program should be completely "collapsed".

For some examples, this is not the case, and bmp files are saved that are partially still in a "superposition" state. The only reason I can see for this is that model.run() is sometimes returning true even if it hasn't found a solution.

To reproduce this bug, delete every entry of samples.xml except one:

<samples>
    <simpletiled name="Summer" width="15" height="15" periodic="False" limit="15"/>
</samples>

And change line 38 of Main.cs from
int seed = random.Next();
to
int seed = 474849158;

Then run the program.

I expect to see one of two things: "CONTRADICTION" printed in the console with no bmp file created, or "DONE" printed in the console with a fully-collapsed BMP file created.

Instead, "DONE" is printed and a partially-resolved BMP file is created.

LICENSE file

Please chose a license for the good of the open-source community (:

As it currently stand, albeit very nice, this tremendous amount of work cannot be incorporated into other research / products / etc. That's because in many countries, unlicensed work belongs by copyright laws to its original author.

Something like MIT would probably be ideal. Your name will be kept, but we'll all be able to use it for our own purposes.

Edit: I just noticed you put blocks within your sources, but a LICENSE file would still be better.

Cheers.

exception when running WFC-3D.exe

i am trying to create 3d models, voxelsize: 8
could that be more than the program expects to handle ?

D:\dev\wfc-3d-basic>WFC-3D.exe                                                                                          < Station                                                                                                                                                                                                                                       Unhandled Exception: System.ArgumentException: The output char buffer is too small to contain the decoded characters, encoding 'Unicode (UTF-8)' fallback 'System.Text.DecoderReplacementFallback'.                                             Parameter name: chars                                                                                                      at System.Text.Encoding.ThrowCharsOverflow()                                                                            at System.Text.Encoding.ThrowCharsOverflow(DecoderNLS decoder, Boolean nothingDecoded)                                  at System.Text.UTF8Encoding.GetChars(Byte* bytes, Int32 byteCount, Char* chars, Int32 charCount, DecoderNLS baseDecoder)                                                                                                                        at System.Text.DecoderNLS.GetChars(Byte* bytes, Int32 byteCount, Char* chars, Int32 charCount, Boolean flush)           at System.IO.BinaryReader.InternalReadChars(Char[] buffer, Int32 index, Int32 count)                                    at System.IO.BinaryReader.ReadChars(Int32 count)                                                                        at Stuff.ReadVox(BinaryReader stream)                                                                                   at Stuff.ReadVox(String filename)                                                                                       at Model..ctor(String name, String subsetName, Int32 FMX, Int32 FMY, Int32 FMZ, Boolean periodic, String groundName)    at Program.Main()  

Suggestion for a different name: Sudoku Collapse

I've noticed whenever someone tries to explain this algorithm, they compare it with the process of solving a sudoku puzzle, so maybe rename the project (and therefore the algorithm) to:
Sudoku + (WaveFunction) Collapse = SudokuCollapse, best of both worlds?
This way the phrase wouldn't collide with that which it is inspired by (#79) but would still reference it, and would include a reference to something that best explains how it works. What do you think?

Please comment the code!

Comments make reading and debugging the code much easier.

They are especially necessary if the code has one letter variable names!

Description of entropy

The description given in the readme about entropy seems off.

Experiments

Overall entropy

On each step the overall entropy decreases

Verification: in Model.cs inside the for loop of the method Run(), compute sum of entropies before Observe() and after Propagate(), and compare the values.

Result: sometimes the sum before is less than the sum after.

Comment: the overall entropy can increase after an observe-propagate step.

Node entropy

Note that the entropy of any node can't increase during the propagation phase

Verification: in Model.cs at the end of Ban(), compare the entropy before and after update (excluding NaN values, and optionally adding a boolean to test if propagation phase).

Result: sometimes the entropy before is less than the entropy after update.

Comment: the entropy of a node can increase during the propagation phase

Possibilities

possibilities are not arising, but can be canceled

This sounds more like some kind of cardinality rather than entropy.

Verification: in Model.cs in Init(), initialize startingEntropy with T, and in Ban() update entropies[i] with sumsOfOnes[i].

Result: The generated images are similar, only Skyline and Platformer look more uniform (visual inspection, and it depends on random seed).

Conclusion

The entropy formula used is not monotonic wrt individual weights, and doesn't measure the number of possibilities but the uniformity of the distribution. Adding a weight that is very small or very large compared to the existing weights can decrease the entropy, and consequently removing such a weight would increase the entropy.

If overlapping model is on 3D, empty pattern and whole pattern (pattern with full same voxels) dominates all.

Hello!
I'm trying 3D version of Overlapping Model, but I met this issue. In many cases, empty pattern (with no voxel) and whole pattern (with full same voxels) dominates all. I cut off the weights to 1, but I thought this is not the best answer. Because almost every building or object has empty pattern and full pattern. So it's natural, but hard to get naturalness.
So did you tried any density function for stationary on Overlapping Model on 3D?

Non-deterministic enumeration of weights in OverlappingModel

While porting this over to Kotlin (whee), I discovered what I think is the root cause of my troubles: when populating the patterns and stationary arrays in OverlappingModel, the keys of weight are iterated over. The order of this enumeration is non-deterministic, and the patterns and stationary can vary significantly based on the ordering.

For purposes of enumeration, each item in the dictionary is treated as a KeyValuePair<TKey, TValue> structure representing a value and its key. The order in which the items are returned is undefined.
https://msdn.microsoft.com/en-us/library/xfhwa508(v=vs.110).aspx

The affected code is here:

        foreach (int w in weights.Keys)
        {
            patterns[counter] = patternFromIndex(w);
            stationary[counter] = weights[w];
            counter++;
        }

Building Simple Tiled .xml

Hi, not really an issue, but are we intended to build our own data.xml files (similar to the summer tileset) manually? Or is there a way to infer this from an existing level design? I currently have a fairly large tileset that I'm trying to map out, and I can't help but feel like I'm definitely making mistakes while trying to do this manually.

[not an issue] using this algorithm in a game engine plug-in

Good day,

I added this algorithm, using the implementation fast-wfc from Mathieu Fehr and Nathanaël Courant, as a plug-in to be used with Adventure Game Studio:

https://github.com/ericoporto/agsfastwfc

example_demo_game (1)

I haven't added full API yet because I got into some other stuff, but wanted to say thanks on creating this algorithm because I think it will be very useful to procedurally generate content in games. I talked with Mathieu about and he told me maybe you would like to be notified about it too :)

You can close this.

How to run / develop this project

For anyone curious (on a mac):

Run:

$ brew install mono (if you don't have it)
WaveFunctionCollapse $ mcs -pkg:dotnet /reference:System.Drawing.dll *.cs
WaveFunctionCollapse $ mono Main.exe

(it starts working your CPU)

🌻

two mistake of OverlappingModel.cs file

1.var bitmap = new Bitmap($"sample/{name}.png"); have a mistake,I use vs2017 build program then visual studio tell me no context on this file of "name".

2.file path only use absolute address

Unhandled Exception: System.Exception: 0.0001 is not a valid value for Single

On Fedora 24, Mono JIT compiler version 4.2.4.

WaveFunctionCollapse git:(master) ✗ mono Main.exe 
< Chess
> DONE
> DONE
< Chess
> CONTRADICTION
> CONTRADICTION
> CONTRADICTION
> CONTRADICTION
> CONTRADICTION
> CONTRADICTION
> CONTRADICTION
> CONTRADICTION
> CONTRADICTION
> CONTRADICTION
< City
> DONE
> DONE
< Flowers
> DONE
> DONE
< Hogs
> DONE
> DONE
< Hogs
> DONE
> CONTRADICTION
> CONTRADICTION
> CONTRADICTION
> DONE
< Knot
> DONE
> DONE
< Less Rooms
> DONE
> DONE
< Mountains
> DONE
> DONE
< Office
> DONE
> DONE
< Paths
> DONE
> DONE
< Platformer
> DONE
> DONE
< Platformer
> DONE
> DONE
< Red Maze
> DONE
> DONE
< Rooms
> DONE
> DONE
> DONE
< Rule 126
> DONE
> DONE
< Simple Knot
> DONE
> DONE
< Simple Maze
> DONE
> DONE
< Simple Wall
> DONE
> DONE
< Simple Wall
> DONE
> DONE
< Simple Wall
> DONE
> DONE
< Simple Wall
> DONE
> DONE
< Trick Knot
> DONE
> DONE
< Village
> DONE
> DONE
< Water
> DONE
> DONE
< Summer

Unhandled Exception:
System.Exception: 0.0001 is not a valid value for Single. ---> System.FormatException: Input string was not in a correct format.
  at System.Number.ParseSingle (System.String value, NumberStyles options, System.Globalization.NumberFormatInfo numfmt) <0x413eb590 + 0x00183> in <filename unknown>:0 
  at System.Single.Parse (System.String s, NumberStyles style, System.Globalization.NumberFormatInfo info) <0x413eb550 + 0x00017> in <filename unknown>:0 
  at System.Single.Parse (System.String s, NumberStyles style, IFormatProvider provider) <0x413eb440 + 0x0003b> in <filename unknown>:0 
  at System.ComponentModel.SingleConverter.FromString (System.String value, System.Globalization.NumberFormatInfo formatInfo) <0x413eb3d0 + 0x0001f> in <filename unknown>:0 
  at System.ComponentModel.BaseNumberConverter.ConvertFrom (ITypeDescriptorContext context, System.Globalization.CultureInfo culture, System.Object value) <0x413d5060 + 0x00259> in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at System.ComponentModel.BaseNumberConverter.ConvertFrom (ITypeDescriptorContext context, System.Globalization.CultureInfo culture, System.Object value) <0x413d5060 + 0x0028b> in <filename unknown>:0 
  at System.ComponentModel.TypeConverter.ConvertFromString (System.String text) <0x413cc070 + 0x00021> in <filename unknown>:0 
  at Stuff.Get[T] (System.Xml.XmlNode node, System.String attribute, T defaultT) <0x413eac30 + 0x000b7> in <filename unknown>:0 
  at SimpleTiledModel..ctor (System.String name, System.String subsetName, Int32 width, Int32 height, Boolean periodic, Boolean black) <0x413e7000 + 0x01827> in <filename unknown>:0 
  at Program.Main () <0x4135ee30 + 0x003fb> in <filename unknown>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.Exception: 0.0001 is not a valid value for Single. ---> System.FormatException: Input string was not in a correct format.
  at System.Number.ParseSingle (System.String value, NumberStyles options, System.Globalization.NumberFormatInfo numfmt) <0x413eb590 + 0x00183> in <filename unknown>:0 
  at System.Single.Parse (System.String s, NumberStyles style, System.Globalization.NumberFormatInfo info) <0x413eb550 + 0x00017> in <filename unknown>:0 
  at System.Single.Parse (System.String s, NumberStyles style, IFormatProvider provider) <0x413eb440 + 0x0003b> in <filename unknown>:0 
  at System.ComponentModel.SingleConverter.FromString (System.String value, System.Globalization.NumberFormatInfo formatInfo) <0x413eb3d0 + 0x0001f> in <filename unknown>:0 
  at System.ComponentModel.BaseNumberConverter.ConvertFrom (ITypeDescriptorContext context, System.Globalization.CultureInfo culture, System.Object value) <0x413d5060 + 0x00259> in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at System.ComponentModel.BaseNumberConverter.ConvertFrom (ITypeDescriptorContext context, System.Globalization.CultureInfo culture, System.Object value) <0x413d5060 + 0x0028b> in <filename unknown>:0 
  at System.ComponentModel.TypeConverter.ConvertFromString (System.String text) <0x413cc070 + 0x00021> in <filename unknown>:0 
  at Stuff.Get[T] (System.Xml.XmlNode node, System.String attribute, T defaultT) <0x413eac30 + 0x000b7> in <filename unknown>:0 
  at SimpleTiledModel..ctor (System.String name, System.String subsetName, Int32 width, Int32 height, Boolean periodic, Boolean black) <0x413e7000 + 0x01827> in <filename unknown>:0 
  at Program.Main () <0x4135ee30 + 0x003fb> in <filename unknown>:0 

"Summer" Tileset Origin

I couldn't find the authors of the summer tileset and will be grateful for information about them.

The tileset you call "Summer" was created by Hermann Hillmann and distributed on sites popular with hobby game developers 10+ years ago. I'm not sure what the official source is any more or how to contact the author; all the old links I knew to it seem to have been taken offline.

Here's an archive.org copy of the VBExplorer site crediting Hermann Hillmann. It has the ~2MB download including winter tiles as well. It says:

Game Tile Set #1 Excellent free game tile set by Hermann Hillmann(2MB). These and more tiles are included in the Character Pack

Code cleanup suggestion

Hi. It will be good if you divide away the I/O part from actual logic part so we can actually extract whatever we need. I also suggest thinking about adding a C++ implementation. Also i'm getting too much contradictions if I specify high image sizes for some samples.

No flag found

For the competition PACTF, there is a question about a programmer cutting off a branch of a github repository. The files given in the problem are the same files in this repository except for the fact that this repository has the gitignore and gitattributes files. Is there a link to the ctf here? If there is, then where is the flag

Cannot compile on MacOS

Hey, I'm running into some issues compiling this using mcs on MacOS High Sierra. Specifically, here's my terminal output after running
mcs -pkg:dotnet /reference:System.Drawing.dll *.cs and installing mono using brew. I'm not at all familiar with C# or .NET, so any guidance with this would be appreciated ... it definitely looks like a versioning issue.

Here's my mono version:

Mono JIT compiler version 5.10.1.47 (2017-12/8eb8f7d5e74 Fri Apr 13 20:18:12 EDT 2018)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
	TLS:           normal
	SIGSEGV:       altstack
	Notification:  kqueue
	Architecture:  amd64
	Disabled:      none
	Misc:          softdebug 
	Interpreter:   yes
	LLVM:          yes(3.6.0svn-mono-master/8b1520c8aae)
	GC:            sgen (concurrent by default)

And here's my output:

OverlappingModel.cs(50,17): error CS1525: Unexpected symbol `(', expecting `,', `;', or `='
OverlappingModel.cs(50,28): error CS1525: Unexpected symbol `int', expecting `,', `;', or `='
OverlappingModel.cs(50,33): error CS1525: Unexpected symbol `byte', expecting `,', `;', or `='
OverlappingModel.cs(55,4): error CS1519: Unexpected symbol `;' in class, struct, or interface member declaration
OverlappingModel.cs(70,4): error CS1519: Unexpected symbol `;' in class, struct, or interface member declaration
OverlappingModel.cs(92,4): error CS1519: Unexpected symbol `;' in class, struct, or interface member declaration
OverlappingModel.cs(97,5): error CS1519: Unexpected symbol `for' in class, struct, or interface member declaration
OverlappingModel.cs(97,14): error CS1519: Unexpected symbol `=' in class, struct, or interface member declaration
OverlappingModel.cs(97,21): error CS1519: Unexpected symbol `<' in class, struct, or interface member declaration
OverlappingModel.cs(97,44): error CS1519: Unexpected symbol `:' in class, struct, or interface member declaration
OverlappingModel.cs(97,50): error CS1519: Unexpected symbol `-' in class, struct, or interface member declaration
OverlappingModel.cs(97,54): error CS1519: Unexpected symbol `+' in class, struct, or interface member declaration
OverlappingModel.cs(97,62): error CS1519: Unexpected symbol `++' in class, struct, or interface member declaration
OverlappingModel.cs(97,76): error CS1519: Unexpected symbol `=' in class, struct, or interface member declaration
OverlappingModel.cs(97,83): error CS1519: Unexpected symbol `<' in class, struct, or interface member declaration
OverlappingModel.cs(97,106): error CS1519: Unexpected symbol `:' in class, struct, or interface member declaration
OverlappingModel.cs(97,112): error CS1519: Unexpected symbol `-' in class, struct, or interface member declaration
OverlappingModel.cs(97,116): error CS1519: Unexpected symbol `+' in class, struct, or interface member declaration
OverlappingModel.cs(97,124): error CS1519: Unexpected symbol `++' in class, struct, or interface member declaration
OverlappingModel.cs(98,4): error CS9010: Primary constructor body is not allowed
OverlappingModel.cs(122,5): error CS1519: Unexpected symbol `=' in class, struct, or interface member declaration
OverlappingModel.cs(122,20): error CS1519: Unexpected symbol `;' in class, struct, or interface member declaration
OverlappingModel.cs(123,15): error CS1519: Unexpected symbol `=' in class, struct, or interface member declaration
OverlappingModel.cs(123,25): error CS1519: Unexpected symbol `+' in class, struct, or interface member declaration
OverlappingModel.cs(123,28): error CS1519: Unexpected symbol `)' in class, struct, or interface member declaration
OverlappingModel.cs(123,33): error CS1519: Unexpected symbol `;' in class, struct, or interface member declaration
OverlappingModel.cs(124,12): error CS1519: Unexpected symbol `=' in class, struct, or interface member declaration
OverlappingModel.cs(124,23): error CS1519: Unexpected symbol `T' in class, struct, or interface member declaration
OverlappingModel.cs(124,24): error CS1519: Unexpected symbol `]' in class, struct, or interface member declaration
OverlappingModel.cs(124,25): error CS1525: Unexpected symbol `]', expecting `,' or `]'
OverlappingModel.cs(125,16): error CS1519: Unexpected symbol `=' in class, struct, or interface member declaration
OverlappingModel.cs(125,29): error CS1519: Unexpected symbol `T' in class, struct, or interface member declaration
OverlappingModel.cs(125,30): error CS1519: Unexpected symbol `]' in class, struct, or interface member declaration
OverlappingModel.cs(128,9): error CS1519: Unexpected symbol `foreach' in class, struct, or interface member declaration
OverlappingModel.cs(128,20): error CS1519: Unexpected symbol `in' in class, struct, or interface member declaration
OverlappingModel.cs(128,30): error CS1519: Unexpected symbol `)' in class, struct, or interface member declaration
OverlappingModel.cs(129,3): error CS9010: Primary constructor body is not allowed
OverlappingModel.cs(129,3): error CS8041: Primary constructor already has a body
OverlappingModel.cs(140,4): error CS1519: Unexpected symbol `;' in class, struct, or interface member declaration
OverlappingModel.cs(142,14): error CS1519: Unexpected symbol `=' in class, struct, or interface member declaration
OverlappingModel.cs(142,24): error CS1519: Unexpected symbol `4' in class, struct, or interface member declaration
OverlappingModel.cs(142,26): error CS1525: Unexpected symbol `]', expecting `,' or `]'
OverlappingModel.cs(142,28): error CS1525: Unexpected symbol `]', expecting `,' or `]'
OverlappingModel.cs(143,14): error CS1519: Unexpected symbol `=' in class, struct, or interface member declaration
OverlappingModel.cs(143,21): error CS1519: Unexpected symbol `<' in class, struct, or interface member declaration
OverlappingModel.cs(143,28): error CS1519: Unexpected symbol `++' in class, struct, or interface member declaration
OverlappingModel.cs(144,3): error CS9010: Primary constructor body is not allowed
OverlappingModel.cs(144,3): error CS8041: Primary constructor already has a body
OverlappingModel.cs(156,20): error CS1525: Unexpected symbol `bool', expecting `class', `delegate', `enum', `interface', `partial', or `struct'
SimpleTiledModel.cs(40,15): error CS1525: Unexpected symbol `(', expecting `,', `;', or `='
SimpleTiledModel.cs(40,26): error CS1525: Unexpected symbol `int', expecting `,', `;', or `='
SimpleTiledModel.cs(40,36): error CS1525: Unexpected symbol `>', expecting `,', `;', or `='
SimpleTiledModel.cs(45,4): error CS1519: Unexpected symbol `;' in class, struct, or interface member declaration
SimpleTiledModel.cs(49,9): error CS1519: Unexpected symbol `=' in class, struct, or interface member declaration
SimpleTiledModel.cs(49,28): error CS1519: Unexpected symbol `(' in class, struct, or interface member declaration
SimpleTiledModel.cs(49,29): error CS1519: Unexpected symbol `)' in class, struct, or interface member declaration
SimpleTiledModel.cs(50,13): error CS1519: Unexpected symbol `=' in class, struct, or interface member declaration
SimpleTiledModel.cs(50,31): error CS1519: Unexpected symbol `(' in class, struct, or interface member declaration
SimpleTiledModel.cs(50,32): error CS1519: Unexpected symbol `)' in class, struct, or interface member declaration
SimpleTiledModel.cs(56,9): error CS1519: Unexpected symbol `foreach' in class, struct, or interface member declaration
SimpleTiledModel.cs(56,28): error CS1519: Unexpected symbol `in' in class, struct, or interface member declaration
SimpleTiledModel.cs(56,43): error CS1519: Unexpected symbol `(' in class, struct, or interface member declaration
SimpleTiledModel.cs(56,50): error CS1519: Unexpected symbol `tiles' in class, struct, or interface member declaration
SimpleTiledModel.cs(56,63): error CS1525: Unexpected symbol `tile'
SimpleTiledModel.cs(56,53): error CS1520: Class, struct, or interface method must have a return type
SimpleTiledModel.cs(56,68): error CS1525: Unexpected symbol `)'
SimpleTiledModel.cs(143,5): error CS1519: Unexpected symbol `=' in class, struct, or interface member declaration
SimpleTiledModel.cs(143,19): error CS1519: Unexpected symbol `;' in class, struct, or interface member declaration
SimpleTiledModel.cs(144,11): error CS1519: Unexpected symbol `=' in class, struct, or interface member declaration
SimpleTiledModel.cs(144,35): error CS1519: Unexpected symbol `(' in class, struct, or interface member declaration
SimpleTiledModel.cs(144,36): error CS1519: Unexpected symbol `)' in class, struct, or interface member declaration
SimpleTiledModel.cs(146,14): error CS1519: Unexpected symbol `=' in class, struct, or interface member declaration
SimpleTiledModel.cs(146,24): error CS1519: Unexpected symbol `4' in class, struct, or interface member declaration
SimpleTiledModel.cs(146,26): error CS1525: Unexpected symbol `]', expecting `,' or `]'
SimpleTiledModel.cs(146,28): error CS1525: Unexpected symbol `]', expecting `,' or `]'
SimpleTiledModel.cs(148,5): error CS1519: Unexpected symbol `for' in class, struct, or interface member declaration
SimpleTiledModel.cs(148,14): error CS1519: Unexpected symbol `=' in class, struct, or interface member declaration
SimpleTiledModel.cs(148,21): error CS1519: Unexpected symbol `<' in class, struct, or interface member declaration
SimpleTiledModel.cs(148,28): error CS1519: Unexpected symbol `++' in class, struct, or interface member declaration
SimpleTiledModel.cs(149,3): error CS9010: Primary constructor body is not allowed
SimpleTiledModel.cs(155,9): error CS1519: Unexpected symbol `foreach' in class, struct, or interface member declaration
SimpleTiledModel.cs(155,32): error CS1519: Unexpected symbol `in' in class, struct, or interface member declaration
SimpleTiledModel.cs(155,47): error CS1519: Unexpected symbol `(' in class, struct, or interface member declaration
SimpleTiledModel.cs(155,58): error CS1519: Unexpected symbol `neighbors' in class, struct, or interface member declaration
SimpleTiledModel.cs(155,71): error CS1525: Unexpected symbol `neighbor'
SimpleTiledModel.cs(155,61): error CS1520: Class, struct, or interface method must have a return type
SimpleTiledModel.cs(155,80): error CS1525: Unexpected symbol `)'
SimpleTiledModel.cs(176,5): error CS1519: Unexpected symbol `for' in class, struct, or interface member declaration
SimpleTiledModel.cs(176,15): error CS1519: Unexpected symbol `=' in class, struct, or interface member declaration
SimpleTiledModel.cs(176,23): error CS1519: Unexpected symbol `<' in class, struct, or interface member declaration
SimpleTiledModel.cs(176,26): error CS1519: Unexpected symbol `;' in class, struct, or interface member declaration
SimpleTiledModel.cs(176,31): error CS1519: Unexpected symbol `++' in class, struct, or interface member declaration
SimpleTiledModel.cs(176,46): error CS1519: Unexpected symbol `=' in class, struct, or interface member declaration
SimpleTiledModel.cs(176,54): error CS1519: Unexpected symbol `<' in class, struct, or interface member declaration
SimpleTiledModel.cs(176,57): error CS1519: Unexpected symbol `;' in class, struct, or interface member declaration
SimpleTiledModel.cs(176,62): error CS1519: Unexpected symbol `++' in class, struct, or interface member declaration
SimpleTiledModel.cs(177,4): error CS9010: Primary constructor body is not allowed
SimpleTiledModel.cs(177,4): error CS8041: Primary constructor already has a body
SimpleTiledModel.cs(183,5): error CS1519: Unexpected symbol `for' in class, struct, or interface member declaration
SimpleTiledModel.cs(183,14): error CS1519: Unexpected symbol `=' in class, struct, or interface member declaration
SimpleTiledModel.cs(183,21): error CS1519: Unexpected symbol `<' in class, struct, or interface member declaration
SimpleTiledModel.cs(183,28): error CS1519: Unexpected symbol `++' in class, struct, or interface member declaration
SimpleTiledModel.cs(184,3): error CS9010: Primary constructor body is not allowed
SimpleTiledModel.cs(184,3): error CS8041: Primary constructor already has a body
SimpleTiledModel.cs(189,5): error CS1519: Unexpected symbol `for' in class, struct, or interface member declaration
SimpleTiledModel.cs(189,14): error CS1519: Unexpected symbol `=' in class, struct, or interface member declaration
SimpleTiledModel.cs(189,21): error CS1519: Unexpected symbol `<' in class, struct, or interface member declaration
SimpleTiledModel.cs(189,28): error CS1519: Unexpected symbol `++' in class, struct, or interface member declaration
SimpleTiledModel.cs(189,43): error CS1519: Unexpected symbol `=' in class, struct, or interface member declaration
SimpleTiledModel.cs(189,51): error CS1519: Unexpected symbol `<' in class, struct, or interface member declaration
SimpleTiledModel.cs(189,54): error CS1519: Unexpected symbol `;' in class, struct, or interface member declaration
SimpleTiledModel.cs(189,59): error CS1519: Unexpected symbol `++' in class, struct, or interface member declaration
SimpleTiledModel.cs(190,4): error CS9010: Primary constructor body is not allowed
SimpleTiledModel.cs(190,4): error CS8041: Primary constructor already has a body
SimpleTiledModel.cs(202,20): error CS1525: Unexpected symbol `bool', expecting `class', `delegate', `enum', `interface', `partial', or `struct'
Compilation failed: 115 error(s), 0 warnings

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.