Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Pinning" and filling around existing content? #3

Open
justonia opened this issue Oct 24, 2018 · 3 comments
Open

"Pinning" and filling around existing content? #3

justonia opened this issue Oct 24, 2018 · 3 comments

Comments

@justonia
Copy link
Contributor

justonia commented Oct 24, 2018

In this example I have created a custom constraint that uses Select() to "pin" areas (cyan regions) of my output such that it has to be present in its exact configuration in another generation:

image

Cyan regions remain in new output:

image

This works fine, because each cyan region contains tiles that do not contradict with the rules of the input model. However if I attempt to pin a region that does not follow the rules on its interior:

image

I get an immediate contradiction after the Select call since the pinned region has water tiles next to water tiles and that is not defined in the input model.

If I wanted to make this work I could of course add water next to water in my model. The downside is that now my output will contain lakes. I see two potential options as an enhancement that might allow for this:

  • Output topography with holes? #2 if supported/added support - For each interior point in a pinned region, explicitly add a hole in the output. Edges of the pinned regions must not cause a contradiction still. This is perfectly reasonable IMHO.
  • Via a call to AddSample, explicitly add water next to water, but somehow give it an output probability of 0, thus ensuring lakes wouldn't show up.
  • In the pinning constraint Check method, search for any region in the output that matches the interior of the pinned area. This seems really, really intensive.

Do any of these sound like reasonable solutions?

@BorisTheBrave
Copy link
Owner

You can add some lake samples, then call MultiplyFrequency to set the frequency of the the lake tile to zero. Then it is legal to place, but WCF will never choose to place it (unless it is the only legal placement). In your case, you still want rivers to be placed, so you'll want two different tiles, one for lakes and one for rivers.

I'll have a think about if there's a neater way to do things like this. Perhaps an option on Select that lets you ignore compatibility?

@justonia
Copy link
Contributor Author

I'll give MultiplyFrequency a shot with some special tiles. Being able to force Select into setting a tile might be a good quick way to accomplish this. Combined with #2, you'd end up having a lot of new controls on how content gets generated.

@BorisTheBrave
Copy link
Owner

Ok, I've had a thought about what you want. I think you won't find adding holes alone sufficient. Holes would be totally ignored, you want a tile to influence other tiles, but not be influenced itself. I think it'll be possible to set up another bit field for that behaviour.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants