A 3D voxel game engine written in APL
๐ง avoxelgame: A 3D Voxel Engine in APL
This project is an experimental 3D voxel game engine developed by namgyaaal, utilizing the unique capabilities of Dyalog APL and SDL3.
"This started off as a bet with myself that APL notation would provide an easier way to make a voxel game."
๐ฎ Game Controls
Navigating the voxel world is handled via the following inputs:
- Movement:
W-A-S-D - Verticality:
Spaceto jump - Perspective: Use the Mouse to rotate the camera
- System:
Q: Exit the applicationI: Toggle the display of rendering statisticsL: Lock/Unlock the cursor
- Special Modes:
F: Enable fast noclip mode
- Building: Keys
1through5to switch between different block types for placement.
๐ ๏ธ Technical Requirements
To get the engine running, you will need the following environment:
| Requirement | Specification |
|---|---|
| Language | Dyalog APL 20.0 |
| Compiler | A standard C Compiler |
| Build Tool | CMake |
| Graphics API | Vulkan, Metal, or DirectX 12 |
| Libraries | sdl3, sdl3_ttf, and sdl3_image |
๐ Installation & Setup
๐ง MacOS & Linux
Follow these steps to initialize the project:
- Clone the repository.
- Install the required dependencies.
- Build and install the LSE (Language Support Extension).
make
make install
Note: This process places libLSE.dylib (macOS) or libLSE.so (Linux) into the ./libs/ folder alongside SDL3 files.
To launch the game, execute:
./main.apls
[!IMPORTANT] If you encounter issues with the shebang in
main.apls, verify the location ofdyalogscriptusingwhich dyalogscriptand update the path accordingly.
๐ช Windows
Windows setup is slightly more complex. It is recommended to use cmake-gui to link the SDL3 development libraries found in the official libsdl3 releases.
Alternatively, you can use the pre-compiled .dll files provided in the releases and place them in the ./libs directory.
To play via a Dyalog session:
]cd ROOT DIRECTORY
] link .
Play
๐จ Shader Management
The engine uses GLSL shaders located in ./shaders/glsl. While pre-compiled shaders are included, you can customize them by editing the GLSL source and running the compilation script:
./compile_shaders.sh
Dependencies for shader compilation:
- DirectX Shader Compiler
glslcspirv-cross
๐ Project Analysis
Build Pipeline
Language Composition
The codebase is predominantly APL, with supporting C and GLSL code. The distribution is roughly:
โ ๏ธ Current Status & Credits
- Known Issues:
Smooth performance on WindowsThere are currently significant performance regressions on Windows that are being addressed. - Assets: A huge thank you to Madeline Vergani (@RubenVerg) for providing the textures.
- License: This project is released under the MIT License.