U3D: a 3D voxel heightmap engine for MakeCode Arcade
U3D is a raycasting engine that renders a 3D world from a heightmap and colormap image pair, with tilemap-based textured walls on top. It runs as an extension.
What it does:
- Heightmap terrain with vertical scale and smooth camera stepping
- DDA raycaster with perspective-correct wall texturing, distance shading, and a lava/floor texture layer
- Billboard sprites with bob, velocity, bounce, scale, animations, and pathfinding to the player
- Per-tile height overrides at runtime: lets you animate doors, moving floors, collapsing platforms without touching the tilemap
- Height-based collision so those dynamic tiles actually block the player
spinAroundfor orbit-cam cutscenes- Block extension with full visual block support
This has been a long build. There were some genuinely tricky bugs along the way (perspective metric mismatch causing wall shear, texture clamp-stretch at close range, literally sooooo many others) that took real work to track down. Posting this partly because I think other people might find the heightmap+raycaster combination interesting, and partly to get feedback before I keep going.
Runs at 40-50+ FPS in the MakeCode simulator on my iMac 2019 (Intel i5, AMD Radeon 570X). Physical hardware performance will vary, though the engine has gone through several rounds of optimization specifically with hardware constraints in mind.
