Git Product home page Git Product logo

Comments (89)

mxgmn avatar mxgmn commented on April 28, 2024 6

@NNNenov Foundation is a special case of constraint. I use it in examples like Flowers, City, Platformer to make the ground level be at the bottom of the output. If you delete the foundation param from samples.xml, you'll see that ground appears anywhere in the middle of an output, not necessary at the bottom. Why 102? It goes through input image in a scanline order. First it sees a 3x3 pattern of sky, so 0 is the index of 3x3 blue box. 1 is the index of 3x3 blue box with one pixel of yellow in the bottom right corner, and so on, 102 is the index of top row earth, bottom two rows sky pattern.

from wavefunctioncollapse.

CoenraadS avatar CoenraadS commented on April 28, 2024 5

Windows Installation Instructions:

  1. Download NuGet: https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
  2. CMD > nuget install Microsoft.Net.Compilers -Version 1.3.2
  3. CMD > \Microsoft.Net.Compilers.1.3.2\tools\csc.exe *.cs

In my example I had WaveFunctionCollapse-master as my working directory.

from wavefunctioncollapse.

nanodeath avatar nanodeath commented on April 28, 2024 5

@NNNenov here, I've annotated the first two rows based on the top-left corner. (in hex)
flowers_annotated

from wavefunctioncollapse.

Rubonnek avatar Rubonnek commented on April 28, 2024 4

In Arch Linux the same command works. Only had to install mono:

# pacman -S mono
$ mcs -pkg:dotnet /reference:System.Drawing.dll *.cs

from wavefunctioncollapse.

dzoba avatar dzoba commented on April 28, 2024 4

After following @squarism 's directions I am getting

