Exploring avoxelgame: A 3D Voxel Engine Written in APL

Exploring avoxelgame: A 3D Voxel Engine Written in APL

The avoxelgame project is an experimental 3D voxel game engine developed to test whether APL's array-oriented notation provides a more efficient way to implement voxel-based game logic and world generation. Built using Dyalog APL 20.0 and SDL3, the project serves as a technical proof-of-concept rather than a production-ready game.

Technical Architecture and Dependencies

The engine utilizes a hybrid approach, combining the high-level array processing of APL with the low-level graphics capabilities of SDL3. The system requires a modern graphics backend—Vulkan, DirectX12, or Metal—to function.

Core Requirements

  • Language Runtime: Dyalog APL 20.0
  • Graphics Library: SDL3, including sdl3_ttf and sdl3_image
  • C-Interop: A C Compiler and CMake are required for building the LSE (Language System Extension) components.
  • Hardware Acceleration: Support for Vulkan, DirectX12, or Metal.

Platform-Specific Implementation

  • macOS and Linux: The engine is deployed via a shebang in main.apls and requires the manual compilation and installation of libLSE.dylib (macOS) or libLSE.so (Linux) using CMake.
  • Windows: The engine is run through a Dyalog session using ]link.create and the state.Play command. Windows users must utilize SDL3 development libraries and provided .dll files in a ./libs directory.

Shader Pipeline and Rendering

The project uses GLSL for shader development. Source shaders are located in ./shaders/glsl and must be compiled into various formats using the DirectX Shader Compiler, glslc, and spirv-cross via the ./compile_shaders.sh script.

Current Limitations and Known Issues

The developer acknowledges that the project is highly experimental and contains several stability issues:

  • Performance: Significant performance regressions are present on Windows.
  • Backend Support: The DirectX12 backend is currently unsupported on Windows.
  • Windows Stability: The engine is prone to syserror 999 when attempting to play multiple times within a single session, suggesting the presence of memory leaks.

Community Perspectives

Discussion surrounding the project highlights the unique fit between APL's array-centric nature and the structure of voxel data.

A voxel world is a pretty good sales pitch for APL: the weird-looking part is the notation, not the model.

Other observers noted the rarity of such honesty in project documentation, praising the author for explicitly labeling the work as a "buggy passion project" rather than overstating its capabilities.

Sources