Offler [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=15830 Raspberry version? <p>I've got a Raspberry Pi 400 that I've done some Pico-8 stuff on. </p> <p>Does anyone know if there is a plan to release a binary for Raspberry? Picotron feels like the perfect match with the Rapsberry Pi 400. </p> https://www.lexaloffle.com/bbs/?tid=141852 https://www.lexaloffle.com/bbs/?tid=141852 Sat, 20 Apr 2024 20:07:48 UTC Online Lua Server Engine <h1>Picotronlike for backend</h1> <p>I&rsquo;ve been spending some time trying to figure out a good design for how to let people build online services in the style of pico-8 or picotron. </p> <p>If you are anything like me you want to see code before reading more: </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>MAX_MESSAGES = 5 function _serve(request, context, user) if not context then context = { messages = {} } end if request.query.post then local timestamp = os.date(&quot;%Y-%m-%d %H:%M:%S&quot;) if not user then user = { name = request.query.user } end user.last_post = timestamp local newMessage = { user = user.name, text = request.query.post, timestamp = timestamp } table.insert(context.messages, newMessage) if #context.messages &gt; MAX_MESSAGES then table.remove(context.messages, 1) end end return { {body_object = { messages = context.messages }}, context, user } 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>So accessing this server would be a fetch to <code>http://whereitsat:3000/chat/?context=123&amp;user=offe&amp;post=Hey</code>, assuming the project is called chat. Anything in the body_object of the first return value will be returned in JSON format. You can also just return a string in body. </p> <p>Now there&rsquo;s a first version of this server engine that I very much would like feedback on. The practical purpose is to simplify building things so picotron carts can have connectivity for collaboration tools and multiplayer games. People shouldn&rsquo;t have to handle hosting, databases or cumbersome deployment. Also it's nice staying with Lua for the server as well. </p> <p>The basic principle is that using this framework the developer writes a single Lua function that is called for every http request. The function is called _serve(), in line with pico-8 tradition. It&rsquo;s possible to define more functions of course that can be called from _serve(). The handler is pure functional and does not have side effects. Instead the request information are given as input as well as two objects and the function returns the response and updated objects. The framework takes care of persisting the objects for future requests. Consistency is guaranteed even though the service can handle concurrent requests. </p> <p>The developer does not have access to explicit database calls. </p> <p>I don&rsquo;t know if the interface is generic enough for actually building something very useful without fighting the design, but I hope that it will be simple and useful. It should support anyone who quickly wants to build a backend for turn based games, a game lobby, some kind of collaboration tool or a chat app. Since you code the request handler in Lua it&rsquo;s easy to share code between the picotron app and the server which should be useful for some games. </p> <p>The network interface is built to match picotron&rsquo;s current fetch() behavior (GET with query parameters). </p> <h2>The interface</h2> <p>The two objects that are given as arguments and then returned modified are: </p> <ul> <li>Context. This can be used as a game session, or a game lobby room or chat channel. Something where different clients share information with each other. </li> <li>User. This represents the client. This allows the developer to manage authentication or storing information that needs to be transferred between different contexts. </li> </ul> <p>To support these parameters there are two special query parameter:</p> <ul> <li>context = the string id of the context</li> <li>user = the string id of the user<br /> These are available to the service like normal query parameters, but they are also used to read from the database. So for each combination of projectId and contextId there can be an object in the database. </li> </ul> <p>The server is probably very buggy at the moment. I&rsquo;d really like if someone wanted to try it out and build something. I want to at least see if one person can make it work for them before letting more people hurt themselves, I'm expecting to fix a couple of sharp edges. </p> <p>The developer experience and debugging functionality is very basic so far. I haven&rsquo;t built a front end. So far the system only supports two things: </p> <ul> <li>Accepting requests and running the Lua script</li> <li>There&rsquo;s an endpoint where people can upload new versions of the Lua script to a project if they have the project&rsquo;s secret token:</li> </ul> <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>curl -X POST &quot;http://whereitsat:3000/api/projects/chat/uploadScript&quot; \ -H &quot;Authorization: Bearer KH3XtSnWdCZB8iJnXnQmRjwcM0cv6OmtRteZ8z5w53Y1SAYK&quot; \ -H &quot;Content-Type: application/octet-stream&quot; \ --data-binary &quot;@chatserver.lua&quot;</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>Other than that I&rsquo;ll initially need to manage everything else manually. </p> <p>If someone wants to try it out, please let me know what your service should be called (that&rsquo;s the beginning of the path, &quot;chat&quot; in the examples above), and your email address (to [email protected]) so I can send you a project token allowing you to upload your script. </p> https://www.lexaloffle.com/bbs/?tid=141729 https://www.lexaloffle.com/bbs/?tid=141729 Sun, 14 Apr 2024 21:52:34 UTC sploders 0.8 <p> <table><tr><td> <a href="/bbs/?pid=144071#p"> <img src="/bbs/thumbs/pico64_sploders-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=144071#p"> sploders 0.8</a><br><br> by <a href="/bbs/?uid=15830"> Offler</a> <br><br><br> <a href="/bbs/?pid=144071#p"> [Click to Play]</a> </td></tr></table> </p> <p>My first Picotron project. It's a clone of a game called Chain Reaction I used to play on my C64 back in the day. </p> <p>It's a two player game where you take turns in placing orbs on a tile grid. The object is to be the only player with orbs left on the board. Orbs can be placed on empty tiles and tiles where the player already has orbs. When there are one fewer orbs on one tile than there are neighbouring tiles the tile is said to be critical. Adding another orb to a critical tile will make the orbs splode. The orbs will be added to the neighbouring tiles. If they are occupied by the opponents orbs these change color. </p> <p>Just try it, you'll understand despite my poor explanation. </p> <p>TODO: </p> <ul> <li>There's some code cleanup to do. I appreciate any tips and tricks from whoever wants to have a look. </li> <li>Sound! I don't understand anything about the sound features of Picotron, so any help or pointers are appreciated. </li> <li>AI. I found a heuristic on the web that I'll want to implement. Two player games are not the most useful without the ability to play an AI. </li> <li>It would be fun to make it run in a window in Picotron, with the option of starting it full screen. We'll see. </li> </ul> <p>Anyway, enjoy. I appreciate any feedback you all have. </p> https://www.lexaloffle.com/bbs/?tid=140976 https://www.lexaloffle.com/bbs/?tid=140976 Thu, 21 Mar 2024 19:59:42 UTC Online drawing app w. pico-8 palette <p>This is perhaps a bit off topic, or maybe not. </p> <p>I just deployed a rough, first version of an online pixelart drawing app: <a href="https://pixla.nu/?ps=DyIAIQESCSIBIIICIRILIoEgAg8iACENIgACNiIBAAACCyIAIAF3AHALIgAHAncAAgoihAcAcAcCCiKEBwBwBwIKIgAHAncAAgoihAdwAHcCCiKDIHAAcAsigyB4gHALIgAHAXcAcAUiBBEAEAJ3AHALEQIAAAF_EUUR">https://pixla.nu/?ps=DyIAIQESCSIBIIICIRILIoEgAg8iACENIgACNiIBAAACCyIAIAF3AHALIgAHAncAAgoihAcAcAcCCiKEBwBwBwIKIgAHAncAAgoihAdwAHcCCiKDIHAAcAsigyB4gHALIgAHAXcAcAUiBBEAEAJ3AHALEQIAAAF_EUUR</a></p> <p>It's meant to be limited in features, a little bit like pico-8 actually. The canvas size is fixed to 32x32, and the palette is fixed to the (original) pico-8 palette. Left button draws, right button picks up the color under the mouse. </p> <p>Perhaps the most special thing is that the pixels are saved in the URL, so the images can be saved by simply bookmarking the page. The links are also easily shared on social media, and the preview includes the image. </p> <img style="margin-bottom:16px" border=0 src="/media/15830/Screenshot 2020-07-05 at 13.21.21.png" alt="" /> <p>If it's not clear from the screenshot, I can't draw. So I hope some people with some pixel art skills will find the tool fun and useful. Please try it out, and let me know of any problems or feature requests you might have! </p> <p>Oh, the name of the site is in swedish. &quot;Pixla nu&quot; means &quot;Draw pixels, now!&quot;, where pixla is the verb form of pixel and nu means now. </p> https://www.lexaloffle.com/bbs/?tid=38687 https://www.lexaloffle.com/bbs/?tid=38687 Sun, 05 Jul 2020 11:23:46 UTC PICO-64 <p>I've been using PICO-8 to prototype a potential game for the Commodore 64. It's mostly testing out the graphics and exporting the tiles, map and sprites to asm source code. In the end having the wrong palette made things too confusing for me. </p> <p>So I bring you PICO-64: </p> <img style="margin-bottom:16px" border=0 src="https://www.lexaloffle.com/bbs/files/15830/PICO-8_0.png" width=384 height=384 alt="" /> <p>It is just PICO-8 with the palette changed into that of the VIC-II, the graphics chip of the Commodore 64. </p> <p>On OS X the palette that PICO-8 is using is in the binary PICO-8.app/Contents/MacOS/pico8.dat file. Just search and replace to change. I used macvim and the Tools/Convert to HEX and Convert Back. </p> <p>These colors: </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> 1d2b53 7e2553 008751 ab5236 5f574f c2c3c7 fff1e8 ff004d ffa300 ffec27 00e436 29adff 83769c ff77a8 ffccaa </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>Needs to be changed into these (Pepto's VIC-II palette): </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> ffffff 68372b 70a4b2 6f3d86 588d43 352879 b8c76f 6f4f25 433900 9a6759 444444 6c6c6c 9ad284 6c5eb5 959595 </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>To overcome the small screen I have been using PICO-8's mouse feature to scroll around a 320x200 pixel screen. Not optimal, but still usable. </p> <p>If you try this out and start hacking binary files, don't blame me if something breaks!</p> https://www.lexaloffle.com/bbs/?tid=29753 https://www.lexaloffle.com/bbs/?tid=29753 Thu, 03 Aug 2017 18:28:52 UTC The Moving of the Sofas <p> <table><tr><td> <a href="/bbs/?pid=42348#p"> <img src="/bbs/thumbs/pico42340.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=42348#p"> Untitled</a><br><br> by <a href="/bbs/?uid=15830"> Offler</a> <br><br><br> <a href="/bbs/?pid=42348#p"> [Click to Play]</a> </td></tr></table> </p> <p>Here's a game I started and abandoned quickly. It was supposed to be a furniture moving themed Sokoban/Traffic Jam style game. I kind of like the graphics, but it became too unclear to interact with. </p> <p>Anyway. Instead of just keeping it to myself here it is. Perhaps something about it amuses someone. </p> https://www.lexaloffle.com/bbs/?tid=29623 https://www.lexaloffle.com/bbs/?tid=29623 Mon, 10 Jul 2017 20:40:43 UTC Multi Paint - 8 user pixeling fun <p>So you have seven friends over and are in a hurry to make a 32x24 pixel artwork? </p> <p>Before this cart it was not obvious how to handle the situation. Now it's easy. The eight of you can work together in Multi Paint! </p> <p> <table><tr><td> <a href="/bbs/?pid=40473#p"> <img src="/bbs/thumbs/pico40472.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=40473#p"> Multi Paint - 8 user pixeling fun</a><br><br> by <a href="/bbs/?uid=15830"> Offler</a> <br><br><br> <a href="/bbs/?pid=40473#p"> [Click to Play]</a> </td></tr></table> </p> <p>This came to be because I'm working on a GalCon clone, and I wasn't happy with the controls. So I started making a cursor, but then I thought it would be cool with a &quot;mouse pointer&quot; for each player when playing multi player. When that was working I wanted to make something simple with it, so it became this rudimentary pixel art cart. The only fancy part is that you can use a foreground color with the first button, and then a background color with the second button, just like Deluxe Paint on the Amiga. </p> https://www.lexaloffle.com/bbs/?tid=29304 https://www.lexaloffle.com/bbs/?tid=29304 Thu, 11 May 2017 16:58:19 UTC War of the Map <p> <table><tr><td> <a href="/bbs/?pid=32932#p"> <img src="/bbs/thumbs/pico33060.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=32932#p"> War of the Map 0.6</a><br><br> by <a href="/bbs/?uid=15830"> Offler</a> <br><br><br> <a href="/bbs/?pid=32932#p"> [Click to Play]</a> </td></tr></table> </p> <p>(Edit: I used the save @clip feature of pico-8 0.1.9b, but I noticed that I couldn't play it on the pocketchip. Now I saved a .p8.png old school style. Hope that works better. I also changed the cartridge label to a hopefully more selling one. )</p> <p>This is my first pico-8 project, and also my first venture into LUA land. It is a game heavily inspired by Dice Wars by Taro Ito. </p> <p>The characters are inspired by the main character in Kingdom of Nerea by Davit Mazia. </p> <p>The game is not yet done, but perfectly playable. Please try it, and give me all the feedback you have. What's good, what's bad, what's missing, what's confusing? </p> <p>Any feedback is greatly appreciated! </p> https://www.lexaloffle.com/bbs/?tid=28136 https://www.lexaloffle.com/bbs/?tid=28136 Fri, 02 Dec 2016 19:40:44 UTC