Comments (13)
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.
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.
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.
@ejmahler Btw, what other interesting samples have you discovered?
from wavefunctioncollapse.
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.
@Asmageddon Pepe:
from wavefunctioncollapse.
@mxgmn What is the dot tick?
from wavefunctioncollapse.
@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.
Ah, interesting. Thanks for the explanation!
from wavefunctioncollapse.
@mxgmn Haha that's funky. Have you thought about fixing edges, or doing histogram matching to ensure one distribution or another?
from wavefunctioncollapse.
@Asmageddon Sure. This repo contains the very basic version of WFC, one could also tune it, add other heuristics for specific needs.
from wavefunctioncollapse.
@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.
@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)
- [not an issue] using this algorithm in a game engine plug-in HOT 1
- potentially erroneous entropy calculation HOT 1
- Java implementation HOT 1
- Neighbor constraints do not always appear to be enforced HOT 6
- Can't run it on Mac OS HOT 4
- Deadlock when collapsing HOT 4
- "Voxel models generated with WFC and other algorithms will be in a separate repo." HOT 2
- Reuse parts of outcome as constraints, and still obtain the same outcome? HOT 5
- Implementation in C HOT 2
- Description of entropy HOT 1
- Return value of Propagate HOT 5
- How to generate an XML data file for simpletiled from an image file? HOT 1
- Unable to get the program to work in Windows 10 HOT 11
- 太棒了!!!
- Please comment the code! HOT 6
- This project is using the name "Wave function collapse" for a process that is not the physics Wave Function Collapse HOT 2
- N values above 3 hang HOT 1
- Suggestion for a different name: Sudoku Collapse HOT 2
- Generate from a pre-defined output image HOT 4
- What is the best way to enforce some tiles (simple tiled model) to not be rotated? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wavefunctioncollapse.