finalpatch [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=43016 0.2 tline() now makes it really easy to efficiently draw 3d textured floors <p>No more compromises and workarounds like Ben's article (<a href="https://medium.com/@Powersaurus/3d-floor-rendering-in-pico-8-a01f241db98d">https://medium.com/@Powersaurus/3d-floor-rendering-in-pico-8-a01f241db98d</a>). The new tline() function simply lets us draw one row at a time instead of one pixel.</p> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/43016/game_0.gif" alt="" /> https://www.lexaloffle.com/bbs/?tid=37380 https://www.lexaloffle.com/bbs/?tid=37380 Thu, 16 Apr 2020 11:11:08 UTC Abstraction Cost <p>So I find that organizing my code with data structures and functions adds a lot to the runtime cost in PICO-8.</p> <p>For example, doing vector math with objects like {x=1,y=2}, and functions like</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>function vadd(v1,v2) return {x=v1.x+v2.x,y=v1.y+v2.y} 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>greatly increases the readability of my code, but at the cost of significant performance hit.</p> <p>Coming from a C++ background, this really upsets me. Modern C++ compilers are extremely good at optimising, and it's often possible to write very expressive code with almost zero overhead. While in PICO-8, if I want my code to go fast, I have to write it in a rather repetitive and messy way.</p> <p>I like how PICO-8 is deliberately restrictive, but is there a way to write clean code without hurting performance too much? What are your thoughts?</p> https://www.lexaloffle.com/bbs/?tid=37075 https://www.lexaloffle.com/bbs/?tid=37075 Sun, 15 Mar 2020 06:28:57 UTC