System.TypeInitializationException: The type initializer for 'System.Drawing.GDIPlus' threw an exception. ---> System.DllNotFoundException: libgdiplus.dylib
  at (wrapper managed-to-native) System.Drawing.GDIPlus:GdiplusStartup (ulong&,System.Drawing.GdiplusStartupInput&,System.Drawing.GdiplusStartupOutput&)
  at System.Drawing.GDIPlus..cctor () [0x000cc] in <93576e487af246b9880ff86779ad60ff>:0
   --- End of inner exception stack trace ---
  at System.Drawing.Bitmap..ctor (System.String filename, System.Boolean useIcm) [0x0002b] in <93576e487af246b9880ff86779ad60ff>:0
  at System.Drawing.Bitmap..ctor (System.String filename) [0x00000] in <93576e487af246b9880ff86779ad60ff>:0
  at (wrapper remoting-invoke-with-check) System.Drawing.Bitmap:.ctor (string)
  at OverlappingModel..ctor (System.String name, System.Int32 N, System.Int32 width, System.Int32 height, System.Boolean periodicInput, System.Boolean periodicOutput, System.Int32 symmetry, System.Int32 foundation) [0x00041] in <e8e8a4739e4b4f79b85af1dc0961b451>:0
  at Program.Main () [0x000c9] in <e8e8a4739e4b4f79b85af1dc0961b451>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: The type initializer for 'System.Drawing.GDIPlus' threw an exception. ---> System.DllNotFoundException: libgdiplus.dylib
  at (wrapper managed-to-native) System.Drawing.GDIPlus:GdiplusStartup (ulong&,System.Drawing.GdiplusStartupInput&,System.Drawing.GdiplusStartupOutput&)
  at System.Drawing.GDIPlus..cctor () [0x000cc] in <93576e487af246b9880ff86779ad60ff>:0
   --- End of inner exception stack trace ---
  at System.Drawing.Bitmap..ctor (System.String filename, System.Boolean useIcm) [0x0002b] in <93576e487af246b9880ff86779ad60ff>:0
  at System.Drawing.Bitmap..ctor (System.String filename) [0x00000] in <93576e487af246b9880ff86779ad60ff>:0
  at (wrapper remoting-invoke-with-check) System.Drawing.Bitmap:.ctor (string)
  at OverlappingModel..ctor (System.String name, System.Int32 N, System.Int32 width, System.Int32 height, System.Boolean periodicInput, System.Boolean periodicOutput, System.Int32 symmetry, System.Int32 foundation) [0x00041] in <e8e8a4739e4b4f79b85af1dc0961b451>:0
  at Program.Main () [0x000c9] in <e8e8a4739e4b4f79b85af1dc0961b451>:0```

After googling I don't see a simple answer to that. Any one here encountered/solved it?

EDIT:

I was able to get it to do a bit more by following these commands in addition to what @squarism posted. Not sure if this is the best way, but it seems to be working.

  1. brew cask install mono-mdk
  2. open /usr/local/Caskroom/mono-mdk/4.6.1.3/MonoFramework-MDK-4.6.1.3.macos10.xamarin.universal.pkg
  3. env PATH=/Library/Frameworks/Mono.framework/Commands/:$PATH mcs -pkg:dotnet /reference:System.Drawing.dll *.cs
  4. env PATH=/Library/Frameworks/Mono.framework/Commands/:$PATH mono Main.exe

from wavefunctioncollapse.

ultrasam avatar ultrasam commented on April 28, 2024 4

Here: https://dl.dropboxusercontent.com/u/24996373/TileCreation.rar

I hope this helps somebody

from wavefunctioncollapse.

ultrasam avatar ultrasam commented on April 28, 2024 3

How can I run this on a PC?

from wavefunctioncollapse.

mxgmn avatar mxgmn commented on April 28, 2024 2

@marvinside Your 4 lines above are correct. But you need to add other lines to describe other ways how resistor can connect with itself and other tiles. For example:

<neighbor left="resistor" right="resistor"/>
<neighbor left="resistor 3" right="resistor 1"/>
<neighbor left="resistor" right="resistor 2"/>
<neighbor left="corner" right="resistor"/>
<neighbor left="corner" right="resistor 2"/>
<neighbor left="resistor" right="skew"/>
<neighbor left="resistor 2" right="skew"/>
<neighbor left="resistor" right="substrate"/>
<neighbor left="resistor" right="t 1"/>
<neighbor left="resistor" right="track"/>
<neighbor left="resistor" right="wire 1"/>
<neighbor left="transition 3" right="resistor 3"/>
<neighbor left="bridge" right="resistor 3"/>
<neighbor left="wire" right="resistor 3"/>

Here is what output looks like:

Don't forget to add resistor in the subset.

from wavefunctioncollapse.

selfsame avatar selfsame commented on April 28, 2024 2

@NNNenov you can take a look at this version of the tiled model, I use strings instead of bitmaps that include a rotation number and parse that for the 3d display ("0foo", "3foo") https://github.com/selfsame/WaveFunctionCollapse/blob/master/SimpleTiledModel.cs

from wavefunctioncollapse.

nylki avatar nylki commented on April 28, 2024 1

In Fedora 24 this worked for me (besides mono, mono-data-oracle was needed):

sudo dnf install mono-devel mono-data-oracle
mcs -pkg:dotnet /reference:System.Drawing.dll *.cs
mono Main.exe

from wavefunctioncollapse.

kchapelier avatar kchapelier commented on April 28, 2024 1

@imaginary-unit Do you have the Stuff.cs in the same folder ? The extension method in question is here : https://github.com/mxgmn/WaveFunctionCollapse/blob/master/Stuff.cs#L47

from wavefunctioncollapse.

nanodeath avatar nanodeath commented on April 28, 2024 1

@NNNenov I think so, but it only counts unique 3x3 patterns. If you have a solid block of gray that's 9x9, it'll only yield a single index value. Look for T in the code.

Basically, without some sort of visual editor tool, I don't think it's actually practical to try to set our own foundation values (yet).

from wavefunctioncollapse.

mxgmn avatar mxgmn commented on April 28, 2024 1

@NNNenov I see. Your approach is the best that could be done fast. I'd suggest only using 2 colored pixels placed in a non-symmetric way instead of 3, otherwise you can't distinguish between 2 mirror symmetries. And, if you work with the C# code, using bitmapData directly instead of scanning a saved bitmap.

Returning an array of tiles together with rotations can't be implemented elegantly in this version, because it forgets all symmetry information after executing the constructor. This way I can keep Propagate() methods short and Observe() method single for all models. Maybe @nanodeath could implement the direct output of tiles + rotations since he is building an all-around library.

from wavefunctioncollapse.

mxgmn avatar mxgmn commented on April 28, 2024 1

@NNNenov Knots also use it: there are only 5 tiles, without symmetries there would be 13.

from wavefunctioncollapse.

mxgmn avatar mxgmn commented on April 28, 2024 1

@marvinside They are rotations 90 degrees counterclockwise: 1 - 90 degree rotation, 2 - 180, 3 - 270 = -90.

from wavefunctioncollapse.

nilsding avatar nilsding commented on April 28, 2024

@ultrasam I lazied out and created a new C# project in Xamarin Studio (which is pretty much like Visual Studio) and added the C# files which where in the repo. Had to add references to System.Xml and System.Drawing before building.

from wavefunctioncollapse.

ultrasam avatar ultrasam commented on April 28, 2024

When creating a new C# project in Visual Studio it gives me several options:
Windows Forms Application,
WPF Application
Console Application
Shared Project
Class Library

Which one should I pick??

from wavefunctioncollapse.

nilsding avatar nilsding commented on April 28, 2024

Use a Console Application and remove the Program1.cs file

from wavefunctioncollapse.

ultrasam avatar ultrasam commented on April 28, 2024

I've got all this errors when I tried to build this, I am new at doing a project in Visual Studio 2015, sorry about that, but any help would be appreciated
image

from wavefunctioncollapse.

mwaltersva avatar mwaltersva commented on April 28, 2024

Right click References > Add, select System.Draw

from wavefunctioncollapse.

ultrasam avatar ultrasam commented on April 28, 2024

Ok, perfect that worked it compiled with no errors, now how do I use the program??

from wavefunctioncollapse.

ultrasam avatar ultrasam commented on April 28, 2024

Ok, I think I had two programs with the method main and that was causing problems, but now I fixed that and now I am getting the error shown here:
image
By the way the file samples.xml is there...

from wavefunctioncollapse.

kchapelier avatar kchapelier commented on April 28, 2024

@ultrasam is the samples.xml files actually copied to the build directory ? If it isn't you could try copy pasting it there manually to confirm it fixes the issue you're having. I can't remember what was the setting to include a resource file in the build system of VS though...

EDIT: you will probably have the same issue with all the images

from wavefunctioncollapse.

ultrasam avatar ultrasam commented on April 28, 2024

well the file is there and I included it in the project:
image
Here is my project's folder:
image

Do you see anything wrong there?

from wavefunctioncollapse.

ultrasam avatar ultrasam commented on April 28, 2024

Ok I put the samples folder and samples.xml inside the bin/Debug/ folder and it worked!!!, it started creating a bunch of BMPs, now if I want to use my own designs, should I put them on the samples folder??

from wavefunctioncollapse.

kchapelier avatar kchapelier commented on April 28, 2024

yes, and reference them in the samples.xml file and fiddle with the properties a bit

from wavefunctioncollapse.

TheDudeFromCI avatar TheDudeFromCI commented on April 28, 2024

Is there a pre-compiled version of this? I am very new to C#, and have no idea how to compile or run it. >.>

from wavefunctioncollapse.

TheDudeFromCI avatar TheDudeFromCI commented on April 28, 2024

Thanks, that's perfect. ^^

from wavefunctioncollapse.

ultrasam avatar ultrasam commented on April 28, 2024

If you make any new bitmaps or any interesting tileset could you share it, I want to learn

from wavefunctioncollapse.

NNNenov avatar NNNenov commented on April 28, 2024

Thank you all for helping me to understand how to set this up!
I am a total amateur, so am playing with this as one.
The first thing I tried to do was modify one of the sample images, "flowers", I changed the colours of the petals, and added some other hues of green in the stems.
But this results in many "CONTRADICTION"s, it would be really good to have an idea why this is happening, is it because there is no direct chain of same colour pixels, but then, how do the flower heads work?
Is there a reference to what parameters are available, or what the parameters demonstrated in samples.xml mean? eg, what does foundation="102" mean?

from wavefunctioncollapse.

mxgmn avatar mxgmn commented on April 28, 2024

@NNNenov First, remove the foundation param at all, for default flowers it's hard to set up. Ground in results will be in the middle of a picture, but that's fine. Do contradictions remain? If yes, I need to see your bitmap.

from wavefunctioncollapse.

ka-petrov avatar ka-petrov commented on April 28, 2024

In Ubuntu 16.04 running the command
mcs -pkg:dotnet /reference:System.Drawing.dll *.cs

results in the following:
error CS1061: Type 'System.Xml.XmlNode' does not contain a definition for 'Get' and no extension method 'Get' of type 'System.Xml.XmlNode' could be found. Are you missing an assembly reference?

Can't figure out what reference am I missing :( including System.Xml changes nothing.
Not familiar with mono, but really want to play with the algorithm, pls help :)

from wavefunctioncollapse.

ka-petrov avatar ka-petrov commented on April 28, 2024

@kchapelier Ouch, somehow I didn't include it.. thanks! now it works.

from wavefunctioncollapse.

NNNenov avatar NNNenov commented on April 28, 2024

@mxgmn yeah it looks like I picked the most fussy one to test first! It works fine without the foundation param. I am curious though what this foundation param means and its input values, in the example its set to 102, but the source image is only 23 pixels high?

from wavefunctioncollapse.

BrianLovelace128 avatar BrianLovelace128 commented on April 28, 2024

I ran the program just fine, but I'm unable to open any of the .bmp files. Image viewer is giving me a message saying "File has bogus header data." Does anyone have any idea why this may be?

from wavefunctioncollapse.

kchapelier avatar kchapelier commented on April 28, 2024

@BrianLovelace128 Try renaming them to png, this is a known issue which will probably be fixed in the next version ( #1 )

from wavefunctioncollapse.

NNNenov avatar NNNenov commented on April 28, 2024

@mxgmn I thought I understood this but the 3x3 pattern part threw me off a little.
so 0 is the index of the top left pixel? and that pixel is the top left anchor/start point of the 3x3 pixel sector? like this? flowers ref
So each index is 3x3 pixels, and to set an anchor you count the amount of pixels in scanline order, then quanitze/divide by 3?

from wavefunctioncollapse.

mxgmn avatar mxgmn commented on April 28, 2024

@nanodeath @NNNenov Actually, now I see a better way to set it for flowers: foundation="-4".

from wavefunctioncollapse.

mxgmn avatar mxgmn commented on April 28, 2024

@NNNenov Your picture is not completely right. 0 is not the index of top left pixel. 0 is the index of the whole 3x3 blue block. A mental unit test: 6 is the index of blue 3x3 block with one yellow pixel in the middle row right column.

from wavefunctioncollapse.

nanodeath avatar nanodeath commented on April 28, 2024

Heh, that was a bit of a brain bender. The top left corner of "6" is at (2,1), right? (assuming 0-based indexing)

from wavefunctioncollapse.

gliptak avatar gliptak commented on April 28, 2024

Current HEAD compiles on Ubuntu 16.04:

cat /etc/lsb-release
sudo apt install mono-devel
mcs -pkg:dotnet /reference:System.Drawing.dll *.cs
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.1 LTS"
Reading package lists... Done
Building dependency tree       
Reading state information... Done
mono-devel is already the newest version (4.2.1.102+dfsg2-7ubuntu4).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Model.cs(18,29): warning CS0649: Field `Model.limit' is never assigned to, and will always have its default value `0'
Compilation succeeded - 1 warning(s)

