Coder Social home page Coder Social logo

Comments (4)

TLINDEN avatar TLINDEN commented on August 11, 2024

Update: to show what I mean: This is what I'd need:

tilemap

So, I need (in this case) closed room[s]. Rooms maybe connected but if they are not, it's fine as well because in my game I have portals.

However, this is what I get currently:

1713800998972048693

1713800997667559958

1713800888055180949

How can I solve this?

from go-wfc.

TLINDEN avatar TLINDEN commented on August 11, 2024

So, I tried adding the feature myself, which might be a good opportunity to get deeper into WFC, see TLINDEN@c75a953

However, it's not working yet. I assume I got the slot population wrong somehow?

With this pre-populated output map:
default

And using this example I get:
1713873040680044960

:(

from go-wfc.

TLINDEN avatar TLINDEN commented on August 11, 2024

Ok, I compared the wave.PossibilitySpace contents after one successful example (examples/islands/) with the content of the pre-populated one:

  • Each pre-populated slot has 1 module
  • all 4 Adjacency checksums of those slots have the same value (since I pre-populated it with only water tiles)
  • all non-pre-populated slots have all 16 modules

I also added a dump function. With the unaltered island example I get this PossibilitySpace on startup: island startup and this one when done. In comparision, I get this space on startup with the island-pre example (which uses pre-population) and this result, which is clearly incomplete.

I really don't get it why it's not working.

Any idea? (example: https://github.com/TLINDEN/go-wfc/tree/main/examples/islands-pre)

from go-wfc.

TLINDEN avatar TLINDEN commented on August 11, 2024

Ah, there's the problem: I prepopulate wave.PossibilitySpace with the slots of the setup image. But I set all other slots to any, including the ones neighboring the prepopulated ones. And the loop doesn't look at the prepopulated slots, because they have entropy 1. So, I think, their neighbors do not get a chance to get propagated properly. So in order to get a correct starting map, the propagation needs to run over the whole map once before the actual collapse loop.

from go-wfc.

Related Issues (2)

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.