BorisTheBrave / DeBroglie

DeBroglie is a C# library implementing the Wave Function Collapse algorithm with support for additional non-local constraints, and other useful features.
https://boristhebrave.github.io/DeBroglie/
MIT License
471 stars 37 forks source link

DeBroglie.Console crashes when following the Introduction tutorial #5

Closed giovinazzo-kevin closed 6 years ago

giovinazzo-kevin commented 6 years ago

I get a NPE whenever I try to run the executable (2.0 release) by dragging the following JSON file into it:

{
    "src": "sewers.png",
    "dest": "generated-sewers.png",
    "model": {
        "type": "overlapping",
        "n": 3
    },
    "periodicInput": true,
    "periodic": true,
    "symmetry": 8
}

This is the stack trace:

Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
   at DeBroglie.Console.Export.BitmapExporter.Export(TileModel model, TilePropagator propagator, String filename, DeBroglieConfig config, ExportOptions exportOptions) in C:\Users\Adam\Documents\Programming\Programming 2018\DeBroglie\DeBroglie.Console\Export\BitmapExporter.cs:line 66
   at DeBroglie.Console.Export.Exporter.Export(TileModel model, TilePropagator tilePropagator, String filename, DeBroglieConfig config, ExportOptions exportOptions) in C:\Users\Adam\Documents\Programming\Programming 2018\DeBroglie\DeBroglie.Console\Export\Exporter.cs:line 17
   at DeBroglie.Console.ItemsProcessor.ProcessItem() in C:\Users\Adam\Documents\Programming\Programming 2018\DeBroglie\DeBroglie.Console\ItemsProcessor.cs:line 343
   at DeBroglie.Console.ItemsProcessor.Process(String filename) in C:\Users\Adam\Documents\Programming\Programming 2018\DeBroglie\DeBroglie.Console\ItemsProcessor.cs:line 458
   at DeBroglie.Console.Program.Main(String[] args) in C:\Users\Adam\Documents\Programming\Programming 2018\DeBroglie\DeBroglie.Console\Program.cs:line 16

This bug does not happen with the 1.0 release, so I suppose that the introduction still needs to be updated.

BorisTheBrave commented 6 years ago

Thanks for the report - it's easy to forget to update these things. It shouldn't give you a NullReferenceException in any case.

BorisTheBrave commented 6 years ago

I've made a new release v0.2.1 which fixes the issue. Please try it out.

giovinazzo-kevin commented 6 years ago

Yup, it works on my end as well. Thank you for addressing the issue so quickly! I hadn't noticed the notification.