from wavefunctioncollapse.

mxgmn avatar mxgmn commented on April 28, 2024

@nanodeath Yes, if I counted them right. Checked it in my gui: correct.

from wavefunctioncollapse.

NNNenov avatar NNNenov commented on April 28, 2024

So if the image has multiple 3x3 sectors with identical pixels, they are all treated with the same index, so to figure out which sector the foundation should be at, I need to check how many unique 3x3 sectors there are, in a scan-line order?
@mxgmn would you or @nanodeath mind marking a few numbered 3x3 sectors over the sample image I linked to, so I can see what you mean and get a better idea?

from wavefunctioncollapse.

mxgmn avatar mxgmn commented on April 28, 2024

@NNNenov Yes.

@nanodeath @NNNenov This is the correct ordering with symmetry=1. With symmetry=2 ordering is a little different, but anyway it illustrates the idea better then symmetry=2, it's just to weird then, no need to re-upload. Here I made a picture with big digits (and still symmetry=1) to illustrate that indices enumerate whole 3x3 blocks.

from wavefunctioncollapse.

nanodeath avatar nanodeath commented on April 28, 2024

Okay, that took me a little while to figure out. From my symmetry=1 image, because 1 and 5 are mirror images of each other, 5 doesn't get generated at all in the symmetry=2 case (rather, 5 could mean something totally different and unrelated). Correct?

