thesebonesalone [Lexaloffle Blog Feed] basic_visualizer <p> <table><tr><td> <a href="/bbs/?pid=98052#p"> <img src="/bbs/thumbs/pico8_basic_visualizer-1.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=98052#p"> basic_visualizer</a><br><br> by <a href="/bbs/?uid=56373"> thesebonesalone</a> <br><br><br> <a href="/bbs/?pid=98052#p"> [Click to Play]</a> </td></tr></table> </p> <p>A Very Basic Visualizer I made. Feel free to play around with it at your leisure!</p> Thu, 30 Sep 2021 19:15:05 UTC frostpunk_pico <p> <table><tr><td> <a href="/bbs/?pid=97454#p"> <img src="/bbs/thumbs/pico8_frostpunk_pico-1.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=97454#p"> frostpunk_pico</a><br><br> by <a href="/bbs/?uid=56373"> thesebonesalone</a> <br><br><br> <a href="/bbs/?pid=97454#p"> [Click to Play]</a> </td></tr></table> </p> <h1>Controller Version</h1> <p> <table><tr><td> <a href="/bbs/?pid=97454#p"> <img src="/bbs/thumbs/pico8_frostpunk_controller-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=97454#p"> frostpunk_controller</a><br><br> by <a href="/bbs/?uid=56373"> thesebonesalone</a> <br><br><br> <a href="/bbs/?pid=97454#p"> [Click to Play]</a> </td></tr></table> </p> <p>Hello, Captain. Welcome to the frigid wastes of Northern England. The world is cooling, London is in disarray, and there is no end in sight. You are charged with helping your group of refugees survive the cold. This task will be daunting and dangerous, but you are not without hope.</p> <p>To interact with your city use your mouse. A right click at the edges of the screen will move the camera, a left click will allow you to interact with the various menus and buildings. Your most important edict is this. Keep the Generator running. If it goes out surely your city will freeze to death. </p> <img style="" border=0 src="/media/56373/frostpunk_pico p8_0.png" alt="" /> <h2>Main Screen</h2> <p>Above you see the game screen. Along the top are your time controls. Use the pause feature to plan your next move, and use the fast forward feature to move through the game faster. To the right of that you will see your weather predictions. These tell you what day it is, and when the temperature will change. Pay close attention, you do not want to be caught off guard by a hard freeze.</p> <p>Below the time controls you will see the discontent meter. If this meter ever fills you will be deposed. Discontent is effected by many things, from child labor to masses of sick and homeless, and can be assuaged by signing certain laws.</p> <p>To the right of the discontent meter you will see the current temperature. By keeping people warm you can keep them from becoming sick.</p> <p>Along the bottom of the screen you will see your city interaction tabs as well as your supplies. Starting with supplies, from left to right, top row to bottom row you will see:</p> <p>Coal</p> <p>Wood</p> <p>Steel</p> <p>Steam Cores</p> <p>Population: Employed/Total</p> <p>Raw Food</p> <p>Food Rations</p> <p>Each of these resources will be used to keep your city running.</p> <p>Each city interaction tab will be explained as we go along.</p> <img style="" border=0 src="/media/56373/frostpunk_pico p8_2.gif" alt="" /> <h2>Citizens</h2> <p>Assigning citizens to different buildings allows those buildings to be worked. Doing this you will accumulate resources necessary to your city's survival.</p> <p>Some buildings only accept workers, while some only accept engineers. You will need to manage your work force and place people in the appropriate buildings.</p> <img style="" border=0 src="/media/56373/frostpunk_pico p8_3.gif" alt="" /> <h2>Housing</h2> <p>People will need a place to live, and it must stay warm. Placing tents around the generator is a good way to start. Each home can house 10 citizens, regardless of what kind of citizen they are. Communal living is key in the apocalypse.</p> <img style="" border=0 src="/media/56373/frostpunk_pico p8_4.gif" alt="" /> <h1>The Generator</h1> <p>The generator is the heart of your city. You can turn it on by clicking it and toggling the heat level to 1. If things get dire and your citizens are freezing you can activate the Overdrive feature. It will raise each heat level by one. But be warned, overuse of the Overdrive will stress the generator. If you stress it too much it will explode. When the generator is active it uses coal. Make sure to keep your coal production in line with your needs, or the Generator could shut off when you need it most!</p> <img style="" border=0 src="/media/56373/frostpunk_pico p8_7.gif" alt="" /> <img style="" border=0 src="/media/56373/frostpunk_pico p8_5.gif" alt="" /> <h2>The Build Menu</h2> <p>The build menu is where you can access all your available buildings. Each building costs a certain amount of Wood, Steel or Steam Cores to build. In this case, the Cookhouse can convert raw food into edible rations. It's a very important piece of the puzzle, make sure to always have one active.</p> <p>Each building will also display how cold it is. Any temperature below -20 and the inhabitants have a chance of getting sick. Make sure to keep your buildings well heated. At night, people are extra susceptible to the cold. So be sure to keep everything extra warm.</p> <p>If a building has served its purpose it can be deleted by pressing the red X. Beware, if you delete a building that was placed over an important resource, that resource is deleted as well.</p> <img style="" border=0 src="/media/56373/frostpunk_pico p8_8.gif" alt="" /> <h2>The Tech Tree</h2> <p>The meager buildings you have access to now surely won't be able to outlast the cold. By building a workshop and employing engineers there you can research new technologies and buildings. This is key to your city's continued survival. The more workshops you have, the faster your research will go.</p> <img style="" border=0 src="/media/56373/frostpunk_pico p8_9.gif" alt="" /> <h2>Laws</h2> <p>Sometimes you may need to sign laws to keep your city running smoothly. If you have a workforce shortage, consider child labor. You will be able to staff children in &quot;safe&quot; workplaces like gathering from wood crates, or working in the cookhouse. If your people are discontented, consider the fighting arena law. By placing fighting arenas near homes your people can blow off some steam after the work shift.</p> <p>Beware, while you may reap great benefits from the laws you sign, you may also create great discontent. However, there may be ways to completely eliminate discontent all together. The question is, is that too far a line to cross?</p> <h2>Tips</h2> <p>A few final pointers.</p> <p>Hunter's Huts operate at night. Make sure to have a stable source of raw food coming in as soon as you can.</p> <p>Sawmills must be placed near frozen trees, these trees will eventually be depleted. Wall Drills can be used for a near infinite source of wood, but must be placed on Wall Veins.</p> <p>The Beacon is a very important building. When staffed, scouts will automatically be sent into the surrounding frozen wastes and may return with survivors or supplies. This is the only way to obtain Steam Cores.</p> <p>Medical Tents employ engineers and will work on sick citizens. If you have too many sick, and not enough medical tents, some people may not be treated. Be careful, sick citizens eventually become gravely ill, and if left long enough they will die.</p> <p>If some of your people do die, you will need to build a cemetery. Dead bodies rotting in the streets is sure to sow discontent.</p> <h1>--Pico-8 Technical Notes--</h1> <p>I did my best, but there will be slowdown towards the end of the game. The little simulated CPU in this thing takes a serious pounding from this game. Thankfully it isn't an action game and can still be played and enjoyed.</p> <p>There is no save feature, you must either finish the game, or restart it. Saving large arrays into cart data is not something easily done.</p> <p>Please reach out if you find ANY bugs at all. I hope you enjoy this game, it was a labor of love! Please support the team over at 11-bit studios by purchasing the PC or Console version of <a href="">Frostpunk</a>, or by adding <a href="">Frostpunk 2</a> to your Steam wishlist.</p> Fri, 17 Sep 2021 14:01:20 UTC metatile_tester <p>Press the arrow keys or the dpad to move the map around!</p> <p> <table><tr><td> <a href="/bbs/?pid=95627#p"> <img src="/bbs/thumbs/pico8_metatile_tester-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=95627#p"> metatile_tester</a><br><br> by <a href="/bbs/?uid=56373"> thesebonesalone</a> <br><br><br> <a href="/bbs/?pid=95627#p"> [Click to Play]</a> </td></tr></table> </p> <p>Have you ever wanted to use larger sprites on Pico-8 and it just got too complicated? Well do I have the tool for you!</p> <p>Say hello to my MetaTile system, with tools!</p> <p>While developing a game I created a meta tile system as well as tools I use to facilitate easier development. The tools themselves are very crude, but effective. In the following post I will show you how to use the tools and implement the system in a game of your own!</p> <p>Download the tool at <a href="">this</a> link.</p> <p>This contains a few files that need to be extracted to your Pico-8 carts directory. You can find that on windows by typing %appdata% into your file explorer and finding the Pico-8 folder.</p> <p>The files contained are:</p> <p>map_style.css (This is a very very light CSS file that just removes anti aliasing on a number of browsers. The upshot is the images are much sharper and easier to work with)<br /> tile_editor.html (Open this file to start using the tool)<br /> tile_editor.js (Fell free to spool through this file. It's quite janky, I developed the tool in about a day and didn't do much in the way of prettying it up for release. Please excuse the terrible code.)<br /> map_tiles.png (this is a demonstration image that can show you how the tool works)<br /> map_file.txt (this is a JSON file that contains a stored map and tileset. Read on to understand how to load and save with this tool)</p> <p>A couple of notes before we get started, I made this in JavaScript because I wasn't in the mood to make a dedicated windows application. The upshot here is you should be able to use it across any system. As stated above the actual tool is quite unpolished, but it should still be useful.</p> <p>Instructions!</p> <img style="" border=0 src="/media/56373/Desktop Screenshot 2021.08.03 -" alt="" /> <p>This hilariously bad UI hides underneath it a powerful development tool!</p> <p>First things first, you must go to your Pico-8 project and type the following in the console.</p> <p><span style=" display:inline-block; background-color:#eee; padding:2px; margin: 4px; padding-left: 8px; padding-right: 8px; color:#222">export map_tiles.png</p> <p>This will create a PNG of your spritesheet titled map_tiles. The tool will only recognize this filename.</p> <p>Let's go over the window now.</p> <p>The Selection header shows what tile you have selected at the moment. You can flip this tile vertically or horizontally by checking either the &quot;Vertical Flip&quot; or &quot;Horizontal Flip&quot; box respectively.</p> <p>To select a tile simply click on the desired tile on the left. You can then place the tile in the tileset by clicking on the window on the right. It will store the correct tile and how it is flipped for use later.</p> <img style="" border=0 src="/media/56373/Desktop Screenshot 2021.08.03 -" alt="" /> <p>Now we have a couple more useful tools here. We will come back to Make Strings soon, but keep them in mind.</p> <p>On the Map Editor we have two windows. The left window represents the meta tileset you've created. You can select a tile by clicking on this window. The right window displays what the map will be saved as in the map editor of pico-8. It will look like garbage! This because it is a representation of the hash values of each meta tile. By doing it this way you retain the normal map size, while also getting more fidelity with the meta tile system.</p> <p>Now let's look at the mapper area.</p> <p>This is a representation of what the game will look like when rendered using a couple functions in game.</p> <p>You can place the tile you have selected in the Tile Selector by clicking on the mapper area. The map is delineated into 8x8 chunks that show what a full screen will look like.</p> <p>Now let's go over the Make Strings button.</p> <p>By clicking it two strings will be generated that make the whole thing work.</p> <p>On the left you will see the Tile String box. Select everything in here and paste it into your Pico-8 project. Then store it to a string called tiledat. Like so.</p> <p><span style=" display:inline-block; background-color:#eee; padding:2px; margin: 4px; padding-left: 8px; padding-right: 8px; color:#222">tiledat = &quot;0100020002000200020001103000121024002400210021000400130007000800080008000800071034002800280034100c000d000e000f000a000d000e000b0011001200030003001210111012003000240024002100210013000400170027002a0029002710170038100700071038001c001d001e001f001c001d001e001f001100030003000300030011101400140005000600200020004000400017003800070007103810170038100701071138002c002d002e002f00600060101b001b001100030003000300030011101400140015001600200020004000400017003800070107113810170019002a00290019103c003d003e003f00700070102b002b001100120003000300121011102200230025002600100010005000500017003700280028003710170019002a0029001910690069106900740174016910000000000101020102010201020101112200230026002500100010005000500007010800080008000800071119002a002900191076007610760075007510761000000000440045004500450045004410460046106a006a103a003b004a004a10620062106300631029002a0019002a002900191076007610760075017511761000000000540055005500550055005410560056107a007a103a003b005a005a10720072107300731029002a0039002a002900391076007610790074007400791000000000540055005500550055005410490049004b004b103a003b0009000800080009101300130010001000090008000800091076007610740174016900691000000000640065006500650065006410590059005b005b10660066101a002a0029002a002a002a002a002a0029002a0029001a107900791074007400790079100000000048004810470047101b0023000200020011001110000000000000000000000000000066100000000038100701071138000000000000000000670067100000000058005810570057102b0023000201020111001110000000000000000000000000000000000000000039002a0029003910000000000000000067006710000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000670067100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007700771000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000&quot;</p> <p>Because of the way pico-8 tokens work this will store the entire tile set while using only 3 tokens!</p> <p>These are displayed using the spr_ex function I've written below.</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>function spr_ex(num,x,y) sx = num%16 sy = flr(num/16) for i=0,1 do for j=0,1 do s = ((sx*8 + i * 4) + (sy* 256 + j * 128 )) sp = tonum('0x'..sub(tiledat,1 + s, 2 + s)) hf = sub(tiledat,3+s,3+s) == &quot;1&quot; vf = sub(tiledat,4+s,4+s) == &quot;1&quot; spr(sp,x+i*8,y+j*8,1,1,hf,vf) end 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>The function is structured this way to make it easier to read, but it can be further optimized for tokens. Not many, but remember this if you start running out!</p> <p>By using this function in leu of the spr() function you can replace sprites with metasprites!</p> <p>Now the Map String textbox is most important. Follow along carefully.</p> <p>Right click into the text box and select all. Now copy everything and open your carts folder.</p> <p>Save the pico-8 project you are working on and open its P8 file in your text editor/IDE of choice.</p> <p>Under the <strong>map</strong> header, select everything preceding <strong>sfx</strong> and delete it. Then paste the copied string into it.</p> <p>This will completely overwrite your map data so be very careful with this! It cannot be recovered without a backup!</p> <p>Now, when you load your project and go to the map editor it will look like the representation found in the tool!</p> <img style="" border=0 src="/media/56373/Desktop Screenshot 2021.08.03 -" alt="" /> <p>Finally let's look at the Save Data, Load Data and Choose File buttons!</p> <p>By clicking Save Data a txt file called map_file.txt will be generated and saved to your download folder. Because this tool is essentially a web app there is no local file storage and I didn't feel like going through the rigmarole needed to create cloud storage for the files. No worries!</p> <p>To load the file simply click choose file, select a file that was generated by this tool and then click Load Data. I have included a map_file.txt file for you to test!</p> <p>If you have further questions please reach out to me here, or at my <a href="">website!</a></p> <p>I hope this tool helps you make very interesting games!!</p> Tue, 03 Aug 2021 21:34:12 UTC faster_collision_demo <p> <table><tr><td> <a href="/bbs/?pid=95432#p"> <img src="/bbs/thumbs/pico8_faster_collision_demo-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=95432#p"> faster_collision_demo</a><br><br> by <a href="/bbs/?uid=56373"> thesebonesalone</a> <br><br><br> <a href="/bbs/?pid=95432#p"> [Click to Play]</a> </td></tr></table> </p> <p>A basic rundown of a faster Bounding Box solution.</p> <p>It uses screen partitioning to select only near objects to check for collision. What is currently running is essentially a worst case scenario where all objects are searching for all other objects with no direct referencing.</p> <p>The Algorithm<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 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>function buildarr() colarr = {} for y=0,18 do colarr[y] = {} for x=0,18 do colarr[y][x] = {} end end end function entcol(self,name,action) xx = flr(self.x/8)+2 yy = flr(self.y/8)+2 for xt = xx-1,xx+1 do for yt = yy-1,yy+1 do for obj in all(colarr[yt][xt]) do checks += 1 if ( == name and obj!= self and boxcol(self,obj)) action(self,obj) end end end end coladd = function(self) xx = flr(self.x/8) + 2 yy = flr(self.y/8) + 2 add(colarr[yy][xx],self) 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> <p>Essentially at the beginning of each frame an 18x18 matrix is created using buildarr(). Each object gets an extra function called coladd() that adds the object to the partitioned area. If a basic collision is called then the object calling the collisions will check in a 3x3 block of partitions around it. Each frame the array is emptied and filled again. With a little work this could be rearranged to only remove and add objects that have moved.</p> <p>It's still not nearly as fast as directly targeted collisions and should be used in conjunction with other methods of collision detection to provide a truly optimized experience, but it massively improves the speed of generic collision searching when you can use no other method.</p> <p>You can change the entcol function call in the mover function to &quot;entcolgen&quot; to directly compare the performance against the slower, non partitioned collision check. The partitioned algorithm can do around 200 object comparisons while the generic method tops out around 60.</p> <p>When implementing this feature you can also add more targeted partition matrices to further reduce the number of objects checked. If you had one array for bullets, one for enemies, a player object and one for pickups or powers you could reduce the number of collision checks even further.</p> Thu, 29 Jul 2021 18:04:27 UTC picozelda <p> <table><tr><td> <a href="/bbs/?pid=94610#p"> <img src="/bbs/thumbs/pico8_picozelda-2.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=94610#p"> picozelda</a><br><br> by <a href="/bbs/?uid=56373"> thesebonesalone</a> <br><br><br> <a href="/bbs/?pid=94610#p"> [Click to Play]</a> </td></tr></table> </p> <h2>A Pico Sized Adventure</h2> <p>Join Link as he fights through 3 dangerous dungeons, solves dastardly puzzles and fights deadly bosses all packed into a bite sized PNG. Bring peace to the world!</p> <p> <table><tr><td width=32> <img src="" width=32 height=32> </td> <td valign=bottom> <a style="cursor:pointer;font-size:8pt" onclick=' var el = document.getElementById("gfxcode_56373_2"); if ( == "none") = ""; else = "none"; microAjax("", function (retdata){ var el = document.getElementById("gfxcode_56373_2"); el.innerHTML = retdata; el.focus();; } ); '> [8x8]</a> </td></tr> <tr><td colspan=2> <textarea rows=3 class=lexinput id="gfxcode_56373_2" style="width:640px;background-color:#fed;display:none;overflow:hidden; font-size:6pt;"></textarea> </td> </tr> </table> <br /> <table><tr><td width=32> <img src="" width=32 height=32> </td> <td valign=bottom> <a style="cursor:pointer;font-size:8pt" onclick=' var el = document.getElementById("gfxcode_56373_3"); if ( == "none") = ""; else = "none"; microAjax("", function (retdata){ var el = document.getElementById("gfxcode_56373_3"); el.innerHTML = retdata; el.focus();; } ); '> [8x8]</a> </td></tr> <tr><td colspan=2> <textarea rows=3 class=lexinput id="gfxcode_56373_3" style="width:640px;background-color:#fed;display:none;overflow:hidden; font-size:6pt;"></textarea> </td> </tr> </table> </p> <h2>Controls</h2> <p>Dpad/Arrows to move<br /> X to swing your sword.<br /> O to Jump or interact with objects.</p> <h1>There is only one save slot</h1> <p>Do be careful which button you press on the title screen!</p> <p>Enjoy! You can reach me on my <a href="">Website</a> if you have any code questions or want to chat! Always happy to offer advice when I can!</p> <h1>Bug fixes</h1> <p>re-added a door! Dropped a loading zone somehow!</p> <p>Fixed a bug triggered by talking to the Old Woman in the Village.</p> Fri, 09 Jul 2021 04:24:50 UTC