sol [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=37852 #DEFINE considered useful <p>as a lot of us are brutally aware of, pico-8's limitations are very fun, but can also have a serious impact on code readability. one particularly nasty problem is that when saving tokens, descriptive names for constant values are one of the first things to go out the window. Up till now, this was an unavoidable problem. However, with the recent introduction of the INCLUDE directive, pico-8 now has a preprocessor and a model for how preprocessor directives should work. I'd like to propose a DEFINE directive for supporting simple text substitution.</p> <p>for example, let's say we are doing a simple branch based on a cel value:</p> <div> <div style="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 c=mget(x,y) if c==4 then ... elseif c==5 then ... 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>it's impossible to even guess what this code does. but it's hard to argue that adding &quot;local health_pickup=4&quot; is worth the tokens.</p> <p>instead, if we had a DEFINE directive, we could change the above to:</p> <div> <div style="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> #DEFINE health_pickup 4 #DEFINE coin_pickup 5 local c=mget(x,y) if c==health_pickup then ... elseif c==coin_pickup then ... 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>this would be flattened to be identical to the first code snippet when exported to p8.png. the result is far more readable, and uses no extra tokens. I think DEFINE directives should be able to be placed anywhere, to enhance readability, but I don't believe they need to be scoped, or nestable for that matter. since it'd be possible for a macro name to shadow a variable name, I'd suggest syntax highlighting, changing the text of a macro usage to orange, which would make accidentally using a macro when you meant to use a variable much rarer.</p> <p>what do y'all think? is this a feature you would like to see in pico-8? I'm trying to get a discussion about this going, so ideas and feedback would be very welcome!</p> https://www.lexaloffle.com/bbs/?tid=36921 https://www.lexaloffle.com/bbs/?tid=36921 Mon, 24 Feb 2020 19:29:56 UTC Sybil's Tail 1.1.1 <p> <table><tr><td> <a href="/bbs/?pid=67959#p"> <img src="/bbs/thumbs/pico8_sybils_tail-2.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=67959#p"> Sybil's Tail 1.1.1</a><br><br> by <a href="/bbs/?uid=37852"> sol</a> <br><br><br> <a href="/bbs/?pid=67959#p"> [Click to Play]</a> </td></tr></table> </p> <p>Sybil's Tail is a tiny, 15-30 minute long platformer made for PICO-8. Run, jump, slide, grab, and toss your way through 6 bite-sized areas as you search for a mysterious meteorite that fell nearby!</p> <p>hi there!! after 4 months of working on it, I've finally finished my first PICO-8 game, Sybil's Tail! this project was a lot of fun to work on, and getting everything to fit into the 32k of cart space required a lot of tricks to make things work right. a large reason it took so long was all the rewriting and compressing it took to get in all in there. but! the result is exactly the game I set out to make! I hope y'all enjoy exploring this little 8-bit world I've made.</p> <p>it's also on itch <a href="https://sol-foxie.itch.io/sybils-tail">here</a>, which includes native exports, and the soundtrack. speaking of, I would like to extend special thanks to <a href="https://twitter.com/kitorchid">@kitorchid</a>, who made the incredible cover art for the soundtrack, and <a href="https://twitter.com/osmoru">@osmoru</a>, whose adorable artwork formed the basis of the cartridge label design. In addition to those commissions, I also received wonderful artwork of Sybil from <a href="https://twitter.com/MarziManed">@MarziManed</a> and <a href="https://twitter.com/_pexl">@_pexl</a>, who are both very cool artists that you should check out as well! And of course, I would like to thank all testers and of course my friends, without them none of this would have been possible. </p> <p>some statistics (from version 1.0):<br /> number of songs: 9<br /> number of music patterns: 33<br /> number of SFX: 63<br /> non-empty map tiles: 3180<br /> sprite animation frames: 99 (computed at runtime)<br /> bg animation pixels: 60<br /> number of object types: 25<br /> number of in-game objects: 734<br /> tokens: 8190<br /> code size prior to data interleaving: 19435 bytes</p> <p>in other words! for PICO-8, it's a big game. sometime I'd like to write a blog post about all the tricks I did to squeeze everything in there, but for now, I'm just happy to finally have it out here. hope y'all enjoy it!</p> <p>[UPDATE version 1.1]<br /> The game now makes use of the &quot;secret&quot; pico-8 color palette-- the result is far more colorful, while still retaining the color contrast between the day and night segments. additionally, balloons and ribbons now respawn, making the game a tad less frustrating. a couple bugs have also been fixed, and several have been added. </p> <p>for the record, this is intended to be the last non-bugfix release for the game-- so I hope y'all enjoy it!<br /> [/UPDATE]</p> <p>[UPDATE version 1.1.1]<br /> 1.1.1 is primarily a bugfix release, and addresses the following issues:</p> <ul> <li>mobs can no longer kill sybil in cutscenes</li> <li>fixed issue where picking up mob and ribbon at the same time would cause mob to appear over sybil's head</li> <li>fixed an overflow bug that would cause credits screen to disappear after a while</li> <li>fixed issue where the sound effect for a hard post-jump landing was used for soft landings and vice versa</li> <li>fixed issue where sliding speed would not be reset when respawning</li> <li>fixed issue where respawn position would be noticeably offset while in fullscreen mode</li> <li>fixed issue where color of some signs would be inconsistent/flicker</li> <li>removed graphical distortion that appears when the final boss kills sybil. too many players mistook it for a genuine bug&hellip;</li> <li>color 2 is no longer mapped to secret color 4 during the daytime</li> <li>carrying a mob into the starting area during the day will no longer cause their colors to glitch out</li> <li>sybil's lighting now reverts to normal as she enters her house at the end of the game</li> </ul> <p>[/UPDATE]</p> https://www.lexaloffle.com/bbs/?tid=35404 https://www.lexaloffle.com/bbs/?tid=35404 Sat, 21 Sep 2019 00:42:10 UTC