Coder Social home page Coder Social logo

Comments (3)

AlexeyBond avatar AlexeyBond commented on June 12, 2024

Hi. I didn't test this addon with isometric tiles (and don't have any significant experience working with isometric tiles in general). But I can assume that tileset layout is the issue here. If I get it right, then by default coordinate axes in isometric tilemaps are aligned with X and Y axes. So, when WFC looks for neighbours of a cell in map it will look at cells below/above it or to left/right of it. To work properly it should look at cells that share an edge with current cells. Try using a tileset with "diamond" layout. In this casee coordinate axes will be aligned along cell edges. But generated regions will also have a diamond shape.

if I place a tile by itself on the negative sample example will that be understood that that tile should never be placed, or will it understand that I mean to say that that tile should never be alone?

A single tile will be just ignored. The algorithm looks at combinations of tiles in negative sample.

Also, negative sample is ignored when complete_matrices is set to false, since it is meant to remove combinations introduced by that "completions".

from godot-constraint-solving.

TwistedPorkchop avatar TwistedPorkchop commented on June 12, 2024

Thank you for your answer, I will try and use the diamond layout instead and see if there is an improvement.

I have a couple more questions about the Negative tile sets.
I believe I understand that the WFC generator takes into consideration directionality. As in combination, AB and BA are different, is that correct? Also on that topic, in a 2d example if I put the combination AB or ABA in the negative sample would the combination of

A      A
B  or  B
       A

Be considered a possible correct combination, or would the generator infer that as something not to generate? Basically I'm wondering how much I have to spoon feed the generator with possible "illegal" shapes for it not to generate. Like if I don't want to see a T formation of tiles do I have to draw all the orientations in the negative sample? Also how can we avoid tiles being by themselves or in a X pattern? like:

ABB
BAB
BBA

Do I have to draw those in the negative as well?

from godot-constraint-solving.

AlexeyBond avatar AlexeyBond commented on June 12, 2024

As in combination, AB and BA are different, is that correct?

Yes, that's indeed correct.

Also how can we avoid tiles being by themselves or in a X pattern?

The generator looks at pairs of cells and its neighbours, one pair at once and checks what tiles are allowed by tiles that cell's neighbour may have.

So it's not possible to add rules like "tile A should have at least one neighbour of type A" (if I got you right, that's what you mean by "avoid tiles being by themselves") without some complicated rules customization.
Same goes for patterns like

A*A
*A*
A*A

and alike.
It's possible to forbid

A*
*A

by adding additional axes (assuming standard axes are horizontal and vertical).
But that will also forbid patterns like

AA
AA

It seems to me that wave function collapse algorithm may be not what you really need for your project.
Wave function collapse works well when you need to enforce some very local rules to make tiles fit their neighbours.
You are trying to generate some global structure consisting of lots of tiles.
Rules for such structures will be difficult (if possible at all) to implement using WFC.
It may make more sense to use a different algorithm to generate a global structure.
And then, maybe, use WFC to decide on specific tiles to use.
For example, if there are multiple building part tiles to combine them into consistent buildings.
But that step may be unnecessary, depending on your actual tileset.

from godot-constraint-solving.

Related Issues (14)

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.