{"id":10984,"date":"2025-02-24T07:21:09","date_gmt":"2025-02-24T07:21:09","guid":{"rendered":"https:\/\/www.gamelab.ch\/?p=10984"},"modified":"2025-02-24T07:21:09","modified_gmt":"2025-02-24T07:21:09","slug":"codedemo-a-256-byte-pico8-demo-that-creates-as-much-executable-lua-code-as-possible-lovebyte-wild-schowcase","status":"publish","type":"post","link":"https:\/\/www.gamelab.ch\/?p=10984","title":{"rendered":"CodeDemo &#8211; a 256-byte Pico8 demo that creates as much executable Lua code as possible (lovebyte, wild schowcase)"},"content":{"rendered":"\n<figure class=\"wp-block-video\"><video controls src=\"https:\/\/www.gamelab.ch\/wp-content\/uploads\/2025\/02\/video-1.mp4\"><\/video><\/figure>\n\n\n\n<p>It&#8217;s one of the most fundamental questions in the demoscene: why is there almost no visible source code in demos, even though it&#8217;s actually all about code. Ultimately, that&#8217;s where the magic is, the magic. This is especially true for the sub-genre of size coding. It is always about the &#8211; scientific &#8211; once important, now rather obsolete &#8211; question: What is the smallest algorithm to solve a problem?<\/p>\n\n\n\n<p>One can now answer: Why should you? It&#8217;s just distracting! Neither the performing arts, nor texts, nor theater, nor film usually do that. But there is the 4th wall breakthrough, there is the Dada way of creating a poem or the algoart that exposes its constructions (such as Tinguely), where you are sometimes even standing in the construction. All these works of art break the cage of construction and allow us to look into the algorithms, ultimately deconstructing the simple consumption of \u201cAhhh\u201d or \u201cOhh\u201d or making it even more incredible. The Magic Circle itself becomes the subject. It would therefore be an empowerment. And one difference to older physical algoart is that digital algoart is not carried out by machines or humans but by computers. So we write to computers first and not to people.<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>In the demo \u201cCodeDemo\u201d released on <a rel=\"noreferrer noopener\" href=\"https:\/\/lovebyte.party\" target=\"_blank\">LoveBytes 2025<\/a>, the whole thing is now reversed. The code becomes the main part, the output.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"1024\" height=\"665\" src=\"https:\/\/www.gamelab.ch\/wp-content\/uploads\/2025\/02\/picture-1024x665.png\" alt=\"\" class=\"wp-image-10985\" srcset=\"https:\/\/www.gamelab.ch\/wp-content\/uploads\/2025\/02\/picture-1024x665.png 1024w, https:\/\/www.gamelab.ch\/wp-content\/uploads\/2025\/02\/picture-300x195.png 300w, https:\/\/www.gamelab.ch\/wp-content\/uploads\/2025\/02\/picture-768x499.png 768w, https:\/\/www.gamelab.ch\/wp-content\/uploads\/2025\/02\/picture-1536x998.png 1536w, https:\/\/www.gamelab.ch\/wp-content\/uploads\/2025\/02\/picture-2048x1330.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>256 bytes of Pico8 LuaCode generates as much executable code as possible with comments. Here the demo creates as concrete code (not your own &#8211; this was also tried out).<\/p>\n\n\n\n<p>First, all variables are instantiated, which are then assembled.<\/p>\n\n\n\n<figure class=\"wp-block-video\"><video controls src=\"https:\/\/www.gamelab.ch\/wp-content\/uploads\/2025\/02\/video-1.mp4\"><\/video><\/figure>\n\n\n\n<p>The string with the name \u201cdemo\u201d is filled in continuously and endlessly. However, the process can also simply be read infinitely as new source code. The result is obviously a demo that gets longer and longer.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"910\" height=\"188\" src=\"https:\/\/www.gamelab.ch\/wp-content\/uploads\/2025\/02\/Bildschirmfoto-2025-02-09-um-16.23.43.png\" alt=\"\" class=\"wp-image-10989\" srcset=\"https:\/\/www.gamelab.ch\/wp-content\/uploads\/2025\/02\/Bildschirmfoto-2025-02-09-um-16.23.43.png 910w, https:\/\/www.gamelab.ch\/wp-content\/uploads\/2025\/02\/Bildschirmfoto-2025-02-09-um-16.23.43-300x62.png 300w, https:\/\/www.gamelab.ch\/wp-content\/uploads\/2025\/02\/Bildschirmfoto-2025-02-09-um-16.23.43-768x159.png 768w\" sizes=\"(max-width: 910px) 100vw, 910px\" \/><\/figure>\n\n\n\n<p> <\/p>\n\n\n\n<p>Calculations are performed in the memory, variables are drawn, circles are drawn, etc.This is what normally happens in a demo.<\/p>\n\n\n\n<p>The code for this is quite simple (but does not appear in the demo). As with the Dada poem, it goes without saying that chance rules.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>v={'calc','draw','copy','demo',\n'mem','var','circ','fx'}\nf=0z=0a=0c={'\uc6c3fake!','\u273dvisuals!','\u27a1\ufe0fentertain!','\ud83c\udd7e\ufe0fno sourcecode!','no explain!'}\nfunction _draw()f+=1z+=1\nif(z&lt;#v+1)?v&#91;z]..\"=''\"\nif(f&lt;sin(z\/100)*6+4)return\nf=0\ns=v&#91;ceil(rnd(4))]..\"..\"..v&#91;4+ceil(rnd(4))]\nif(z&gt;#v+1)?\"\\f7demo..= \"..s\nif(rnd(10)&lt;1)?\"\\f8\\^i--\"..c&#91;ceil(rnd(4))]\nend<\/code><\/pre>\n\n\n\n<p>When reading the generated source code, it quickly becomes clear that this new demo actually consists of a series of empty strings. At the end of the day, the demo is simply empty and non-existent, even though something is constantly being created here.<\/p>\n\n\n\n<p><br>Of course, code can also be used less dominantly and invasively and rather become the content of a demo, for example in the research demo &#8222;<a rel=\"noreferrer noopener\" href=\"https:\/\/research.swissdigitization.ch\/?p=3393\" target=\"_blank\">Josef K and the Cathodic Guillotine \u2013 The Ugly Demo (Amiga)<\/a>&#8222;. <\/p>\n\n\n\n<p>Surely this is just the beginning of this kind of demos .-)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It&#8217;s one of the most fundamental questions in the demoscene: why is there almost no visible source code in demos, even though it&#8217;s actually all about code. Ultimately, that&#8217;s where the magic is, the magic. This is especially true for &hellip; <a href=\"https:\/\/www.gamelab.ch\/?p=10984\">Weiterlesen <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.gamelab.ch\/index.php?rest_route=\/wp\/v2\/posts\/10984"}],"collection":[{"href":"https:\/\/www.gamelab.ch\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gamelab.ch\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gamelab.ch\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gamelab.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10984"}],"version-history":[{"count":8,"href":"https:\/\/www.gamelab.ch\/index.php?rest_route=\/wp\/v2\/posts\/10984\/revisions"}],"predecessor-version":[{"id":11140,"href":"https:\/\/www.gamelab.ch\/index.php?rest_route=\/wp\/v2\/posts\/10984\/revisions\/11140"}],"wp:attachment":[{"href":"https:\/\/www.gamelab.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10984"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gamelab.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10984"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gamelab.ch\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10984"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}