from wavefunctioncollapse.

mxgmn avatar mxgmn commented on April 28, 2024

@nanodeath Yes, it would be 0, 0, 1, 3, 5, 4, 2, 0, 0, 0, 1, ...

from wavefunctioncollapse.

NNNenov avatar NNNenov commented on April 28, 2024

I think I understand too.. so now I'm wondering @mxgmn how did you calculate the foundation sector 102 for the flowers image? Did you have to use some sort of function to get the sector based on target pixel?

from wavefunctioncollapse.

nanodeath avatar nanodeath commented on April 28, 2024

@NNNenov he has a GUI tool I think. FWIW, I was planning on making my own little tool using JavaFX to do something similar.

If anyone else is curious about what symmetries are and can be, it can be any value between 1 and 8 and is captured here. 1 = original, 2 = reflected, 3 = rotated, 4 = rotated and reflected, etc.

from wavefunctioncollapse.

mxgmn avatar mxgmn commented on April 28, 2024

@NNNenov We know what T is (T=106 for flowers, you can just print T in the constructor), so we can just count from the back, ground = 106 - 4 = 102. I myself have a gui that just tells me the index when I point a mouse on a pixel.

from wavefunctioncollapse.

nanodeath avatar nanodeath commented on April 28, 2024

You can also use negative numbers (e.g. -1 is the last unique pattern), so if your unique pattern happens to be near the beginning or end, you can just guess based on that. Granted, it gets confusing when you factor in reflections and rotations...

