Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

License

NotificationsYou must be signed in to change notification settings

selfsame/unity-wave-function-collapse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A fork ofhttps://github.com/mxgmn/WaveFunctionCollapse with tools for the Unity Game engine.

Installation

Clone this repo under your projetsAssets directory, or import a unity package asset fromhttp://selfsame.itch.io/unitywfc.

Usage

video tutorial

https://www.youtube.com/watch?v=CTJJrC3BAGM

Training

Training components define sample data from their child objects. The contained objects must have a prefab connection. Rotation of objects are recorded. The OverlapWFC component will auto compile it's training on Start, in editor mode you will need to use thecompile button.

Whitespace (no object) is recorded for the OverlapWFC, but ignored for the SimpleTiledWFC.

NOTE: for SimpleTiledWFC all prefabs must be located within anAssets/Resources directory!

TilePainter

Simple tilemap painting utility to help create training data. To paint, assign it'scolor prefab property and hover over the canvas region with the TilePainter's object selected.

Adding objects to thepalette array will show them below the canvas area, palette or painted tiles can be sampled by holding the [s] key and clicking on them.

Note: You can drag a folder of prefabs from underAssets/Resources onto the palette array!

OverlapWFC

Generates output from a Training sample. OnStart will compile it's training component, generate, and run.

NOTE: Using rotation specific tiles will only give nice results for symmetry 1 generation. Personally I like to use rotation for the overlap model, with a larger training area to make up for the loss of symetry variants.

  • seed:0 for randomized
  • N: size of the overlap patterns (this is hidden in the inspector, as higher values can often freeze Unity)
  • Periodic Input: repeating sample pattern
  • Periodic Output: repeating output pattern
  • Symmetry: sample grid re-read with additional rotation/reflection variations. Note: rotation of sample tiles will only make sense for symmetry-1 output
  • Iterations: 0 will run until finished/unfinishable. Also used by incremental output.
  • Incremental: Runs iterations every update in play mode.

SimpleTiledWFC

This model uses XML data representing legal tile neighbors. The Training component has a "record neighbors" command to generate these files, the file is saved to"Assets/{{trainingGameObject.name}}.xml".

Whitespace is ignored in the neighbor scan, and can be used as margins to isolate neighbors. Training components have aweight array for neighbor xml.

NOTE: Prefabs must be located withinAssets/Resources or a subdirectory within.

XITL

Tile symmetry class can be declared via the last letter of the prefab name, for example "GroundX" or "Road-T".

Note:L tiles have an initial orientation of

OOOX

API

Both models have apublic GameObject[,] rendering; 2d array that stores their output.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp