mxgmn / WaveFunctionCollapse

Bitmap & tilemap generation from a single example with the help of ideas from quantum mechanics
Other
23.18k stars 1.24k forks source link

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

Closed VelocityRa closed 7 years ago

VelocityRa commented 7 years ago

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?

mxgmn commented 7 years ago

No objections. Since the standard library doesn't support JSON, if you make this PR I'll leave it open like the command line one for people to merge in their forks.

VelocityRa commented 7 years ago

But it does support JSON. I'm planning to use the first method (System.Runtime.Serialization), which is even more compatible than the other one suggested.

mxgmn commented 7 years ago

Oh, didn't know this, will consider JSON in future projects then. JSON PR is welcome, but I'll still leave it open since I don't want to support multiple branches.

VelocityRa commented 7 years ago

Not sure what you mean by support multiple branches. I'm gonna handle the JSON parsing in my PR. Also, if I'm not mistaken, the only file that needs to change is Main.cs (currently less than 60 LoC).

mxgmn commented 7 years ago

If I add/remove examples or parameters, I would have to modify JSON parsing and samples.json also.

VelocityRa commented 7 years ago

Ah, I guess that makes sense. Well, the goal for this was for people to actually use it, not make it harder by forcing them to either fork + merge the PR or paste the changes manually. This goes for the other unmerged PR as well, I doubt the vast majority of people using WFC know about it, let alone go through the trouble of using it.

Anyway, I'll talk with the other dev about the possibility of adding XML support to the C++ version as I originally intended.

mxgmn commented 7 years ago

I'll link this command line PR from the readme then.

VelocityRa commented 7 years ago

Yeah that would be better. Might also want to include Install/Build instructions or at least link to the relevant Issue while you're at it (even though it's pretty easy, people have problems apparently).

mxgmn commented 7 years ago

Yes, I'm going to.