from wavefunctioncollapse.

hemik1 avatar hemik1 commented on April 28, 2024

Hey! Awesome piece of code! I managed to plug it into my unity voxel engine, got some fun results. I was wondering if you could elaborate on the 3d approach, those screenshots you shared look quite amazing. Will you be sharing a 3d repo by any chance?

from wavefunctioncollapse.

mxgmn avatar mxgmn commented on April 28, 2024

@hemik1 Thank you! Show the results then. Of course, 3d repo will also be public. This will not happen very soon though.

from wavefunctioncollapse.

NNNenov avatar NNNenov commented on April 28, 2024

It's been great fun playing around with this.
I would like to try and make the tiled model output a list containing the tile type and orientation (where applicable) at each tile index, for parsing to 3D software e.g:
tile[index] = tileShape[angle] // or tile[x][y] = tileShape[angle
so this data can be parsed into any 3D software to make a grid of "3D" tile shapes(its still technically 2D, but I can replace the shapes with objects from a range).
Like I mentioned earlier, the code is beyond me, but I'd love to learn, maybe if you see how crazy my current plan is someone will help..
So my approach was going to be caveman style:
draw 3 pixels per tile with fixed alignment, with different colour based on tile type, then use a script to scan the pixel output of the program to calculate orientation and derive tile type based on the pixel colour..
I know this is a bit ridiculous, but its simply because the current code is just too complex for me to understand!

from wavefunctioncollapse.

NNNenov avatar NNNenov commented on April 28, 2024

I'm not sure I follow you re: symmetry, in the samples I didn't see any simple tiled configuration with symmetry as a variable, I thought that was just for the overlapping model? Can simple tiled model mirror any tiles?

from wavefunctioncollapse.

mxgmn avatar mxgmn commented on April 28, 2024

@NNNenov Of course! There are symmetry parameters for individual tiles in the corresponding data.xml files.

from wavefunctioncollapse.

NNNenov avatar NNNenov commented on April 28, 2024

ah yes of course! I was just looking at one example (knots) which didn't use it..

from wavefunctioncollapse.

nanodeath avatar nanodeath commented on April 28, 2024

