Git Product home page Git Product logo

Comments (13)

tomprogrammer avatar tomprogrammer commented on April 28, 2024 1

The problem is, that an overflow occurs in the calculation of the index, which is of type int. In your case of 3 distinct colors and a pattern size of 5 the maximum index is 3^(5*5) which can't be represented by the int type.

Reference: OverlapplingModel.cs:51

from wavefunctioncollapse.

mxgmn avatar mxgmn commented on April 28, 2024

Yes, the issue is in the integer overflow. A fast fix is to make index long integer, a better one is to abolish indices altogether, I'll update the code.

from wavefunctioncollapse.

mxgmn avatar mxgmn commented on April 28, 2024

A "better" way turned out to be not that good, so I just made indices long.

@ejmahler Here are the results generated from your sample: N=5, N=4 and two N=3 with a dot trick from rid5x to make rooms bigger:

from wavefunctioncollapse.

mxgmn avatar mxgmn commented on April 28, 2024

@ejmahler Btw, what other interesting samples have you discovered?

from wavefunctioncollapse.

Asmageddon avatar Asmageddon commented on April 28, 2024

Personally I'm really curious what this would look on things that aren't patterns. For example, the pepe: https://www.quickhoney.com/image/pepe_ani_1

It'd probably do well with some color reduction, and the additional-color trick to prevent it from "looping"

from wavefunctioncollapse.

mxgmn avatar mxgmn commented on April 28, 2024

@Asmageddon Pepe:

from wavefunctioncollapse.

tomprogrammer avatar tomprogrammer commented on April 28, 2024

@mxgmn What is the dot tick?

from wavefunctioncollapse.

mxgmn avatar mxgmn commented on April 28, 2024

@tomprogrammer Placing dots in spacious areas of the input to make corresponding areas of the output bigger. See the attached results, I placed little gray dots in white rooms in your Office sample.

from wavefunctioncollapse.

tomprogrammer avatar tomprogrammer commented on April 28, 2024

Ah, interesting. Thanks for the explanation!

from wavefunctioncollapse.

Asmageddon avatar Asmageddon commented on April 28, 2024

@mxgmn Haha that's funky. Have you thought about fixing edges, or doing histogram matching to ensure one distribution or another?

from wavefunctioncollapse.

mxgmn avatar mxgmn commented on April 28, 2024

@Asmageddon Sure. This repo contains the very basic version of WFC, one could also tune it, add other heuristics for specific needs.

from wavefunctioncollapse.

ejmahler avatar ejmahler commented on April 28, 2024

@mxgmn I'm especially interested in the office building layouts. Similar to the dot trick, I've been lining the border of rooms with a distinct color if I want to enforce a maximum size which is larger than N.

And similar to using a color to mark doorways (Probably unnecessary tbh) I've been using a color to mark hallway entrances. If you look at the dot trick outputs, there are lots of giant rooms that snake back and forth, specifically marking corners fixes that.

BTW do you have any guidance for where to start if I want to introduce some constraints into the OverlappingModel algorithm? There are gif examples of constraints, but it's not obvious where to start to actually use them.

from wavefunctioncollapse.

mxgmn avatar mxgmn commented on April 28, 2024

@ejmahler Or placing dots in walls or in corners, yes.

About constraints, let me copy part of the conversation from another place:

"To start with constraints look how foundation (now ground) param is handled.

Foundation is a special case of constraint. I use it in examples like Flowers, City, Platformer to make the ground level be at the bottom of the output. If you delete the foundation param from samples.xml, you'll see that ground appears anywhere in the middle of an output, not necessary at the bottom. So in Clear() setting foundation consists of 2 steps: setting the bottom line to be of foundation patterns, and then forbidding foundation patterns anywhere else. If you comment the second part, you'll see that it produces cities or platformer levels with several ground levels.

General constraints work the same way. Even simpler way, actually. First, you need to make some true values in the wave false. And then call propagation cycle while(Propagate());. Just be careful not to make contradictive constraints. The easiest constraint looks like this:

for (int t = 0; t < T; t++) wave[5][6][t] = (t == 9); while(Propagate());

T is the total number of elementary options (tiles or patterns, depending on the model)."

Let me know if you have any trouble with constraints. I think I will record a video with interactive constraining in the overlapping model in a week or two.

from wavefunctioncollapse.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.