ruairidx [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=46702 EUROPICO 88 <h1>EUROPICO 88</h1> <h3>The unofficial tie-in video game for the 1988 European Championship in West Germany!</h3> <p> <table><tr><td> <a href="/bbs/?pid=82276#p"> <img src="/bbs/thumbs/pico8_ruairidx_europico88_v110-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=82276#p"> EUROPICO 88 (v1.1.0)</a><br><br> by <a href="/bbs/?uid=46702"> ruairidx</a> <br><br><br> <a href="/bbs/?pid=82276#p"> [Click to Play]</a> </td></tr></table> </p> <hr /> <img style="" border=0 src="https://github.com/RuairiD/europico88/raw/master/doc/1.0.0_2.gif?raw=true" alt="" /> <hr /> <p><em>EUROPICO 88</em> is a top-down football game heavily inspired by 90s semi-arcade-style football games like <em>Sensible Soccer</em> and <em>International Superstar Soccer</em> (<a href="https://www.youtube.com/watch?v=Uk1A6-W2h_0">recognise that menu music...?</a>). Simulation aspects like substitutions, through-balls, slide tackles, teams with different stats and referees were eschewed in favour of speed, simplicity and an AI that won't let you have it easy but is satisfying to outfox. Players can choose any of the 8 teams participating in the EURO 88 finals in West Germany, and can pit themselves against their friends, the computer, or just sack it off and watch the computer play itself!</p> <p><a href="https://github.com/RuairiD/europico88">Source</a></p> <hr /> <img style="" border=0 src="https://github.com/RuairiD/europico88/raw/master/doc/1.0.0_1.gif?raw=true" alt="" /> <hr /> <h2>Controls</h2> <p>(also provided in-game)</p> <ul> <li>D-Pad - move controlled player <ul> <li>run to the goal! run to the ball! run wherever you desire!</li> </ul></li> <li>O (while in possession) - pass in direction of D-Pad <ul> <li>pass will automatically lock onto a player in the selected general direction</li> </ul></li> <li>O (not in possession) - change selected player <ul> <li>new player will be the player estimated to reach the ball quickest; selected player will also occasionally switch automatically if a better option is available</li> </ul></li> <li>X - SHOOT! <ul> <li>players always shoot towards goal; no need to aim.</li> </ul></li> </ul> <h2>Gotchas</h2> <ul> <li>Tackling is simply a matter of running into the player on the ball. Dispossessed players will not be able to run or reclaim the ball for a short period. Don't get caught in possession!</li> <li>Players have no control of goalkeepers. Keepers will come to claim a ball that's not in possession of a teammate, and will otherwise just try to stay in front of the ball. In any case, when given the chance, they will leather it back upfield.</li> <li>Throw-ins have been replaced by kick-ins for simplicity.</li> </ul> <h2>Tips</h2> <p>Computer giving you a hard time? Wish you were more like Marco van Basten and less like Peter Beardsley*? Try these tips to up your game:</p> <ul> <li>Use your team's width. If the midfield gets congested, send the ball out to your wingers before bringing it back into your centre forwards.</li> <li>It's harder for the keeper to block a fast shot. Try and shoot up close to give them minimal chance!</li> <li>If you can't get close, it's also harder for the keeper to make a save if they can't even reach the ball! Try shooting across the keeper from outside the posts.</li> <li>Sometimes moving forward isn't the best option. Try passing backwards and drawing the opposition forward, opening the space up behind them.</li> <li>If you're under pressure in defence, don't feel bad about putting your foot through it. When in doubt, get it out.</li> </ul> <hr /> <p>My greatest regret is that I ran out of tokens for a full tournament mode, where players could have played through a virtual tournament and been crowned Champions of Europe. All that said, if you have a pen and paper, you can do it yourself! <a href="/media/46702/IMG_20200925_155359.jpg">Look!</a></p> <hr /> <p>*<em>absolutely no offence is intended to either Mr. Beardsley or Newcastle fans as a whole; this is not intended as a disparagement, it is only intended to illustrate that Marco van Basten was very good at football.</em></p> https://www.lexaloffle.com/bbs/?tid=39731 https://www.lexaloffle.com/bbs/?tid=39731 Fri, 25 Sep 2020 23:34:50 UTC Propulsion - a physics-puzzle-platformer <h4><em>&quot;Imprisoned beneath the earth...only your wit, guile and a plasma pistol for company. However will you escape?&quot;</em></h4> <h1>Propulsion</h1> <h3>25 levels of mind-bending physics-puzzle-platforming fun!</h3> <p> <table><tr><td> <a href="/bbs/?pid=81877#p"> <img src="/bbs/thumbs/pico8_propulsion_1_0_0-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=81877#p"> Propulsion v1.0.0</a><br><br> by <a href="/bbs/?uid=46702"> ruairidx</a> <br><br><br> <a href="/bbs/?pid=81877#p"> [Click to Play]</a> </td></tr></table> </p> <img style="" border=0 src="/media/46702/release_4.gif" alt="" /> <p><a href="https://github.com/RuairiD/pico8-propulsion">Source</a></p> <p>This is actually a remake of a Flash game I made back in 2011-2012, which you can play <a href="https://www.kongregate.com/games/ruairi_/propulsion">here</a>. I even remade the original music in glorious 4-channel chiptune (I got the original music from the Newgrounds Audio Portal and it's since been deleted. Wish I could find the original artist!)</p> <p>I made a post before about <a href="https://www.lexaloffle.com/bbs/?tid=39427">porting a physics library called bump to PICO-8</a>; this is the first project I've made using it in earnest. I mentioned concerns in that thread about token pressure from including the library. In the end, the greatest strain on token count was representing levels in code (the game doesn't actually run while unminified); I had to get creative with string encoding and other tricks to make it all fit (8191/8192 tokens!). I wrote a pretty ropey python script for converting multiple Tiled tmx files into generated lua code (you can find the script <a href="https://github.com/RuairiD/pico8-propulsion/blob/master/tools/tmxtolevels.py">here</a>). I encoded the tiles as PICO-8-compatible hex strings (this meant that the data just needed to be copied into a reserved section of the map when loading a level); the rest was encoded as structures of entity types, co-ordinates and properties (e.g. switch colours, platform directions).</p> https://www.lexaloffle.com/bbs/?tid=39613 https://www.lexaloffle.com/bbs/?tid=39613 Wed, 16 Sep 2020 02:37:31 UTC bump.lua for PICO-8 <p>Previously when making games in LOVE2D, I made use of a simple 2D axis-aligned physics library called <a href="https://github.com/kikito/bump.lua">bump.lua</a>. I especially enjoyed the versatility (e.g. different collision types and outcomes based on custom filtering) and the simple, intuitive API. I wanted to see how effectively it could work in PICO-8, so I forked it.</p> <p><a href="https://github.com/RuairiD/pico8-bump.lua">pico8-bump.lua</a></p> <p>The main obstacle to running bump was that PICO-8 has no access to the <em><span style=" display:inline-block; background-color:#eee; padding:2px; margin: 4px; padding-left: 8px; padding-right: 8px; color:#222">math</em> lua module and uses <a href="https://pico-8.fandom.com/wiki/Math">16-bit ints</a>, so all <em><span style=" display:inline-block; background-color:#eee; padding:2px; margin: 4px; padding-left: 8px; padding-right: 8px; color:#222">math.floor</em> etc. calls were replaced with their PICO-8 equivalents. <em><span style=" display:inline-block; background-color:#eee; padding:2px; margin: 4px; padding-left: 8px; padding-right: 8px; color:#222">math.huge</em> did not have a standard PICO-8 analog, so the 16 bit int max (32767) was hardcoded instead. Likewise, PICO-8 lua does not parse <em><span style=" display:inline-block; background-color:#eee; padding:2px; margin: 4px; padding-left: 8px; padding-right: 8px; color:#222">10e-10</em> style numbers, so <em><span style=" display:inline-block; background-color:#eee; padding:2px; margin: 4px; padding-left: 8px; padding-right: 8px; color:#222">DELTA</em> was changed to a regular decimal value. In addition, PICO-8 does not have access to the <em><span style=" display:inline-block; background-color:#eee; padding:2px; margin: 4px; padding-left: 8px; padding-right: 8px; color:#222">table</em> module, so a separate sort function was added to replace <em><span style=" display:inline-block; background-color:#eee; padding:2px; margin: 4px; padding-left: 8px; padding-right: 8px; color:#222">table.sort</em>.</p> <p>I also deleted portions of the library that I didn't consider necessary for my own uses to save on tokens and characters:</p> <ul> <li><em><span style=" display:inline-block; background-color:#eee; padding:2px; margin: 4px; padding-left: 8px; padding-right: 8px; color:#222">bounce</em> and <em><span style=" display:inline-block; background-color:#eee; padding:2px; margin: 4px; padding-left: 8px; padding-right: 8px; color:#222">touch</em> collision types</li> <li>anything involving querying segments (note: querying rects and points are unchanged)</li> <li>all sanity checks and assertions that bump would normally make e.g. <em><span style=" display:inline-block; background-color:#eee; padding:2px; margin: 4px; padding-left: 8px; padding-right: 8px; color:#222">assertIsPositiveNumber</em> or <em><span style=" display:inline-block; background-color:#eee; padding:2px; margin: 4px; padding-left: 8px; padding-right: 8px; color:#222">assertIsRect</em>. While these are useful for debugging and avoid weird inconsistent states, they eat up precious tokens. I've used bump enough in other games to feel comfortable enough without these safeguards.</li> <li>public <em><span style=" display:inline-block; background-color:#eee; padding:2px; margin: 4px; padding-left: 8px; padding-right: 8px; color:#222">bump.rect</em> and <em><span style=" display:inline-block; background-color:#eee; padding:2px; margin: 4px; padding-left: 8px; padding-right: 8px; color:#222">bump.responses</em> tables. I honestly never used them anyway.</li> </ul> <p>What's left is still a robust physics library for rectangles and points. Here's a quick demo platformer using bump.</p> <p> <table><tr><td> <a href="/bbs/?pid=81350#p"> <img src="/bbs/thumbs/pico8_bumpdemo-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=81350#p"> bumpdemo</a><br><br> by <a href="/bbs/?uid=46702"> ruairidx</a> <br><br><br> <a href="/bbs/?pid=81350#p"> [Click to Play]</a> </td></tr></table> </p> <p>Naturally, the primary concern with any library in PICO-8 is tokens and characters. Here's what it clocks in at:</p> <table> <thead> <tr> <th></th> <th>Usage</th> <th>Max</th> <th>%</th> </tr> </thead> <tbody> <tr> <td>Tokens</td> <td>2646</td> <td>8192</td> <td>32.3%</td> </tr> <tr> <td>Characters (unminified)</td> <td>17390</td> <td>65535</td> <td>26.5%</td> </tr> <tr> <td>Characters (minified)</td> <td>9366</td> <td>65535</td> <td>14.3%</td> </tr> </tbody> </table> <p>I haven't quite figured out just how big that footprint is. Obviously 32.3% is a sizeable number of tokens to give away, but, like I mentioned, bump's interface is pretty simple, which saves tokens later down the road (every attempt to move an object within the world can use as few as 11 tokens). In addition, it's possible to go back and delete more from the library before releasing if the functionality is unused (e.g. for the demo above, anything involving querying the world is unused and could be deleted). I'm sure bump would be overkill for any game that doesn't require anything beyond simple collision detection with overlapping rectangles, but I'm optimistic it could still be beneficial for more complex use cases. I plan to find out.</p> https://www.lexaloffle.com/bbs/?tid=39427 https://www.lexaloffle.com/bbs/?tid=39427 Sun, 30 Aug 2020 19:55:34 UTC 16 Greens <h1>16 Greens</h1> <h3>A bog standard minigolf game with 4-player pass-and-play multiplayer</h3> <p> <table><tr><td> <a href="/bbs/?pid=81310#p"> <img src="/bbs/thumbs/pico8_sixteengreens-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=81310#p"> 16 Greens (v1.2.0)</a><br><br> by <a href="/bbs/?uid=46702"> ruairidx</a> <br><br><br> <a href="/bbs/?pid=81310#p"> [Click to Play]</a> </td></tr></table> </p> <p>I heard about PICO-8 literally years ago and completely forgot about it until last weekend. Downloaded it and spent the week having a great time getting to grips with it. <em>16 Greens</em> is the first 'proper' game I've made so far.</p> <p><a href="https://github.com/RuairiD/16greens">Source</a></p> <h2>Lessons Learned</h2> <ul> <li>I tried to lean into the 'PICO-8 way' as much as possible; usually I'd make maps in <a href="https://github.com/bjorn/tiled">Tiled</a> and import them into whatever game I'm making, but since PICO-8 has a specific cart block for map data, I figured it was best to use that instead (I still used Tiled, I just wrote a python script to convert tmx files into PICO-8 map data). For this game, since I wanted each hole to be a full screen, this limited me to 16 holes, but I figured this would help me preserve precious tokens and characters. In hindsight, I actually seriously underestimated just how many tokens and characters PICO-8 affords you; I ended up under 50% of the token limit and didn't even use 20% of the character limit (after minifying). I'll try storing map data in code in future (especially since string encoding doesn't eat up many tokens).</li> <li>Minifying helped with the character count significantly (~12k minified vs. ~32k unminified), although obviously did nothing for tokens. That said, if I start storing more map and graphics data in code, then character count will become more important, so I'll stick with minifying for future carts (I used <a href="https://github.com/mathiasbynens/luamin">luamin</a>).</li> </ul> https://www.lexaloffle.com/bbs/?tid=39406 https://www.lexaloffle.com/bbs/?tid=39406 Fri, 28 Aug 2020 21:17:11 UTC