{"id":13663230,"url":"https://github.com/selfsame/unity-wave-function-collapse","last_synced_at":"2025-04-09T20:14:23.765Z","repository":{"id":37759255,"uuid":"72290934","full_name":"selfsame/unity-wave-function-collapse","owner":"selfsame","description":null,"archived":false,"fork":false,"pushed_at":"2020-11-05T01:19:30.000Z","size":126,"stargazers_count":315,"open_issues_count":6,"forks_count":43,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-04-09T20:13:56.918Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/selfsame.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-29T14:53:32.000Z","updated_at":"2025-02-25T02:53:08.000Z","dependencies_parsed_at":"2022-07-12T16:44:56.273Z","dependency_job_id":null,"html_url":"https://github.com/selfsame/unity-wave-function-collapse","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selfsame%2Funity-wave-function-collapse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selfsame%2Funity-wave-function-collapse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selfsame%2Funity-wave-function-collapse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selfsame%2Funity-wave-function-collapse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/selfsame","download_url":"https://codeload.github.com/selfsame/unity-wave-function-collapse/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248103872,"owners_count":21048245,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T05:02:21.872Z","updated_at":"2025-04-09T20:14:23.730Z","avatar_url":"https://github.com/selfsame.png","language":"C#","funding_links":[],"categories":["C\\#","Game Development"],"sub_categories":["Unity Engine: Resources"],"readme":"# Unity WaveFunctionCollapse\n\nA fork of [https://github.com/mxgmn/WaveFunctionCollapse](https://github.com/mxgmn/WaveFunctionCollapse) with tools for the Unity Game engine.\n\n# Installation\n\nClone this repo under your projets `Assets` directory, or import a unity package asset from\n[http://selfsame.itch.io/unitywfc](http://selfsame.itch.io/unitywfc).\n\n# Usage\n\n## video tutorial\n\n[https://www.youtube.com/watch?v=CTJJrC3BAGM](https://www.youtube.com/watch?v=CTJJrC3BAGM)\n\n\n## Training\n\nTraining 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 the `compile` button.  \n\nWhitespace (no object) is recorded for the OverlapWFC, but ignored for the SimpleTiledWFC.\n\nNOTE: for SimpleTiledWFC all prefabs must be located within an `Assets/Resources` directory!\n\n## TilePainter\n\nSimple tilemap painting utility to help create training data.  To paint, assign it's `color` prefab property and hover over the canvas region with the TilePainter's object selected.\n\nAdding objects to the `palette` array will show them below the canvas area, palette or painted tiles can be sampled by holding the [s] key and clicking on them.\n\nNote: You can drag a folder of prefabs from under `Assets/Resources` onto the palette array!\n\n\n## OverlapWFC\n\nGenerates output from a Training sample.  On `Start` will compile it's training component, generate, and run.\n\nNOTE: 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.\n\n* seed: `0` for randomized\n* N: size of the overlap patterns (this is hidden in the inspector, as higher values can often freeze Unity)\n* Periodic Input: repeating sample pattern\n* Periodic Output: repeating output pattern\n* Symmetry: sample grid re-read with additional rotation/reflection variations. Note: rotation of sample tiles will only make sense for symmetry-1 output\n* Iterations: 0 will run until finished/unfinishable. Also used by incremental output.\n* Incremental: Runs iterations every update in play mode.\n\n## SimpleTiledWFC\n\nThis 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\"`.\n\nWhitespace is ignored in the neighbor scan, and can be used as margins to isolate neighbors.  Training components have a `weight` array for neighbor xml.\n\nNOTE: Prefabs must be located within `Assets/Resources` or a subdirectory within. \n\n### `X` `I` `T` `L`\n\nTile symmetry class can be declared via the last letter of the prefab name, for example \"GroundX\" or \"Road-T\".\n\nNote: `L` tiles have an initial orientation of \n```\nOO\nOX\n```\n\n## API\n\nBoth models have a `public GameObject[,] rendering;` 2d array that stores their output.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fselfsame%2Funity-wave-function-collapse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fselfsame%2Funity-wave-function-collapse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fselfsame%2Funity-wave-function-collapse/lists"}