Skip to content

How to run / develop this project聽#3

Closed

Description

@squarism

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)

馃尰

Activity

  1. Rubonnek commented on Sep 30, 2016

    @Rubonnek

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

    # pacman -S mono
    $ mcs -pkg:dotnet /reference:System.Drawing.dll *.cs
    
  2. ultrasam commented on Sep 30, 2016

    @ultrasam

    How can I run this on a PC?

  3. nilsding commented on Sep 30, 2016

    @nilsding

    @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.

  4. ultrasam commented on Sep 30, 2016

    @ultrasam

    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??

  5. nilsding commented on Sep 30, 2016

    @nilsding

    Use a Console Application and remove the Program1.cs file

  6. ultrasam commented on Sep 30, 2016

    @ultrasam

    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

  7. mwaltersva commented on Sep 30, 2016

    @mwaltersva

    Right click References > Add, select System.Draw

  8. ultrasam commented on Sep 30, 2016

    @ultrasam

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

  9. ultrasam commented on Sep 30, 2016

    @ultrasam

    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...

  10. dzoba commented on Sep 30, 2016

    @dzoba

    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
  11. kchapelier commented on Sep 30, 2016

    @kchapelier
    Contributor

    @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

  12. ultrasam commented on Sep 30, 2016

    @ultrasam

    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?

  13. ultrasam commented on Sep 30, 2016

    @ultrasam

    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??

  14. kchapelier commented on Sep 30, 2016

    @kchapelier
    Contributor

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

  15. TheDudeFromCI commented on Sep 30, 2016

    @TheDudeFromCI

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

  16. 60 remaining items

  17. kronpano commented on Jul 22, 2017

    @kronpano

    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??

  18. mxgmn commented on Jul 23, 2017

    @mxgmn
    Owner

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

  19. kronpano commented on Jul 23, 2017

    @kronpano

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

  20. fxgenstudio commented on Aug 15, 2017

    @fxgenstudio

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

  21. mxgmn commented on Aug 16, 2017

    @mxgmn
    Owner

    @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.

  22. fxgenstudio commented on Aug 16, 2017

    @fxgenstudio

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

  23. mxgmn commented on Aug 16, 2017

    @mxgmn
    Owner

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

  24. fxgenstudio commented on Aug 18, 2017

    @fxgenstudio

    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>
    
  25. mxgmn commented on Aug 18, 2017

    @mxgmn
    Owner

    @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.

  26. fxgenstudio commented on Aug 18, 2017

    @fxgenstudio

    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>
    
  27. mxgmn commented on Aug 18, 2017

    @mxgmn
    Owner

    @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.

  28. mxgmn commented on Aug 18, 2017

    @mxgmn
    Owner

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

  29. nanodeath commented on Aug 18, 2017

    @nanodeath
    Contributor

    @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!

  30. mxgmn commented on Aug 18, 2017

    @mxgmn
    Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions