3d thing in the playdate, Yay

(media cw: zoomed-out but heavy usage of high-contrast dithering)

#playdate #gamedev

this is all in lua, and its garbage collection would cause a bunch of lag spikes. im planning on making a rhythm game with this, and lag spike are a no go

but i seemingly ran out of opportunities to optimize my code. so I opted to manage the garbage collection myself using garbagecollect()! it runs it every frame, but stops it if it'll cause any frames to drop.

it doesn't take memory usage into account. so theoretically, the playdate could run out of memory!! but laggy always vs crash sometimes... 

@dabric what the fuck??

@rabbithawk256 it wasn't too bad... it's actually kinda simple code for what it is. the main thing it does is just multiply each point by a simple linear function based on its z axis.

rotation and z-ordering are kinda non-issues for me! it's a rhythm game, so there's no need for anything to rotate on the z-axis. it's practically just standard 2d rotation at that point! and notes (the balls) have a fixed position, so the z-ordering can just be predetermined in the level itself

maybe this is all standard stuff but I dunno; it's my first time doing anything 3d like this 

@dabric that's incredibly impressive