a floor
this drops my fps to 40 (max possible on playdate is 50) but i'm hoping/assuming i can find more stuff to optimize. worst case, locking the game to 30fps seems like it would be OKAY, and maybe even the more sane choice for a handheld (to save on battery power)
the real ideal thing would be if you could pick between 30fps (power-saver mode) and 50fps (try-hard mode)
starting to draw a proper car - i did this first version in a really basic way so i thought it'd tank my performance, but it turns out it still stays at like 45+ fps on the device. not bad!
i'm very bad at lowpoly modeling so the car accidentally looks like an old-timey beater, but i think that's sorta funny so i'll probably try to keep that vibe
working on replay recording/playback - yes, the clip looks the same as the others in the thread, but it's a pretty good run since i was retrying the map. if you think "i see places where the racing line could have been improved" then the game is working, lol
replay data is quite small: stores keyframes containing a bitmask of user-input states (one byte), along with how many frames you held that state for (one byte). a "normal" 30 second replay tends to be around 200 bytes
smarter sampling on the floor...
when it samples the floor tex, it raycasts the texelspace grid to see how many screen-pixels it'll step along the scanline before hitting the next texel, and it can reuse the latest sample until then - fewer samples, sharper result!
it also does some smooth LOD, where it starts using a bigger and bigger "screen-pixel steps per sample" ratio as pixels get farther away
(before/after)
conveniently, i already wrote a playdate serializer for C, for that previous music-maker app
here's the code for serializing/deserializing a track and its replay. serialization and deserialization use these same functions (the Serializer has a flag to tell it whether it's reading or writing) - so there's no need for annoying/error-prone "near duplicate" routines for input/output
it supports ascii format (more legible) and binary format (smaller file)
added a way to save your replay from the daily challenge, as a way to "chess by mail" against your friends without having to author a map first
also a nice idea from @fsouchu: ghost cars become opaque when you're not touching them
added object-sorting to fix the "inside out" walls (check the right side of the screen in the previous clip to see that) - i haven't mixed the cars into that sorting pool yet, but i'll do that soon
gonna need to figure out some static-object culling to skip faraway stuff quickly...there are a lot of small wall-meshes in a full track