Soupster [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=92447 3D Picotron Screensaver <p> <table><tr><td> <a href="/bbs/?pid=167389#p"> <img src="/bbs/thumbs/pico64_picotron_screensaver-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=167389#p"> picotron_screensaver</a><br><br> by <a href="/bbs/?uid=92447"> Soupster</a> <br><br><br> <a href="/bbs/?pid=167389#p"> [Click to Play]</a> </td></tr></table> </p> <p>Made a neat little screensaver that I thought I'd share. Smoothly transitions between some different scenes.</p> <p>(Sped up a bit, but the GIF lags):</p> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/92447/3d_screensaver.gif" alt="" /> https://www.lexaloffle.com/bbs/?tid=149127 https://www.lexaloffle.com/bbs/?tid=149127 Wed, 21 May 2025 20:31:03 UTC Mysterious bugs with pod() <p>I have encountered some strange behaviour when using pod() with keys that are tables.</p> <p>This code snippet prints <code>{}</code> (it should print <code>nil</code> if it were to be consistent with other pod behaviour)</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>local a = {} a[a] = 1 ?pod(a)</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>This code snippet also prints <code>{}</code></p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>local a = {} local b = {} a[b] = 2 ?pod(a)</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>But now, the strange part. This:</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>local a = {} local b = {} a[a] = 1 a[b] = 2 ?pod(a)</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>causes an error, it reads simply <code>attempt to compare two table values</code>. No error location, just this!</p> https://www.lexaloffle.com/bbs/?tid=148186 https://www.lexaloffle.com/bbs/?tid=148186 Tue, 01 Apr 2025 23:56:31 UTC Tile Building With Stress <p> <table><tr><td> <a href="/bbs/?pid=160193#p"> <img src="/bbs/thumbs/pico64_tile_stress_test-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=160193#p"> tile_stress_test</a><br><br> by <a href="/bbs/?uid=92447"> Soupster</a> <br><br><br> <a href="/bbs/?pid=160193#p"> [Click to Play]</a> </td></tr></table> </p> <p>Just a little test to see if the implementation works.</p> <p>Controls:</p> <p>LMB: Place<br /> RMB: Pick tile</p> <p>Left/Right arrows: Cycle through tiles</p> <p>S: View stress<br /> M: Change stress mode</p> <p>Have fun!</p> <p>Edit: Also, each tile has different properties, so you'll want to be careful what you build with.</p> https://www.lexaloffle.com/bbs/?tid=146430 https://www.lexaloffle.com/bbs/?tid=146430 Sat, 04 Jan 2025 12:04:00 UTC BBS Bugs <p>Here is a list of bugs/annoyances in the BBS:</p> <p>Important:</p> <ul> <li><del>Code preview is broken, if you click on the code button under the pico-8 web player, it doesn't show the code. (It's the right size now, but still no code. Definitely an improvement!)</del> Fixed!</li> </ul> <p>Minor:</p> <ul> <li>The padding around the pico-8 web player is too big.</li> <li>The featured buttons at the top of the BBS don't show the author, it just says &quot;by &quot;.</li> </ul> <p>There are a couple more, but they're not really issues, so I've omitted them.</p> https://www.lexaloffle.com/bbs/?tid=143687 https://www.lexaloffle.com/bbs/?tid=143687 Thu, 15 Aug 2024 22:37:11 UTC Picotron web player broken (possible fix?) <p>When clicking the play button on the Picotron web player, it stays as a grey screen. Checking the console shows an error, that it can't find <code>https://www.lexaloffle.com/play/picotron_0101.js</code>. After some digging, I believe it should be <code>https://www.lexaloffle.com/play/picotron_0100h.js</code> instead.</p> <p>Edit: Wait, does this hint at Picotron 0.1.1?</p> <p>FIXED!!!!</p> https://www.lexaloffle.com/bbs/?tid=143643 https://www.lexaloffle.com/bbs/?tid=143643 Tue, 13 Aug 2024 22:17:28 UTC Picotron text field bug <p>Text gets &quot;buffered&quot; if no text editor is selected, and upon selecting it, it types the text.</p> <p>How to reproduce:</p> <ol> <li>Start Picotron</li> <li>Type something</li> <li>Open up filenav</li> <li>Select the navbar</li> <li>The text appears where you click instantly.</li> </ol> https://www.lexaloffle.com/bbs/?tid=143383 https://www.lexaloffle.com/bbs/?tid=143383 Tue, 30 Jul 2024 20:11:31 UTC 191-Character Maze Generator <p>This is a maze generator in 191 characters.</p> <p> <table><tr><td> <a href="/bbs/?pid=150716#p"> <img src="/bbs/thumbs/pico8_maze_gen_191-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=150716#p"> maze_gen_191</a><br><br> by <a href="/bbs/?uid=92447"> Soupster</a> <br><br><br> <a href="/bbs/?pid=150716#p"> [Click to Play]</a> </td></tr></table> </p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>t={-2,2}function g(x,y)if(pget(x,y)&lt;7)return line(x,y)::l::r=rnd(t)if(rnd(2)&gt;1)then g(x+r,y)else g(x,y+r)end line(x,y)if(rnd(99)&gt;1)goto l end cls(7)g(0,0)pal(7,8,1)pal(6,7,1)::_::flip()goto _</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>This is my first time doing this, let me know if it could be improved.</p> https://www.lexaloffle.com/bbs/?tid=142953 https://www.lexaloffle.com/bbs/?tid=142953 Tue, 02 Jul 2024 01:49:54 UTC RGB Transition Effect <p> <table><tr><td> <a href="/bbs/?pid=149607#p"> <img src="/bbs/thumbs/pico64_rgb_transition-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=149607#p"> rgb_transition</a><br><br> by <a href="/bbs/?uid=92447"> Soupster</a> <br><br><br> <a href="/bbs/?pid=149607#p"> [Click to Play]</a> </td></tr></table> </p> <p>This is a simple transition, that should be fairly easy to use. All the code is in rgb_transition.lua. Simply call <code>rgb_transition_setup()</code> when starting the transition, and then on each frame, after the game is drawn, call <code>rgb_transition()</code>. It takes one argument: Whether the transition should be fading in or out. True fades out. In this test cart, press X to reverse the transition.</p> https://www.lexaloffle.com/bbs/?tid=142630 https://www.lexaloffle.com/bbs/?tid=142630 Fri, 07 Jun 2024 23:23:47 UTC 3D Rendering with depth buffer! <p> <table><tr><td> <a href="/bbs/?pid=149396#p"> <img src="/bbs/thumbs/pico64_dbuf_test-2.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=149396#p"> 3D Rendering with depth buffer!</a><br><br> by <a href="/bbs/?uid=92447"> Soupster</a> <br><br><br> <a href="/bbs/?pid=149396#p"> [Click to Play]</a> </td></tr></table> </p> <p>This is mainly a tech demo for a 3d engine with a depth buffer. This is not finished, but I wanted to share it.</p> <p>TODO:</p> <ul> <li>Optimisations maybe?</li> <li>BSP - currently model faces aren't sorted, so concave models will work weirdly. The depth buffer is only for interactions between models.</li> <li>Maybe lower the resolution for better performance?</li> <li>Some sort of culling?</li> <li>Better use of depth buffer resolution, make it more linear maybe?</li> </ul> <p>(The depth buffer works with the use of colour tables, in a few passes. If anyone wants more detail, I can provide it.)</p> <p>Oh yeah, controls:<br /> WASD: Move<br /> QE: Up/Down (relative to look dir)<br /> Arrows: Rotate camera</p> <p>Z/C: Toggle depth rendering</p> <p>Thanks <a href="https://www.lexaloffle.com/bbs/?uid=25532"> @freds72</a> and <a href="https://www.lexaloffle.com/bbs/?uid=51001"> @Maeve</a> for advice on the memory issue, I hope it's gone once and for all! (Memory still rises rapidly, so I'll look into what could be causing that too)</p> https://www.lexaloffle.com/bbs/?tid=142573 https://www.lexaloffle.com/bbs/?tid=142573 Mon, 03 Jun 2024 19:07:58 UTC f64 userdata doesn't save in pods <p>I've encountered a bug where vectors and f64 userdata doesn't get saved in the pod format.</p> <p>This code:</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>local foo = vec(10, 10) print(tostr(foo), 10, 10, 7) print(pod(foo), 10, 20, 7) print(tostr(unpod(pod(foo))), 10, 30, 7) local bar = userdata(&quot;f64&quot;, 2) bar.x = 10 bar.y = 10 print(tostr(bar), 10, 50, 7) print(pod(bar), 10, 60, 7) print(tostr(unpod(pod(bar))), 10, 70, 7)</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>prints:</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>(10.00000, 10.00000) userdata(&quot;f64&quot;,2,&quot;&quot;) (0.00000, 0.00000) (10.00000, 10.00000) userdata(&quot;f64&quot;,2,&quot;&quot;) (0.00000, 0.00000)</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>You can see that pod() doesn't save the values for the userdata.</p> https://www.lexaloffle.com/bbs/?tid=142394 https://www.lexaloffle.com/bbs/?tid=142394 Thu, 23 May 2024 06:47:19 UTC Pause when switching to picotron and pico-8 <p>When switching to picotron or pico-8 by clicking on the icon when it's in fullscreen mode, I encounter a short freeze. Only about a second, but it's pretty annoying. <a href="https://www.lexaloffle.com/bbs/?uid=1"> @zep</a>, do you know why this happens? Is it possible to remove?</p> https://www.lexaloffle.com/bbs/?tid=142388 https://www.lexaloffle.com/bbs/?tid=142388 Wed, 22 May 2024 02:56:08 UTC create_diff missing? [Solved] <p><del>Hello. I was playing around with pods, and I noticed that create_diff isn't defined. here's the code (I'm 99% sure I didn't do something really stupid):</del></p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>local a = {&quot;a&quot;, &quot;b&quot;, &quot;c&quot;} local b = {&quot;a&quot;, &quot;c&quot;, &quot;d&quot;} local pa = pod(a) print(pa) local pb = pod(b) print(pb) local pd = create_diff(pa, pb) print(pd)</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p><del><a href="https://www.lexaloffle.com/bbs/?uid=1"> @zep</a> was the function removed? it's in <a href="https://www.lexaloffle.com/dl/docs/picotron_pod.html#POD_Diffs">https://www.lexaloffle.com/dl/docs/picotron_pod.html#POD_Diffs</a>, but maybe that's outdated.</del></p> <p>EDIT: Never mind, it's called create_delta!</p> https://www.lexaloffle.com/bbs/?tid=142053 https://www.lexaloffle.com/bbs/?tid=142053 Tue, 30 Apr 2024 19:31:05 UTC Conway's Game of Life <p> <table><tr><td> <a href="/bbs/?pid=147143#p"> <img src="/bbs/thumbs/pico64_cgol-2.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=147143#p"> Conway's Game of Life </a><br><br> by <a href="/bbs/?uid=92447"> Soupster</a> <br><br><br> <a href="/bbs/?pid=147143#p"> [Click to Play]</a> </td></tr></table> </p> <p>Here is Conway's Game of Life in Picotron, using the colour tables as a fast way to count all the pixels at once.<br /> This version does not work in the web player, because input is not detected (<a href="https://www.lexaloffle.com/bbs/?uid=1"> @zep</a> pls fix!)</p> <p>Controls:<br /> Up: Increase simulation speed<br /> Down: Decrease simulation speed<br /> Space: Pause<br /> F: Step one frame<br /> C: Clear screen<br /> R: Randomise screen<br /> L-Click: Draw pixels<br /> R-Click: Erase Pixels<br /> L: Toggle large cursor</p> <p>Basic code:<br /> <div><div><input type="button" value=" Show " onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = ' Hide '; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = ' Show '; }"></div><div><div style="display: none;"></p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>function _init() frame = 0 -- Set up userdata so we can draw the screen to itself -- by using memcpy() to a memmapped region of memory. -- The userdata is now the contents of the previous frame, -- and it is now possible to modify the current frame. -- We can also call spr() with userdata -- to draw the previous frame to the current one screen = userdata(&quot;u8&quot;, 480, 270) memmap(0x30000, screen) end function set_col_table(new, current, col) poke(0x8000 + 64*new + current, col) end function _draw() frame += 1 if frame == 1 then -- Randomise the screen for the first frame. for y=0,269 do for x=0,479 do if (rnd() &lt; 0.2) pset(x, y, 7) end end -- Copy the current screen to the buffer, just for the first frame memcpy(0x30000, 0x10000, 0x20000) end --if (frame % 32 &gt; 0) return cls() -- White cells drawn onto colour 0 will set the colour to 1, white onto 1 will be 2 -- and so on. This counts the number of neighbouring cells very quickly for i=0, 7 do set_col_table(7, i, i+1) end -- Draw the screen 8 times in a ring, for each neighbour. The colour tables -- do the counting for y=-1,1 do for x=-1,1 do if (x!=0 or y!=0) spr(screen, x, y) end end -- Set up colour tables to turn the &quot;counted&quot; screen into the next frame -- Set every colour to black except for drawing black onto 3 (brought back alive) -- and 2 or 3 neighbours for alive (stay alive) for i=0, 9 do set_col_table(0, i, 0) set_col_table(7, i, 0) end set_col_table(0, 3, 7) set_col_table(7, 2, 7) set_col_table(7, 3, 7) -- Draw the screen to the &quot;counted&quot; version, with the rules set above spr(screen, 0, 0) -- Reset the draw state to make sure we have a predictable next frame reset() -- Copy the screen to the buffer for the next frame, -- before we pollute it with the FPS counter memcpy(0x30000, 0x10000, 0x20000) -- FPS counter if key(&quot;x&quot;) then rectfill(0, 0, 44, 8, 0) print(&quot;FPS: &quot;..stat(7), 1, 1, 8) end end</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p></div></div></div></p> https://www.lexaloffle.com/bbs/?tid=141892 https://www.lexaloffle.com/bbs/?tid=141892 Mon, 22 Apr 2024 21:15:35 UTC