jobe [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=30542 Larkstongue (a Python-based asset packer) <h1>Larkstongue v.0.0.1-alpha</h1> <p>Larkstongue is an asset packer, written in Python. It can extract raw cart data from a .p8 file, compress and pack assets into the cart data of a .p8 cart, and generate code for unpacking that data.</p> <p>Current features:</p> <ul> <li>Extracts any cart data area</li> <li>Special extract function for bitmaps with automatic cropping</li> <li>Generates loader code according to the user's specifications</li> <li>Hilbert curve mapping for bitmaps</li> <li>Run length encoding</li> <li>Huffman coding</li> </ul> <p>Larkstongue is currently in <em>early public alpha</em>, so there will probably be a lot of quirks still. Remember to keep backups of any carts you use it on!</p> <p>Get it on <a href="https://github.com/jorikemppi/larkstongue">GitHub</a> and give it a try! Do try to break it and tell me how you broke it :)</p> https://www.lexaloffle.com/bbs/?tid=37826 https://www.lexaloffle.com/bbs/?tid=37826 Sat, 09 May 2020 05:05:07 UTC Wavefront .OBJ importer (version 0.1) <p> <table><tr><td> <a href="/bbs/?pid=75343#p"> <img src="/bbs/thumbs/pico8_obj_import_v01-1.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=75343#p"> Wavefront .OBJ importer 0.1</a><br><br> by <a href="/bbs/?uid=30542"> jobe</a> <br><br><br> <a href="/bbs/?pid=75343#p"> [Click to Play]</a> </td></tr></table> </p> <p>An importer for the Wavefront .OBJ format. Exports a code template with setup and a basic rendering loop. The template uses includes that are available at <a href="https://github.com/jorikemppi/pico-8-bits-and-pieces/tree/master/include">https://github.com/jorikemppi/pico-8-bits-and-pieces/tree/master/include</a>. Import/export features require clipboard access, but if you just want to play around with it on a browser, it can also generate a cube.</p> <p>Currently work in progress, both on the rendering engine side and the importer GUI side. Feel free to share your GUI improvement suggestions, as nearly everything in the GUI can currently be improved a lot :)</p> <h3>Features</h3> <ul> <li>Loads both Wavefront .OBJ files and its own internal format by pasting the object into PICO-8</li> <li>Exports a code template with the object, plus a string with the object and material data encoded in a format you can reload in the importer</li> <li>Translate, rotate, scale and reflect functions</li> <li>Material editor (a material consists of diffuse and ambient values, plus a gradient used for shading)</li> <li>Layering system (if you need to force rendering order because of painter's algorithm problems)</li> <li>Automatic material and layer assignment to separate objects in the .OBJ file (ie. first object has material 1 and layer 1, second object has material 2 and layer 2 etc.)</li> </ul> <h3>To do</h3> <ul> <li>Triangulation (currently only reads the first three vertices of each face, so for now, you need to triangulate your objects before importing)</li> <li>tline texturing support (currently only basic flat shading is supported)</li> <li>GUI improvements (including devkit mouse support)</li> <li>Code readability improvements</li> </ul> <h3>Known issues</h3> <ul> <li>GUI bug in the reflect mode. Pressing left when X axis is selected, or right when Z axis is selected, causes a crash. I'll fix this in the next update, although all it does is flip an object so I might just incorporate that functionality in the scaling mode instead.</li> </ul> https://www.lexaloffle.com/bbs/?tid=37576 https://www.lexaloffle.com/bbs/?tid=37576 Sat, 25 Apr 2020 12:38:43 UTC tline() affine texture mapping proof of concept <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/30542/3_affine_test_01_5.gif" alt="" /> <p>The code is still messy as heck so I'm going to at least tidy it up a bit before I share it :)</p> <p>Next step, figuring out what to do about the perspective distortion. On a PS1 I'd just subdivide those triangles. On PICO-8, I'm already at 60% CPU, and while there's still room for optimization and I could always drop to 30 FPS, I don't think throwing more triangles at it is necessarily the right solution here.</p> <p>Currently it calculates the UV coordinates correctly once per scanline. The first thing I'm going to try will probably be calculating them twice instead, splitting each rasterized line into half.</p> https://www.lexaloffle.com/bbs/?tid=37386 https://www.lexaloffle.com/bbs/?tid=37386 Thu, 16 Apr 2020 14:26:36 UTC Streaming visual effects coding on Twitch (Tue, March 24, 18:00 EET) <p>Hello!</p> <p>I'll be doing some visual effects coding and streaming it tomorrow on Twitch. That's Tuesday, March 24, 18:00 EET. This will actually be the first time I'm doing a show on Twitch, so hopefully everything goes well :)</p> <p><a href="https://www.twitch.tv/jobejobe">Here's the link</a>. See you there!</p> https://www.lexaloffle.com/bbs/?tid=37126 https://www.lexaloffle.com/bbs/?tid=37126 Mon, 23 Mar 2020 06:32:39 UTC Puroresu No Seishin <p> <table><tr><td> <a href="/bbs/?pid=73577#p"> <img src="/bbs/thumbs/pico8_puroresu_no_seishin-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=73577#p"> Puroresu No Seishin</a><br><br> by <a href="/bbs/?uid=30542"> jobe</a> <br><br><br> <a href="/bbs/?pid=73577#p"> [Click to Play]</a> </td></tr></table> </p> <p>A demo, and a love letter to Japanese professional wrestling, from Jumalauta. Released at Instanssi 2020, won first place in the demo compo.</p> <p>No guarantees at all about working on a browser. Tested on Firefox, crashes almost immediately. The cart works fine on the Pico-8 software, naturally. If you want to watch it on a browser, YouTube is your best bet :)</p> <p><object width="640" height="400"><param name="movie" value="https://www.youtube.com/v/UR3MXKIefAI&hl=en&fs=1&rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="https://www.youtube.com/v/UR3MXKIefAI&hl=en&fs=1&rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="400"></embed></object></p> <p>Minified using Picotool by <a href="https://www.lexaloffle.com/bbs/?uid=9599"> @dddaaannn</a>. Unminified source code available in the <a href="ftp://ftp.untergrund.net/users/jml/releases/2020/jml-puroresu_no_seishin/puroresu_no_seishin.zip">release zip</a>. Some graphics are based on CC BY 2.0 photos, namely &quot;Jushin Liger ROHxNJPW Global Wars 2018&quot; by Troy Teague, &quot;Shinsuke Nakamura&quot; by temaki, and &quot;Mt.Fuji &amp; Tokyo SkyTree&quot; by Atomark.</p> https://www.lexaloffle.com/bbs/?tid=36949 https://www.lexaloffle.com/bbs/?tid=36949 Sun, 01 Mar 2020 13:06:23 UTC Gradient Editor <p> <table><tr><td> <a href="/bbs/?pid=70762#p"> <img src="/bbs/thumbs/pico8_gradienteditor-1.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=70762#p"> Gradient Editor</a><br><br> by <a href="/bbs/?uid=30542"> jobe</a> <br><br><br> <a href="/bbs/?pid=70762#p"> [Click to Play]</a> </td></tr></table> </p> <p>Inspired by Palette-Maker. This is a tool to create dithered 32-colour gradients. Mainly for my own use with my 3D lighting system, but I figured maybe someone else will find this useful.</p> <p>The interface currently technically allows you to use more than 16 different colors, but of course, PICO-8 can't actually render that. I could fix that, but the simplest fix is that you just don't do that :)</p> <p>Exports the gradient steps (on a scale of 0-127) and colors into the clipboard as Lua tables, without braces, like 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>gradsteps=0,32,64,96 gradpal=0,5,6,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>Of course, this doesn't work on the browser, so run locally. You can use my code to render the gradient, or write your own. dw817 has written an <a href="https://www.lexaloffle.com/bbs/?pid=69408">excellent tutorial</a> on how to implement dithering.</p> <p><strong>How to use:</strong></p> <p>up and down: select gradient step<br /> left and right: select color for current gradient step<br /> x: copy gradient steps and colors to clipboard (does not work in browser version)<br /> z: lock gradient step for further functions</p> <p>when locked:<br /> up and down: move gradient step<br /> z: unlock gradient step<br /> x: go into add/delete mode</p> <p>when in add/delete mode:<br /> z: add step after current step<br /> x: delete current step</p> https://www.lexaloffle.com/bbs/?tid=36174 https://www.lexaloffle.com/bbs/?tid=36174 Mon, 09 Dec 2019 12:01:36 UTC A Resolute Purpose <p> <table><tr><td> <a href="/bbs/?pid=70435#p"> <img src="/bbs/thumbs/pico8_a_resolute_purpose-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=70435#p"> A Resolute Purpose</a><br><br> by <a href="/bbs/?uid=30542"> jobe</a> <br><br><br> <a href="/bbs/?pid=70435#p"> [Click to Play]</a> </td></tr></table> </p> <p>A demo by Matt Current. Released in 2019 at Vortex IV, second place in the demo compo.</p> <p>NOTE: This demo deals with the theme of suicidal thoughts. Not in a particularly graphic or explicit manner, but if that's a trigger for you, you should be aware of the content before viewing the demo.</p> https://www.lexaloffle.com/bbs/?tid=36072 https://www.lexaloffle.com/bbs/?tid=36072 Sun, 01 Dec 2019 05:25:39 UTC White Ale in Benin <p> <table><tr><td> <a href="/bbs/?pid=63823#p"> <img src="/bbs/thumbs/pico8_white_ale_in_benin-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=63823#p"> White Ale in Benin</a><br><br> by <a href="/bbs/?uid=30542"> jobe</a> <br><br><br> <a href="/bbs/?pid=63823#p"> [Click to Play]</a> </td></tr></table> </p> <p>A demo by Matt Current, first shown at Revision 2019. Placed third in the Wild competition.</p> <p>Again, might not run properly in browsers everywhere, but naturally the cart runs just fine in PICO-8 itself.</p> https://www.lexaloffle.com/bbs/?tid=34000 https://www.lexaloffle.com/bbs/?tid=34000 Mon, 22 Apr 2019 07:00:08 UTC Code within an if clause consumes cycles even if the conditional isn't met <p>I have this bit of 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> if f==1635 then sspr(0,32,128,64,64,64) sspr(0,32,128,64,-64,64,128,64,true,false) sspr(0,32,128,64,-64,0,128,64,true,true) sspr(0,32,128,64,64,0,128,64,false,true) 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>which causes the CPU load in a demo I'm working on to go over 1.0, even when f!=1635. If I comment out the sspr functions, the demo runs at 60fps. Is this speculative execution as planned, or is this a bug?</p> <p>EDIT: I was able to drop the CPU load back under 1.0 by doing it as a separate function, like 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>function drawthese() sspr(0,32,128,64,64,64) sspr(0,32,128,64,-64,64,128,64,true,false) sspr(0,32,128,64,-64,0,128,64,true,true) sspr(0,32,128,64,64,0,128,64,false,true) end ... if f==1635 then drawthese() end</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> https://www.lexaloffle.com/bbs/?tid=33640 https://www.lexaloffle.com/bbs/?tid=33640 Fri, 15 Mar 2019 11:31:45 UTC Techno-utopian Edict <p> <table><tr><td> <a href="/bbs/?pid=62464#p"> <img src="/bbs/thumbs/pico8_techno_utopian_edict-1.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=62464#p"> Techno-utopian Edict</a><br><br> by <a href="/bbs/?uid=30542"> jobe</a> <br><br><br> <a href="/bbs/?pid=62464#p"> [Click to Play]</a> </td></tr></table> </p> <p>Demo for the demo competition at the Instanssi 2019 demoparty, held in Jyv&auml;skyl&auml;, Finland in march 2019. Won first place.</p> <p>Again, it <em>might</em> run correctly in a browser but there might also be some sync issues (specifically in Chrome, in my experience). The cart runs just fine in PICO-8 itself, of course.</p> <p>UPDATE: Now fixed for 0.1.12! Which means it won't run correctly in older versions anymore, since it depends on time() for sync.</p> https://www.lexaloffle.com/bbs/?tid=33486 https://www.lexaloffle.com/bbs/?tid=33486 Sun, 03 Mar 2019 18:30:59 UTC Rock for Metal <p> <table><tr><td> <a href="/bbs/?pid=55718#p"> <img src="/bbs/thumbs/pico8_rockformetal-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=55718#p"> Rock For Metal</a><br><br> by <a href="/bbs/?uid=30542"> jobe</a> <br><br><br> <a href="/bbs/?pid=55718#p"> [Click to Play]</a> </td></tr></table> </p> <p>A demo by Jumalauta. Participated in the demo compo at the JML 18 years anniversary demoparty, won first place.</p> <p>Might not work properly with Chrome, there may be some sync errors and glitches. Should work consistently with Edge. Cart works just fine in the PICO-8 application itself, of course.</p> <p>UPDATE: Now fixed for 0.1.12! Which means it won't run correctly in older versions anymore, since it depends on time() for sync.</p> https://www.lexaloffle.com/bbs/?tid=31747 https://www.lexaloffle.com/bbs/?tid=31747 Sun, 26 Aug 2018 11:16:11 UTC