getting into the runtime part - you guessed it, it involves another #pico8 cartridge, this time on a little phone device
(common disclaimer: windows-screen-recorder adds a little vertical offset to the mouse-cursor position. it looks accurate in-game!)
doing some #pico8 emulator improvements by seeing how much it takes to get this old game to run correctly
spoiler: it's gonna need a bunch of new features. gonna ignore audio for now...there's plenty of other stuff to figure out
it's going well...got the script to parse (~2k lines!), and have been whittling away at the resulting compiler errors. some lua-side highlights:
- for-pairs, for-all, while, break
- revise names if C# considers them illegal (like a var called "byte" or "readonly")
- exponent operator
- better handling of local-var scope and local-var-shadowing
last remaining compiler fixes: "value or default" notation and overwriting deep-elements in tables
then...on to the missing P8-API functionality!
okay good news and bad news
the good news: tiny-platformer compiles successfully!
the bad news: the burst compiler takes 4 minutes to optimize it
next time i work on it, i'm gonna try doing some pre-optimizations of my own to (hopefully) cut that down - most notably, identifying all the types that a variable will contain (number, string, table, bool, nil), so most of them can be a concrete type, instead of every value always being a union every time
took a stab at that type-detection optimization, and it almost worked but i got myself tangled up so i reverted it (may try again later). weirdly the compile time doesn't seem as bad anymore, dunno what happened
so instead, i've been getting map() to work
getting somewhere...
btnp() just acts like btn() so far, needs camera() support, still no #pico8 color-palette, and i'm not sure why the fire doesn't render - but yeah, look at this little runny-jumper go!
moving camera, animated fire-blocks, and some other less-interesting improvements
a few notable things still left to bring this cart to parity:
- fillp() to draw the background circles correctly
- emoji-glyphs for certain tutorial text
- screen palette
- audio ☠️ (still planning to skip this for now)
added emoji-glyph support (visible in the cart on the right)
but that's kinda boring, so here's the giant spider machine at the end of the game
connected the official #pico8 palette and did some doodling on an LCD-screen shader
(...masto video compression isn't as bad as twitter, but in this case it janks up the image a bit at medium viewing distance)
adding some tutorial popups, so i ported my input-sprite handling from Completion Lawncare - in that one, i was using Rewired, but now i'm using unity's new InputSystem. i don't have user-rebindable controls at this point, but so far it seems noticeably simpler to detect the bindings for an action which match a certain input-device-type!
in the clip, it switches between gamepad and keyboard controls based on which device was used most recently
porting my existing levels to use the hotspot-voxelizer (it works!!)
i added some auto-lights recently which i haven't ported over to this system yet, so they're all very dark for the moment
ended up writing a "top-down convex-hull of a cube" generator today for this puzzle inspired by the crane game
("which crane game?" THE crane game)
upgrading my instanced-renderer to some instanced-indirect stuff: split each mesh into 64-tri clusters, and then it can draw multiple authored-meshes in the same drawcall (since it's all cluster-soup) and do culling in a compute shader
currently it's only drawing one cluster per mesh, so there are a buncha holes all around - but that's a problem for tomorrow
ayyy the triplanar shader supports the indirect intstancer now, also added per-instance brightness-variation
up next is the main point of doing all this shit: compute-shader culling (just frustum-culling to start, but may try occlusion culling later)
today i finally reached the actual purpose of the atrium: it's basically the mario-64-castle. or maybe it's the demon's-souls-nexus
whatever it's the level-select-hub
today i found out that the biggest bottleneck in rendering the atrium was uploading all the screen-textures - only 128x128 each, but there are 35 p8 carts running in this scene!
so now it uploads the raw p8 screen data (4 bits per pixel) instead of the final rgb colors (32 bits per pixel, plus mipmaps) and resolves it into a traditional texture in GPU-land
here's a fun bug from when it was almost working, when things took a detour into the andy warhol dimension
had a little dilemma about these reward-tweetjams, because if they're just static loops, why do they even need to be full pico8 emulations?
solution: adding a bit of interactivity to them. for these planet-carts, moving the mouse left and right changes the light direction
does anybody have time for a playtest this weekend? the prototype is like 20-30 minutes long. capturing a video of it is appreciated, but not required
DM me!