freds72 [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=25532 menuitem function ignored if game doesn't have a _update loop <p>How to reproduce:</p> <ul> <li>register custom menu entry</li> <li>run game with an endless while/flip loop</li> </ul> <p><strong>bug</strong>: menu item code is never triggered</p> <p> <table><tr><td> <a href="/bbs/?pid=86023#p"> <img src="/bbs/thumbs/pico8_gijenijato-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=86023#p"> gijenijato</a><br><br> by <a href="/bbs/?uid=25532"> freds72</a> <br><br><br> <a href="/bbs/?pid=86023#p"> [Click to Play]</a> </td></tr></table> </p> https://www.lexaloffle.com/bbs/?tid=41024 https://www.lexaloffle.com/bbs/?tid=41024 Fri, 01 Jan 2021 14:16:53 UTC Feature request: keyconfig api <p>It is not possible to present actual keys being used by pico in game.<br /> Pico8 keyconfig can be used to remap keys.</p> <p>Proposal:</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> keyconfig id [player] returns the character being used for button id and player (default 0) </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=40825 https://www.lexaloffle.com/bbs/?tid=40825 Wed, 16 Dec 2020 08:31:24 UTC [multicart] Pause resets screen palette <p>How to reproduce:</p> <ul> <li>launch cart</li> <li>set custom screen palette: </li> </ul> <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> pal({140,1,139,3,4,132,133,7,6,134,5,8,2,9,10},1) </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <ul> <li>load data:</li> </ul> <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> reload(0,0,0x4300,&quot;cart2.p8&quot;) </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <ul> <li>while data gets processed, hit &quot;pause&quot;</li> <li>bug: screen palette gets reset</li> </ul> <p>Can be reproduced on POOM on the loading screen (<a href="https://freds72.itch.io/poom">https://freds72.itch.io/poom</a>)</p> <img style="" border=0 src="/media/25532/Capture.PNG" alt="" /> https://www.lexaloffle.com/bbs/?tid=40798 https://www.lexaloffle.com/bbs/?tid=40798 Mon, 14 Dec 2020 20:57:32 UTC headless export bugs <p>Using -export command to automate multi cart package building and blocked by a number of bugs:</p> <ul> <li>unable to specify HTML plate path (only works if export is actually performed from home folder)</li> <li>inconsistent path parameters between bin and html exports:</li> </ul> <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> # works for html pico8.exe carts\cart_0.p8 -home . -export &quot;game_alpha.html -p my_plate cart_1.p8 cart_2.p8&quot; # doesn't work for bin pico8.exe carts\cart_0.p8 -home . -export &quot;game_alpha.bin cart_1.p8 cart_2.p8&quot; # works for bin cd carts pico8.exe cart_0.p8 -export &quot;game_alpha.bin cart_1.p8 cart_2.p8&quot; </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <ul> <li>incomplete js generated unless export is run from carts folder</li> </ul> <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> # produces broken js pico8.exe carts\cart_0.p8 -home . -export &quot;game_alpha.html -p my_plate cart_1.p8 cart_2.p8&quot; </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=40098 https://www.lexaloffle.com/bbs/?tid=40098 Sat, 31 Oct 2020 14:01:28 UTC thick line routine <p>Thick line drawing routine (as a reply to <a href="https://www.lexaloffle.com/bbs/?uid=42638"> @JadeLombax</a> Twitter).<br /> <table><tr><td> <a href="/bbs/?pid=80095#p"> <img src="/bbs/thumbs/pico8_rabogemeri-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=80095#p"> rabogemeri</a><br><br> by <a href="/bbs/?uid=25532"> freds72</a> <br><br><br> <a href="/bbs/?pid=80095#p"> [Click to Play]</a> </td></tr></table> </p> <p>Manual:</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> linefill x0 y0 x1 y1 r [col] draw a 2*r pixel wide line note: r must be &gt;= 0.5 to produce meaningful results note: the code uses sub-pixel precision rasterization, allowing smooth movement </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>Example:</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> -- 4 pixel wide white line linefill(45,34,67,96,2,7) </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=39016 https://www.lexaloffle.com/bbs/?tid=39016 Wed, 29 Jul 2020 16:32:40 UTC tline incorrect clipping <p>introduced in 0.2.0d<br /> how to reproduce:</p> <ul> <li>call tline with a start point outside of screen boundaries</li> <li>tline starts at 0 without adjusting lookup coordinates</li> </ul> <p>repro cart:<br /> <table><tr><td> <a href="/bbs/?pid=75284#p"> <img src="/bbs/thumbs/pico8_kuwirapima-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=75284#p"> kuwirapima</a><br><br> by <a href="/bbs/?uid=25532"> freds72</a> <br><br><br> <a href="/bbs/?pid=75284#p"> [Click to Play]</a> </td></tr></table> </p> https://www.lexaloffle.com/bbs/?tid=37561 https://www.lexaloffle.com/bbs/?tid=37561 Fri, 24 Apr 2020 12:30:10 UTC Unable to draw after mouse pan <p>How to reproduce:</p> <ul> <li>switch to spritesheet</li> <li>select pen tool</li> <li>draw</li> <li>middle-mouse click to pan</li> <li>draw does nothing outside the initial zone</li> </ul> <img style="" border=0 src="/media/25532/assault_1.gif" alt="" /> https://www.lexaloffle.com/bbs/?tid=37409 https://www.lexaloffle.com/bbs/?tid=37409 Fri, 17 Apr 2020 15:52:20 UTC nil not handled as zero in bit operators <p>How to reproduce:</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> -- outputs zero local b=band(nil,4) -- throws error (arithmetic on field ?) local b=nil&lt;&lt;4 </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=37405 https://www.lexaloffle.com/bbs/?tid=37405 Fri, 17 Apr 2020 07:07:52 UTC info + #include reports random figures <p>How to reproduce:</p> <ul> <li>cart with 3 includes</li> </ul> <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> #include includes/bold.lua #include includes/bigscore.lua ... some other code ... #include includes/tquad.lua </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <ul> <li>reports invalid 'printb' not found (included in bold.lua)</li> <li>info produces random output:</li> </ul> <img style="" border=0 src="/media/25532/assault_001.png" alt="" /> <ul> <li>ctrl-r clears the error and runs the cart ok</li> </ul> https://www.lexaloffle.com/bbs/?tid=37404 https://www.lexaloffle.com/bbs/?tid=37404 Fri, 17 Apr 2020 07:00:23 UTC bit operators without assignment bogus syntax error message <p>how to reproduce: </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> for i=1,n do i&lt;&lt;5 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>Output:</p> <img style="" border=0 src="/media/25532/null_syntax_error.PNG" alt="" /> <p>or</p> <img style="" border=0 src="/media/25532/japanese_syntax_error.PNG" alt="" /> <p>Repro cart:<br /> <table><tr><td> <a href="/bbs/?pid=74867#p"> <img src="/bbs/thumbs/pico8_towakowibo-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=74867#p"> towakowibo</a><br><br> by <a href="/bbs/?uid=25532"> freds72</a> <br><br><br> <a href="/bbs/?pid=74867#p"> [Click to Play]</a> </td></tr></table> </p> https://www.lexaloffle.com/bbs/?tid=37403 https://www.lexaloffle.com/bbs/?tid=37403 Fri, 17 Apr 2020 06:36:36 UTC [request] Multicart on BBS <p>Multicart is really a nice expansion feature, to offer content beyond the 32K boundary.<br /> However, with reload not supporting BBS-hosted carts, large games are banned from BBS.</p> <p>Is that something considered in the pico roadmap to bring back multicart games to the &quot;official&quot; forums?</p> <p>Note that supporting more than a couple of data carts will require rework of the BBS file management.</p> <ul> <li>support for upload many files at once</li> <li>support for listing cart identifiers</li> <li>support for headless export of p8.png (limited to html/bin at time of writing)</li> <li>ability to assign same id pattern to many carts (ex: vracing_0... vracing_10)</li> </ul> <p>Cheers</p> https://www.lexaloffle.com/bbs/?tid=36991 https://www.lexaloffle.com/bbs/?tid=36991 Wed, 04 Mar 2020 19:53:52 UTC reload bug <p>As per documentation, reload does not support BBS carts.<br /> However, the function fails without any error while trying:</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> -- does nothing (or not??) reload(0,0,0x4300,&quot;#vracing_5&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>Could the function reports an error in such case?</p> https://www.lexaloffle.com/bbs/?tid=36962 https://www.lexaloffle.com/bbs/?tid=36962 Sun, 01 Mar 2020 21:42:32 UTC Code panel freezes browser <p>On Chrome: Version 79.0.3945.88 (64 bits)<br /> How to reproduce:</p> <ul> <li>navigate to any game</li> <li>click on &quot;code&quot; dropdown</li> <li>page becomes unresponsive (cannot be selected, game cannot be launched...)</li> </ul> <p>Not reproduced on Edge (and apparently on Firefox - cannot test)</p> https://www.lexaloffle.com/bbs/?tid=36463 https://www.lexaloffle.com/bbs/?tid=36463 Thu, 02 Jan 2020 21:05:19 UTC snow! <p> <table><tr><td> <a href="/bbs/?pid=70497#p"> <img src="/bbs/thumbs/pico8_freds72_snow-3.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=70497#p"> freds72_snow</a><br><br> by <a href="/bbs/?uid=25532"> freds72</a> <br><br><br> <a href="/bbs/?pid=70497#p"> [Click to Play]</a> </td></tr></table> </p> <p>Winter is coming (as every year actually...), time for some skiing!<br /> Enjoy going down the slope, trying to beat your previous track record or freeriding skills!</p> <p>Grab coins for some extra time bonus - watch out for off track hazards!<br /> Your polar jacket can sustain a couple of direct hits, avoid trees anyway...</p> <p>Note: there is no end racing line - you <strong>will</strong> loose :] question is how much time will you last?</p> <img style="" border=0 src="https://www.lexaloffle.com/bbs/files/25532/snow_intro.gif" alt="" /> <p><img style="" border=0 src="https://www.lexaloffle.com/bbs/files/25532/snow_gameplay1.gif" alt="" /> <img style="" border=0 src="https://www.lexaloffle.com/bbs/files/25532/snow_gameplay2.gif" alt="" /></p> <h2>Controls</h2> <ul> <li>Left/Right: control direction</li> <li>c: jump (hold to charge)</li> <li>x: restart (if stuck)</li> <li>follow GPS pointer if lost</li> </ul> <h2>Tracks</h2> <ul> <li>blue: easy</li> <li>red: moderate, with side tracks. Practice your tricks.</li> <li>black: heavy slope, with side tracks. Tricks or time out :)</li> </ul> <h1>About the PICO-8 Advent Calendar</h1> <p>This winter another group of PICO-8 elves has worked hard to release a shiny new toy every day in December. Check out the <a href="https://www.lexaloffle.com/bbs/?tid=36076">Pico-8 Advent Calendar 2019</a> each day for a new surprise! </p> <p>There's even more festive fun waiting on last year's calendar! <a href="https://www.lexaloffle.com/bbs/?tid=32388">https://www.lexaloffle.com/bbs/?tid=32388</a></p> <p>Happy Holidays!</p> <h1>Devlog</h1> <p>Before I joined the ranks of the Advent Calendar 2019, <a href="https://www.lexaloffle.com/bbs/?uid=15227"> @johanp</a>, <a href="https://www.lexaloffle.com/bbs/?uid=28958"> <a href="https://www.lexaloffle.com/bbs/?uid=28958"> @p01</a></a> and others were toying with terrain generation - resulting in this:</p> <img style="" border=0 src="https://www.lexaloffle.com/bbs/files/25532/wipeout_0.gif" alt="" /> <p>With the theme being set to winter, I had this prototype ready to test the idea:</p> <img style="" border=0 src="https://www.lexaloffle.com/bbs/files/25532/st8p_1.gif" alt="" /> <p>The gameplay evolved from some endless runner to something more akin a time attack game.<br /> Thanks to feedback from early testers, and several gameplay changes, I think I have something that is fun to play and challenging enough!</p> <p>Source code (+unminified version): <a href="https://github.com/freds72/midwinter">https://github.com/freds72/midwinter</a></p> <h2>Update 1.3</h2> <ul> <li>updated: high level gameplay :]</li> <li>know bug: minor visual artifacts on black track (due to the way I cull terrain)</li> </ul> <h1>Credits</h1> <ul> <li>Advent Calendar folks! (<a href="https://www.lexaloffle.com/bbs/?uid=16975"> @enargy</a> :)</li> <li>Midwinter mask: Andrew Elkerton (I guess...)</li> <li>intro music: @gruber_music</li> <li>trifill: <a href="https://www.lexaloffle.com/bbs/?uid=28958"> <a href="https://www.lexaloffle.com/bbs/?uid=28958"> @p01</a></a></li> </ul> https://www.lexaloffle.com/bbs/?tid=36092 https://www.lexaloffle.com/bbs/?tid=36092 Mon, 02 Dec 2019 19:39:05 UTC Rotated Ellipse Fill <p> <table><tr><td> <a href="/bbs/?pid=66809#p"> <img src="/bbs/thumbs/pico8_ellipsefill-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=66809#p"> ellipsefill</a><br><br> by <a href="/bbs/?uid=25532"> freds72</a> <br><br><br> <a href="/bbs/?pid=66809#p"> [Click to Play]</a> </td></tr></table> </p> <p>A little experiment with filled ellipse, supporting any rotation angle (the tricky part!).<br /> The code is moderately fast as it finds the root of the ellipse equation to get the segment extent for each row.</p> <p>Car headlight example use:</p> <img style="" border=0 src="https://www.lexaloffle.com/bbs/files/25532/ellipse_0.gif" alt="" /> https://www.lexaloffle.com/bbs/?tid=35124 https://www.lexaloffle.com/bbs/?tid=35124 Tue, 20 Aug 2019 20:47:24 UTC [feature] fast loading for multi-cart <p><a href="https://www.lexaloffle.com/bbs/?uid=1"> @zep</a><br /> A couple of devs are investing into multicart games (like 5 or more data carts).<br /> We are all put back by the artificial loading times (eg <em>minutes</em>)</p> <p>Would it be possible for the fat client to either ignore load time throttling, or only activat throttling for the published version?<br /> I want the multicart multiverse, not loading screens ;)</p> https://www.lexaloffle.com/bbs/?tid=34813 https://www.lexaloffle.com/bbs/?tid=34813 Tue, 23 Jul 2019 06:44:48 UTC stat(102) does not work for iframes <p>Using the <em>cough</em> undocumented <em>cough</em> stat(102) from a game hosted on itch.io, I got back:</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> v6p9d9t4.ssl.hwcdn.net </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 is indeed the url of the iframe (which doesn't help).<br /> A more correct behavior would be to report the parent page url, with the benefits of:</p> <ul> <li>having a predictable outcome</li> <li>actually preventing rogue hosting (somehow...)</li> </ul> <p>Note: Looking at the HTML, I see that url is retrieved from:</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> var str = window.location.hostname; </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>Using that alternate code would fix the bug:</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> var str = (parent !== window) ? document.referrer : document.location; </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=34800 https://www.lexaloffle.com/bbs/?tid=34800 Sun, 21 Jul 2019 08:37:57 UTC Licences PICO-8 &agrave; gagner! <p><em>Ce post est la version fran&ccedil;aise de:</em> <a href="https://www.lexaloffle.com/bbs/?tid=34615">PICO-8 Giveaway</a></p> <p>Initi&eacute; par <a href="https://www.lexaloffle.com/bbs/?uid=13822"> @Liquidream</a>, plusieurs developpeurs offrent des licences pico8 &agrave; des jeunes (et moins jeunes) qui n'auraient pas les moyens mais pleins d'id&eacute;es!</p> <h1>Participation</h1> <p>Pour avoir une chance de gagner, repondez &agrave; la <a href="https://www.lexaloffle.com/bbs/?tid=34615">discussion officielle</a> avec un petit message:</p> <ul> <li>pourquoi vous voulez une licence?</li> <li>quel jeu(x) comptez-vous cr&eacute;er?</li> </ul> <h1>Les R&egrave;gles</h1> <ul> <li>Ouvert &agrave; tous (sauf ceux qui peuvent se payer une licence ET un sandwich!)</li> <li>Une seule entr&eacute;e par personne</li> <li>Date de cloture (ouch!) Samedi 6 Juillet @ 11:00 (heure Paris)</li> <li>Les gagnants seront choisis <em>au hasard</em> </li> <li>Il y aura autant de gagnants que de licences offertes</li> <li>La licence sera attribu&eacute;es via un compte mail (message priv&eacute;)</li> </ul> <p>Bonne chance 😁🤞</p> https://www.lexaloffle.com/bbs/?tid=34630 https://www.lexaloffle.com/bbs/?tid=34630 Thu, 04 Jul 2019 19:16:58 UTC Ghost Rally <h1>Ghost Rally</h1> <p> <table><tr><td> <a href="/bbs/?pid=64950#p"> <img src="/bbs/thumbs/pico8_grally-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=64950#p"> grally</a><br><br> by <a href="/bbs/?uid=25532"> freds72</a> <br><br><br> <a href="/bbs/?pid=64950#p"> [Click to Play]</a> </td></tr></table> </p> <h2>Game</h2> <p>The game is a race-against-yourself rally game. It features accurate rigid body physics and car handling.<br /> Goal is to beat yourself every lap!</p> <p>Enjoy racing as in the 80's, whith over powered cars very close to the public!<br /> <em>tip</em> hitting any of the lil' dudes: <table><tr><td width=244> <img src="https://www.lexaloffle.com/bbs/gfxc/25532_4.png" width=244 height=64> </td> <td valign=bottom> <a style="cursor:pointer;font-size:8pt" onclick=' var el = document.getElementById("gfxcode_25532_4"); if (el.style.display == "none") el.style.display = ""; else el.style.display = "none"; microAjax("https://www.lexaloffle.com/bbs/gfxc/25532_4.txt", function (retdata){ var el = document.getElementById("gfxcode_25532_4"); el.innerHTML = retdata; el.focus(); el.select(); } ); '> [61x16]</a> </td></tr> <tr><td colspan=2> <textarea rows=3 class=lexinput id="gfxcode_25532_4" style="width:640px;background-color:#fed;display:none;overflow:hidden; font-size:6pt;"></textarea> </td> </tr> </table> incurs a +5s time penalty :]</p> <p><em>warning</em> the game is complete yet the car handling is <strong>really</strong> picky - I am releasing it as is, as I can't tweak the gameplay without breaking the physic engine :/</p> <h2>Controls</h2> <ul> <li>left/right: turn</li> <li>up/down: accelerate/brake</li> <li>c: re<strong>c</strong>over (when flipping over!)</li> </ul> <h1>Dev Log</h1> <p>Source code &amp; tools: <a href="https://github.com/freds72/ghost-rally">ghost-rally</a></p> <h2>Credits:</h2> <p>Sound effect code: taken from <a href="https://www.lexaloffle.com/bbs/?uid=10050"> @tiagosr</a> rally game<br /> Trifill: <a href="https://www.lexaloffle.com/bbs/?uid=28958"> <a href="https://www.lexaloffle.com/bbs/?uid=28958"> @p01</a></a></p> <h2>Physic Engine</h2> <p>Physic engine was started from scratch following <a href="http://www.cs.cmu.edu/~baraff/sigcourse/notesd1.pdf">Barraf's</a> 'classic' paper.<br /> I quickly dropped this version as it relied too much on numeric convergence !</p> <p>The current version uses part of <a href="https://github.com/RandyGaul/qu3e">Randy Gaul C++ physic library</a> and <a href="https://www.randygaul.net/2013/03/27/game-physics-engine-part-1-impulse-resolution">underlying principles</a>.<br /> The key aspect to get stable collision is to resolve impacts only for the incident face, e.g. the plane most facing the ground:</p> <img style="" border=0 src="https://www.lexaloffle.com/bbs/files/25532/rally_9.gif" alt="" /> <p>This is obviously an heavily simplified version, limited to dynamic-to-static resolution.<br /> Randy's engine architecture relies on very few magic constants and is extremely stable (well, as long as pico numbers don't get in the way!!).</p> <p>The physic engine is designed as an extension a generic 3d actor class and can easily be taken out for other games.</p> <h2>Car Physic</h2> <p>The car is modeled using a front and rear tire. Each tire has lateral and longitudinal forces, as detailed in this article: <a href="http://theracingline.net/2018/race-car-tech/race-tech-explained/tyres-combined-tyre-forces/">The Racing Line - Combined Tyre Forces</a>.<br /> Other good readings:<br /> <a href="http://www.asawicki.info/Mirror/Car%20Physics%20for%20Games/Car%20Physics%20for%20Games.html">Car Physics for Games</a><br /> <a href="https://www.iforce2d.net/b2dtut/top-down-car">Box2d Top Down Racing Game</a></p> <p>The gif above shows forces applied to the car and their application point:</p> <ul> <li>G force (down)</li> <li>read tyre pushing car (with a lateral component to counter slide)</li> <li>front tyre and turning forces (again with a lateral component)</li> </ul> <p>Slip angle and slip ratio curves are defined using SFX 4 and 5 - tweak them to see effect in game!</p> <img style="" border=0 src="https://www.lexaloffle.com/bbs/files/25532/rally_001.png" alt="" /> <h2>Terrain</h2> <p>The game started as a terrain renderer using marching squares.<br /> Terrain height map is 64x64, displayed as a 128x128 grid to display marching square &quot;diamond tiles&quot;:</p> <img style="" border=0 src="https://www.lexaloffle.com/bbs/files/25532/rally_wireframe.gif" alt="" /> <h2>Textured Car</h2> <p>The car is textured mapped, using a custom version of <a href="https://www.lexaloffle.com/bbs/?uid=28958"> <a href="https://www.lexaloffle.com/bbs/?uid=28958"> @p01</a></a> trifill.<br /> The Blender model directly references an export of the cart spritesheet.</p> <h2>Toolchain</h2> <p>The game uses my usual Blender/Python export toolchain.<br /> A custom terrain editor is available as a pico-8 cart (contact me if needed)</p> https://www.lexaloffle.com/bbs/?tid=34424 https://www.lexaloffle.com/bbs/?tid=34424 Sun, 02 Jun 2019 14:33:39 UTC Help on __sfx__ section byte format <p>I am writing data to a p8 file from a Python program - format for 0x0-0x3200 ROM range is ok.<br /> Issue is sfx section - each sfx (68 bytes) is actually written as 84 bytes (??) with empty bits left and right.<br /> I have no clue what is the masking/bitshifting/... logic between my input value and the resulting p8 string.</p> <p>Example:</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> poke4(0x3200,0x1234.5678) cstore() </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>produces:</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> __sfx__ 000100003813534011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>wtf??</p> https://www.lexaloffle.com/bbs/?tid=34167 https://www.lexaloffle.com/bbs/?tid=34167 Thu, 09 May 2019 18:44:42 UTC