wfc icon indicating copy to clipboard operation
wfc copied to clipboard

A little insight into the underlying model

Open SleepyBrett opened this issue 5 years ago • 2 comments

I'm trying to use this library to do some work that is not image based using the SimpleTiledModel. Is there a way to inspect the current solution and know which tile/variant has been selected for each location in the grid? Thought I would ask before I start digging in myself.

SleepyBrett avatar Dec 19 '19 18:12 SleepyBrett

Hey @SleepyBrett, thanks for opening your question. Yes, I believe if you look into the model.Wave[x][y][t] field (where x and y are the coordinates in the output and t is the list of possible tiles at that location) there should be just one possible tile t for each coordinate (given it was a successful generation). The value at this point will be an int index of the corresponding tile in model.Tiles[t]. Do you think you'd be able to use this for your task? If not, let me know. Happy to answer more questions:)

shawnridgeway avatar Dec 20 '19 19:12 shawnridgeway

No i think that will be fine, i was a little thrown off by the array of tiles!

... hmm now that I'm looking at the data, since the basemodel.Tiles array only holds the pixels for each tile that can be a little hard to track back to which simpletilemodel tile/variant we're talking about at that point. Let me try some things...

SleepyBrett avatar Dec 20 '19 19:12 SleepyBrett