A work-in-progress Minecraft-like voxel game/client for ESP32, redesigned as a new voxel engine targeting ESP32-S3 and the new ESP32-S31 (dual-core 320 MHz RISC-V, 512 KB SRAM, 250 MHz DDR PSRAM, 60 GPIO, Wi-Fi 6 / BT 5.4 / Ethernet).
Target platforms:
- ESP32-S3 (current dev)
- ESP32-S31 (next-gen, announced 2026; 320 MHz dual-core RISC-V, 512 KB SRAM, 8-bit 250 MHz DDR PSRAM)
- TFT display using
TFT_eSPI - Development board: any ESP32-S3 / ESP32-S31 with PSRAM and TFT
espcraft.ino— new voxel engine (replaces legacy prototype)spritesheet.bmp— programmer-art spritesheet (8×8 tiles, 16×16 px each, 24-bit BMP)spritesheet.h— embedded RGB565 atlas array (PROGMEM), includes black/purple fallback3d_render/— legacy/prototype wireframe renderer (archival reference only)generation_lut/— legacy LUT generator (archival reference only)- ESP32-S31 hardware reference assets (from espressif/kicad-libraries#233, created by blobcoder21):
footprints/Espressif.pretty/ESP32-S31-QFN.kicad_mod(QFN package footprint)symbols/Espressif.kicad_sym(symbol library, includes ESP32-S31 reference)3dmodels/espressif.3dshapes/ESP32-S31-QFN.STEP(3D model, 1.8 MB, FreeCAD 7.9, QFN 80 0.35 mm pitch 8×8 mm) These are authoritative reference assets for the ESP32-S31 QFN package and should not be regenerated from descriptions.
- Configurable sprite atlas:
ATLAS_TILE_PX,BLOCK_TILE_W,BLOCK_TILE_H,ATLAS_TILES_W,ATLAS_TILES_Hare fully configurable. Changing them does not require rewriting the renderer. - Built-in spritesheet loader:
spritesheet.hprovides an embeddedPROGMEMarray with basic programmer-art textures (solid colors + one checkered tile). A real spritesheet can replace this array or be loaded from external storage. - Classic black/purple fallback: missing or out-of-bounds texture references return
FALLBACK_BLACK(0x0000) andFALLBACK_PURPLE(0xF81F). - Pre-baked Perlin continuous terrain:
generateWorld()creates layered stone/dirt/grass terrain with decorative trees at startup. - Chunk-based voxel world:
CHUNK_SIZE8, expandable to multi-chunk. - Filled voxel rendering with basic face shading (lighter top, darker bottom, medium sides) and black edge outlines.
- Camera: yaw/pitch rotation, perspective projection (
FOV64,NEAR_CLIP0.25). - AABB collision (
checkVoxelCollision,resolveCollision). - Block interaction hooks:
interactBreak()(raycast),interactPlace()(distance check). - Serial input (
w/a/s/dmove,bbreak,pplace,q/eyaw,r/fpitch). - GPIO stub (
handleGPIOInputStub) for ESP32-S3 / ESP32-S31 device-specific buttons.
The renderer is designed so that textures can be added without rewriting it:
BlockDefdefinesflatColor(fallback),texTileX, andtexTileY(atlas reference).getFaceColor()samples from the atlas array using the block's texture reference.- Each block texture spans
BLOCK_TILE_W×BLOCK_TILE_Htiles in the atlas. - The atlas dimensions and tile dimensions are pure configuration (
#define).
To upgrade to real textures:
- Replace or extend
SPRITESHEET_DATAinspritesheet.h, or load from SD/PSRAM at runtime. - Adjust
BlockDef::texTileX/texTileYto point to the new texture region. - Optionally replace
getFaceColor()with per-pixel atlas sampling for full textured faces.
Experimental / actively redesigned. The legacy renderer in 3d_render/ is preserved only as reference architecture. The new espcraft.ino is the primary development target.