{"id":504,"date":"2025-02-14T15:40:29","date_gmt":"2025-02-14T21:40:29","guid":{"rendered":"https:\/\/www.dphrygian.com\/wordpress\/?p=504"},"modified":"2025-02-14T15:40:29","modified_gmt":"2025-02-14T21:40:29","slug":"devs-journal-14-feb-2025","status":"publish","type":"post","link":"https:\/\/www.dphrygian.com\/wordpress\/?p=504","title":{"rendered":"Dev&#8217;s Journal &#8211; 14 Feb 2025"},"content":{"rendered":"\n<p>Nothing too exciting to write about today. I decided to deal with some gamedev housecleaning, and began the tedious process of culling old and unused content from the <em>Eldritch 2<\/em> repository.<\/p>\n\n\n\n<p>I begin all my game projects by forking a common repository which has a lot of leftover features from various games and game jams I&#8217;ve done over the past decade. I&#8217;m still pulling in a lot of content from <em>Slayer Shock<\/em>, which is over 8 years old now. There&#8217;s some benefit to that, because it gives me weapons and enemies and other stuff to work with, which helps to jumpstart any new project; but at some point, I have to clean it up. Not only is it wasted space in the game&#8217;s package files, but it&#8217;s a lot of overhead when I&#8217;m scrolling through the game&#8217;s scripts and trying to figure out what is actually being used anymore.<\/p>\n\n\n\n<p>I&#8217;ve got a tool that will report any unused assets in package files, and that is helpful to identify large categories of unused content; but the more tedious work is cleaning up the scripts. I&#8217;d previously interleaved some common enemy and weapon functions with old enemy and weapon definitions, and now I have to carefully review everything I&#8217;m culling to be sure I don&#8217;t delete something that is still in use. I&#8217;ve learned my lesson, and in the future, I&#8217;ll make sure that common functions are clearly labeled and placed somewhere far away from specific entity scripts.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>While making a dozen or so builds to test these changes, I realized that my audio package files were changing with each build, despite me not touching audio files or configurations. That&#8217;s no good. My goal is that I can always make a clean build of the game and end up with bitwise identical output.<\/p>\n\n\n\n<p>Diffing the old and new package files, it was obvious that the changes were occurring in Ogg Vorbis headers; a quick review of that format confirmed that there is a bitstream identifier field in Ogg Vorbis files which is <em>intentionally<\/em> randomly generated. That&#8217;s A Choice They Made, I guess. So I dug through ffmpeg code to find a way to change that behavior (the <code>-bitexact<\/code> flag fixed it), and I made sure that that random identifier was not needed for my purposes (it&#8217;s not\u2014in fact, the <code>stb_vorbis<\/code> library I&#8217;m using simply scans past it).<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>I need to do some more playtesting this afternoon to make absolutely sure I haven&#8217;t broken anything. And the work of cleaning up old content will continue, because there are still a handful of weapons and animations and audio files I&#8217;m reusing from old projects until I can replace them. But the repository is already much lighter and cleaner, and I reduced the game&#8217;s install size by 35%, and subsequent patches should be smaller now that the audio packages aren&#8217;t being randomized. Feels good.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Nothing too exciting to write about today. I decided to deal with some gamedev housecleaning, and began the tedious process of culling old and unused content from the Eldritch 2 repository. I begin all my game projects by forking a common repository which has a lot of leftover features from various games and game jams [&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-504","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\/504"}],"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=504"}],"version-history":[{"count":1,"href":"https:\/\/www.dphrygian.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/504\/revisions"}],"predecessor-version":[{"id":505,"href":"https:\/\/www.dphrygian.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/504\/revisions\/505"}],"wp:attachment":[{"href":"https:\/\/www.dphrygian.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=504"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dphrygian.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=504"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dphrygian.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=504"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}