@mxgmn @NNNenov Maybe. File an issue if you would use it (i.e. you're using the JVM).

I do have some regrets not implementing kollapse on a multi-target language...would be a little silly to have N implementations of WFC for N different platforms.

from wavefunctioncollapse.

marvinside avatar marvinside commented on April 28, 2024

So i'm trying around with the Circuit Version and i tried to do a resistor. But i am unable to make the resistor connect to itself.

<tile name="resistor" symmetry="T" weight="1.0"/>

and

<neighbor left="resistor" right="resistor"/>
<neighbor left="resistor 1" right="transition 1"/>
<neighbor left="resistor 2" right="substrate"/>

Also: is there any Documentation which side (number) is for used on which symmetry?

from wavefunctioncollapse.

mxgmn avatar mxgmn commented on April 28, 2024

@marvinside Could you show the picture of your resistor? Impossible to answer without that.

from wavefunctioncollapse.

marvinside avatar marvinside commented on April 28, 2024

resistor

@mxgmn Here it is. Why is it important?

from wavefunctioncollapse.

marvinside avatar marvinside commented on April 28, 2024

@mxgmn Do you have some Information what the Numbers mean? So at Symetry T what is 0, 1 and 2?

from wavefunctioncollapse.

gromilQaaaa avatar gromilQaaaa commented on April 28, 2024

Well, my task is to make an infinite tiled 2d maze with chunks 100x100. The maze should contain treasures, buildings and enemies. I thought this asset would give me everything I need, but no... Absolutely no comments (even for input fields like symmetry, N, periodic)... Anyway I managed to launch it with this input image (red is building, blue is treasure):
labirinth
And it gave me:
1 labirinth 0
1 labirinth 1

Not so really bad, but lots of blocked zones (white walkable place without entrance). What can I do to fix that? And the second question is tiling... Can it simply tile my image without any input data? For example: I give it an image and it makes a right-side tiled image for the given one,

from wavefunctioncollapse.

mxgmn avatar mxgmn commented on April 28, 2024

@gromilQaaaa One method to make output connected is to run a "fill" (like in graphics editors) process in a separate layer. By default WFC doesn't guarantee connectedness. I don't really follow your second question, WFC needs input data in any case.

from wavefunctioncollapse.

selfsame avatar selfsame commented on April 28, 2024

@gromilQaaaa @mxgmn I think the second question was if WFC can output a tiling texture. I believe you could achieve that by using a N thick border constraint on the output array, where top/bottom left/right is repeated, and cropping that from the final output?

from wavefunctioncollapse.

mxgmn avatar mxgmn commented on April 28, 2024

@selfsame @gromilQaaaa Then sure, periodic="True" option generates a periodic texture. Most of the examples on the readme page are periodic.

from wavefunctioncollapse.

nanodeath avatar nanodeath commented on April 28, 2024

@mxgmn So periodic means the images should tile seemlessly, then? Didn't realize that.

from wavefunctioncollapse.

mxgmn avatar mxgmn commented on April 28, 2024

@nanodeath Yes. I scroll right/left up/down in videos and gifs to demonstrate that generated images are periodic.

from wavefunctioncollapse.

nanodeath avatar nanodeath commented on April 28, 2024

@mxgmn Ah...I had no idea what the panning was supposed to signify. I just assumed you were generating a larger image than what was initially being shown, and then panning for effect. Anywho, glad to learn more about the codebase.

from wavefunctioncollapse.

mxgmn avatar mxgmn commented on April 28, 2024

@nanodeath I also stacked 2 tiled "Rooms" outputs in the readme to demonstrate that they stack seamlessly.

from wavefunctioncollapse.

mxgmn avatar mxgmn commented on April 28, 2024

@NNNenov @nanodeath Pardon, nvm, this actually can be done fast, I'll do it right now...

from wavefunctioncollapse.

NNNenov avatar NNNenov commented on April 28, 2024

Hey! I've just been trying to understand whats happening in the data.xml file for the tilesets.
Here's my understanding so far:

image
these are all the types of symmetry you can define for a tile.

Symmetry types define which way the tiles' neighbor rule can be mirrored to accommodate for more connection types and cut down on the amount of neighbour definitions needed?

So because of symmetry types, all neighbour entries are defined with single neighbor values, which are then calculated for the rest of its sides based on its symmetry type

So with left = X, right would equal something that can connect to the tile on any of its sides at the given rotation, because of this, X tiles never need to have a rotation defined.
left = I, right would equal something that can connect to only the left or right side of the tile,
left = T, right would equal something that can connect to only the left or right side of the tile,
but left = T 1 (or 3), right would equal something that can only connect to that side, but not the other?

If I am correct with the above assumptions, I have some questions about the following:
if left = L, technically not a symmetrical tile, does it still mean that
if left = L, right can equal something which can connect to the right and top side?
If that's the case I guess it is symmetrical because top and right are equal and bottom and left are equal?
See image:
image

however, in the castles data.xml file, there's a section(line 57,58) roadturn, which is L type, and is listed twice for a Tower to the right, which would suggest L symmetry has to be treated as unique on all sides?

I still have some more questions, but they are likely to change after I learn more from these queries

from wavefunctioncollapse.

mxgmn avatar mxgmn commented on April 28, 2024

In this castle example top row is <neighbor left="roadturn 1" right="tower"/> and bottom is <neighbor left="roadturn 2" right="tower"/>. What does that mean?

First, note in the Castle example tower tile has symmetry type L despite its picture having symmetry type X. I've redrawn it a little so L-symmetry would be apparent.

Imagine that we don't have any symmetry system at all. Than we also need to add lines like <neighbor left="tower 2" right="roadturn 3"/>, <neighbor up="roadturn 1" down="tower 3"/> and many more. But with the symmetry system we need only to enumerate neighbors up to a symmetry, and there are exactly 2 ways to do it for roadturn and tower - with continuations looking in the same direction or in different directions.

from wavefunctioncollapse.

pointyointment avatar pointyointment commented on April 28, 2024

@CoenraadS

Step 2 fails, saying:

WARNING: Install failed. Rolling back...
Package 'Microsoft.Net.Compilers.2.0.0' is not found on source 'https://api.nuget.org/v3/index.json'.

I have tried various things without success.

from wavefunctioncollapse.

mxgmn avatar mxgmn commented on April 28, 2024

@pointyointment I don't know why it fails, but you can also try building through Visual Studio:

  1. Download Visual Studio 2015 Community (free).
  2. Create a console C# application (file -> new project).
  3. Delete Program.cs.
  4. Add all WFC .cs files.
  5. Add System.Drawing reference through solution explorer on the right.
  6. Move all WFC data files to bin/Release.
  7. Switch to release build option. Build, run.

from wavefunctioncollapse.

CoenraadS avatar CoenraadS commented on April 28, 2024

@pointyointment

nuget install Microsoft.Net.Compilers -Version 1.3.2

Not sure what changed since I posted, but it seems a version is required now.

from wavefunctioncollapse.

kronpano avatar kronpano commented on April 28, 2024

Not sure if this is still active but could somebody expand a bit on a 3D extension of the SW??
I was thinking of extending the XML with an "up" tag and then I would somehow need to "fix" those tiles in that level and build the rest around it??
Does that sound reasonable??

from wavefunctioncollapse.

mxgmn avatar mxgmn commented on April 28, 2024

@kronpano What is SW? I uploaded a simple 3D implementation of WFC here, the algorithm is the same in 3D.

from wavefunctioncollapse.

kronpano avatar kronpano commented on April 28, 2024

SW = software and Thanks - hadn't seen that - will give it a try.
Cheers

from wavefunctioncollapse.

fxgenstudio avatar fxgenstudio commented on April 28, 2024

I want to generate a city for my voxel game, do you have a simple example, other than knots, to start understand ? thanks.

from wavefunctioncollapse.

mxgmn avatar mxgmn commented on April 28, 2024

@procfxgen You mean a 3d example? 3d version is not released yet, so only Knots so far. Check out 6 2d example tilesets here, the algorithm is the same in all dimensions.

from wavefunctioncollapse.

fxgenstudio avatar fxgenstudio commented on April 28, 2024

I play with knots 3d example, how to add ground ?

from wavefunctioncollapse.

mxgmn avatar mxgmn commented on April 28, 2024

@procfxgen Add ground.vox and ground.png, then in data.xml add the ground tile and vertical and horizontal adjacencies with existing tiles.

from wavefunctioncollapse.

fxgenstudio avatar fxgenstudio commented on April 28, 2024

Thanks, I have my ground titles now !
wfc_01
How to make "line" tile above "ground" titles ?
my "data.xml"

 <set` pixelsize="8" voxelsize="3">
   <tiles>
     <tile name="down" symmetry="T"/>
     <tile name="empty" symmetry="X"/>
     <tile name="line" symmetry="I"/>
     <tile name="turn" symmetry="L"/>
     <tile name="up" symmetry="T"/>
     <tile name="vertical" symmetry="X"/>
     <tile name="ground" symmetry="X"/>
   </tiles>
   <neighbors>
     <horizontal left="empty" right="empty"/>
     <horizontal left="empty" right="ground"/>
     <horizontal left="ground" right="up"/>
     <vertical left="empty" right="empty"/>
     <vertical left="empty" right="ground"/>
     <vertical left="ground" right="up"/>
   </neighbors>
   <subsets>
     <subset name="dense knots">
       <tile name="down" symmetry="T"/>
       <tile name="line" symmetry="I"/>
       <tile name="turn" symmetry="L"/>
       <tile name="up" symmetry="T"/>
       <tile name="vertical" symmetry="X"/>
       <tile name="ground" symmetry="X"/>
     </subset>
     <subset name="only turns">
       <tile name="turn" symmetry="L"/>
     </subset>
   </subsets>
 </set>

from wavefunctioncollapse.

mxgmn avatar mxgmn commented on April 28, 2024

@procfxgen Try this

<vertical left="empty" right="empty"/>
<vertical left="line" right="ground"/>
<vertical left="line" right="line"/>
<horizontal left="empty" right="empty"/>
<horizontal left="empty" right="line"/>
<horizontal left="empty" right="ground"/>

It should generate vertical columns.

from wavefunctioncollapse.

fxgenstudio avatar fxgenstudio commented on April 28, 2024

sorry volume is empty ....

"vertical" correspond to blue axis (Z) and "horizontal" (X,Y) to red axis in magicavoxel ?

<set pixelsize="8" voxelsize="3">
  <tiles>
    <tile name="down" symmetry="T"/>
    <tile name="empty" symmetry="X"/>
    <tile name="line" symmetry="I"/>
    <tile name="turn" symmetry="L"/>
    <tile name="up" symmetry="T"/>
    <tile name="vertical" symmetry="X"/>
    <tile name="ground" symmetry="X"/>
  </tiles>
  <neighbors>
    <vertical left="empty" right="empty"/>
    <vertical left="line" right="ground"/>
    <vertical left="line" right="line"/>
    <horizontal left="empty" right="empty"/>
    <horizontal left="empty" right="line"/>
    <horizontal left="empty" right="ground"/>
  </neighbors>
  <subsets>
    <subset name="dense knots">
      <tile name="down" symmetry="T"/>
      <tile name="line" symmetry="I"/>
      <tile name="turn" symmetry="L"/>
      <tile name="up" symmetry="T"/>
      <tile name="vertical" symmetry="X"/>
      <tile name="ground" symmetry="X"/>
    </subset>
  </subsets>
</set>

from wavefunctioncollapse.

mxgmn avatar mxgmn commented on April 28, 2024

@procfxgen This data.xml

<set pixelsize="8" voxelsize="3">
	<tiles>
		<tile name="empty" symmetry="X"/>
		<tile name="vertical" symmetry="X"/>
		<tile name="g1" symmetry="X"/>
	</tiles>
	<neighbors>
		<vertical left="empty" right="empty"/>
		<horizontal left="empty" right="empty"/>
		<vertical left="vertical" right="g1"/>
		<vertical left="vertical" right="vertical"/>
		<horizontal left="empty" right="vertical"/>
		<horizontal left="empty" right="g1"/>
		<horizontal left="vertical" right="vertical"/>
		<horizontal left="g1" right="g1"/>
	</neighbors>
</set>

and this samples.xml

<samples>
	<sample name="Knots" X="10" Y="10" Z="10" periodic="False" screenshots="2"/>
</samples>

should generate vertical columns.

If you want 3d, I think it's better to wait for a proper 3d release in September-October, it'll be much easier to experiment with, or try VoxModSynth.

from wavefunctioncollapse.

mxgmn avatar mxgmn commented on April 28, 2024

@procfxgen Yes, vertical corresponds to blue in MV, left=top, right=bottom. Horizontal - to red, and then it mixes red and green with symmetries.

from wavefunctioncollapse.

nanodeath avatar nanodeath commented on April 28, 2024

@mxgmn, is there a way you can close and lock this issue? Right now it seems to get reused every time anyone has a question (and emailing 23 people in the process), when really those questions should be new issues. Thanks!

from wavefunctioncollapse.

mxgmn avatar mxgmn commented on April 28, 2024

@nanodeath Oh, didn't know about that, closing.

from wavefunctioncollapse.

Related Issues (20)

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.