{"id":236,"date":"2024-02-17T23:06:17","date_gmt":"2024-02-18T05:06:17","guid":{"rendered":"https:\/\/www.dphrygian.com\/wordpress\/?p=236"},"modified":"2024-02-19T10:29:08","modified_gmt":"2024-02-19T16:29:08","slug":"the-style","status":"publish","type":"post","link":"https:\/\/www.dphrygian.com\/wordpress\/?p=236","title":{"rendered":"The Style"},"content":{"rendered":"\n<p>Making art is one of my least favorite parts of game development. I&#8217;m not good at it, it&#8217;s slow (maybe because I&#8217;m not good at it), and my best efforts still look subpar (definitely because I&#8217;m not good at it). If I were a vampire and could devote a decade or two to immersing myself in art the way I&#8217;ve immersed myself in programming and design and music, I could probably git gud. But I&#8217;ve got a finite number of years on this rock, and games to make in the meantime.<\/p>\n\n\n\n<p>Five years ago, I started learning Substance Designer. I studied other artists&#8217; graphs and picked up a bunch of neat tricks. I made a template to convert Designer&#8217;s material properties into the ones my engine expected, and wrote a custom shader to preview materials in Designer the way they&#8217;d look in my engine. I liked the non-destructive workflow, and the logical\/mathematical basis for texture creation. But I don&#8217;t like being tethered to a proprietary tool. My engine and content pipeline are built on free and open source libraries and tools; and while my old Steam copy of Substance Designer 2019 does still work, it felt like a liability to depend on an app that I can&#8217;t run without an internet connection. I stopped using Designer and went back to making textures by hand. But a seed was planted.<\/p>\n\n\n\n<p>I&#8217;ve got a Trello board for long-term game and tech ideas\u2014the sort of place I&#8217;ll write a card like &#8220;Vehicles!&#8221; and then sit on it for years until I end up making a game that actually wants or needs vehicles. In December 2022, in the middle of working on <a href=\"https:\/\/dphrygian.itch.io\/lil-taffer\"><em>Li&#8217;l Taffer<\/em><\/a>, fed up with making textures, I wrote a card titled &#8220;I should make an offline texture generator using a lot of the standard patterns I&#8217;ve used for pixeling stuff.&#8221; Wild idea, that would probably never happen. Six months later, I actually started building it.<\/p>\n\n\n\n<p>The fundamental <em>click<\/em> that helped me jump from a vague idea into writing code was realizing that almost all the textures I was making were built in boxes. I didn&#8217;t need to make a texture generator that could do lush organic features; I already lived in the realm of bricks and tiles, and most of what I was doing to make those textures could easily be codified. I drew up a list of use cases that I wanted my texture generator to cover, and 99% of them could be broken down into nested boxes with a few common procedural functions.<\/p>\n\n\n\n<p>So, I started coding! I named the project Piet, inspired by Dutch painter Piet Mondrian&#8217;s nested rectangular forms, and I got a proof-of-concept done pretty quickly:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/www.dphrygian.com\/wordpress\/wp-content\/uploads\/2024\/02\/image.png\"><img loading=\"lazy\" decoding=\"async\" width=\"626\" height=\"611\" src=\"https:\/\/www.dphrygian.com\/wordpress\/wp-content\/uploads\/2024\/02\/image.png\" alt=\"\" class=\"wp-image-237\" srcset=\"https:\/\/www.dphrygian.com\/wordpress\/wp-content\/uploads\/2024\/02\/image.png 626w, https:\/\/www.dphrygian.com\/wordpress\/wp-content\/uploads\/2024\/02\/image-300x293.png 300w\" sizes=\"(max-width: 626px) 100vw, 626px\" \/><\/a><figcaption class=\"wp-element-caption\"><em>I used to be on Twitter.<\/em><\/figcaption><\/figure><\/div>\n\n\n<p>And then I got busy with Real Life, and I put Piet (and <em>Eldritch 2<\/em>) aside for a while. In September 2023, I started working on <em><a href=\"https:\/\/dphrygian.itch.io\/schloss-der-woelfe\">Schloss der W\u00f6lfe<\/a><\/em>, which was my first practical use case for Piet. I <a href=\"https:\/\/www.dphrygian.com\/wordpress\/?p=187\">added a few features<\/a>, but struggled to make my proof-of-concept tool deliver the materials I wanted. I made a list of things I needed to improve in the future.<\/p>\n\n\n\n<p>This month, <a href=\"https:\/\/www.dphrygian.com\/wordpress\/?p=225\">with level generation in the rear view mirror<\/a>, I&#8217;ve finally revisited Piet and checked off all those tasks I&#8217;d written last year. The schema is now a proper functional language (i.e., with function calls!), reducing a ton of copy-pasted definitions. I&#8217;ve added support for water flow materials and decal materials. And I&#8217;ve rewritten my material definitions to be primarily height-based, with other properties like normals and smoothness derived from height.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/www.dphrygian.com\/wordpress\/wp-content\/uploads\/2024\/02\/image-1.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"593\" src=\"https:\/\/www.dphrygian.com\/wordpress\/wp-content\/uploads\/2024\/02\/image-1-1024x593.png\" alt=\"\" class=\"wp-image-238\" srcset=\"https:\/\/www.dphrygian.com\/wordpress\/wp-content\/uploads\/2024\/02\/image-1-1024x593.png 1024w, https:\/\/www.dphrygian.com\/wordpress\/wp-content\/uploads\/2024\/02\/image-1-300x174.png 300w, https:\/\/www.dphrygian.com\/wordpress\/wp-content\/uploads\/2024\/02\/image-1-768x444.png 768w, https:\/\/www.dphrygian.com\/wordpress\/wp-content\/uploads\/2024\/02\/image-1-1536x889.png 1536w, https:\/\/www.dphrygian.com\/wordpress\/wp-content\/uploads\/2024\/02\/image-1.png 1602w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\"><em>Screenshot from an early version of <\/em>Eldritch 2<em>. All materials are generated in Piet.<\/em><\/figcaption><\/figure><\/div>\n\n\n<p>Why do I do this, when there are existing tools that do this sort of thing better? Maybe I&#8217;m just stubborn, or maybe I just enjoy this work. I think it&#8217;s the latter. I&#8217;m a programmer at heart, and making my little tool with my little domain-specific language&#8230; it sparks joy. I&#8217;m still bad at art, but at least I&#8217;m having fun making it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Making art is one of my least favorite parts of game development. I&#8217;m not good at it, it&#8217;s slow (maybe because I&#8217;m not good at it), and my best efforts still look subpar (definitely because I&#8217;m not good at it). If I were a vampire and could devote a decade or two to immersing myself [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-236","post","type-post","status-publish","format-standard","hentry","category-eldritch-2"],"_links":{"self":[{"href":"https:\/\/www.dphrygian.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/236"}],"collection":[{"href":"https:\/\/www.dphrygian.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dphrygian.com\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dphrygian.com\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dphrygian.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=236"}],"version-history":[{"count":5,"href":"https:\/\/www.dphrygian.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/236\/revisions"}],"predecessor-version":[{"id":247,"href":"https:\/\/www.dphrygian.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/236\/revisions\/247"}],"wp:attachment":[{"href":"https:\/\/www.dphrygian.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=236"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dphrygian.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=236"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dphrygian.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=236"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}