{"id":99,"date":"2017-08-31T00:19:18","date_gmt":"2017-08-31T00:19:18","guid":{"rendered":"http:\/\/www.dannywynne.com\/blog\/?p=99"},"modified":"2017-08-31T00:50:15","modified_gmt":"2017-08-31T00:50:15","slug":"wave-function-collapse-level-generator","status":"publish","type":"post","link":"http:\/\/www.dannywynne.com\/blog\/?p=99","title":{"rendered":"Wave Function Collapse Level Generator"},"content":{"rendered":"<blockquote class=\"twitter-tweet\" data-lang=\"en\">\n<p lang=\"en\" dir=\"ltr\">3d tile placement with WFC.This algorithm is amazing. Inspired by <a href=\"https:\/\/twitter.com\/OskSta\">@OskSta<\/a> and based on <a href=\"https:\/\/twitter.com\/ExUtumno\">@ExUtumno<\/a> work <a href=\"https:\/\/twitter.com\/hashtag\/screenshotsaturday?src=hash\">#screenshotsaturday<\/a> <a href=\"https:\/\/twitter.com\/hashtag\/gamedev?src=hash\">#gamedev<\/a> <a href=\"https:\/\/twitter.com\/hashtag\/indiedev?src=hash\">#indiedev<\/a> <a href=\"https:\/\/t.co\/CIWKLZwnhi\">pic.twitter.com\/CIWKLZwnhi<\/a><\/p>\n<p>&mdash; Danny Wynne (@dwtw) <a href=\"https:\/\/twitter.com\/dwtw\/status\/810166761270243328\">December 17, 2016<\/a><\/p><\/blockquote>\n<p><script async src=\"\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script><br \/>\nThis is probably the most challenging project I&#8217;ve tackled. I was inspired by <a href=\"https:\/\/twitter.com\/osksta?lang=en\">Oskar St\u00c3\u00a5lberg&#8217;s<\/a> work using the techniques from <a href=\"https:\/\/twitter.com\/ExUtumno?ref_src=twsrc%5Etfw&#038;ref_url=http%3A%2F%2Fwww.dannywynne.com%2Fblog%2F\">@ExUtumno<\/a>&#8216;s project (<a href=\"https:\/\/github.com\/mxgmn\/WaveFunctionCollapse\">github.com\/mxgmn\/WaveFunctionCollapse<\/a>). I wondered, could I do this too? As soon as I started, I was hooked. About 80% of the work was pipeline related. It would be prohibitively tedious to complete this project without things like &#8220;auto edge detection&#8221; and easy export\/import + tile validation scripts. I ended up with about 60 tiles, built in Maya. The Ambient Occlusion is also a clever technique from <a href=\"https:\/\/twitter.com\/osksta?lang=en\">Oskar St\u00c3\u00a5lberg<\/a>. It uses inside\/outside data from the tiles to create a 3d texture. <\/p>\n<p>My implementation includes backtracking, so if the algorithm hits a dead end it efficiently backs up to a valid state and continues down a new route. It also has &#8220;multi tiles&#8221;, which are set pieces that take up multiple tile spaces.<\/p>\n<p>In the future, I want add the ability for the algorithm to solve in large spaces, even infinite spaces. I would do this by breaking the world into chunks, then solve each chunk using it&#8217;s neighbors edge data. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>3d tile placement with WFC.This algorithm is amazing. Inspired by @OskSta and based on @ExUtumno work #screenshotsaturday #gamedev #indiedev pic.twitter.com\/CIWKLZwnhi &mdash; Danny Wynne (@dwtw) December 17, 2016 This is probably the most challenging project I&#8217;ve tackled. I was inspired by Oskar St\u00c3\u00a5lberg&#8217;s work using the techniques from @ExUtumno&#8216;s project (github.com\/mxgmn\/WaveFunctionCollapse). I wondered, could I do [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-99","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"http:\/\/www.dannywynne.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/99","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.dannywynne.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.dannywynne.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.dannywynne.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.dannywynne.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=99"}],"version-history":[{"count":0,"href":"http:\/\/www.dannywynne.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/99\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.dannywynne.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=99"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.dannywynne.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=99"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.dannywynne.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=99"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}