$ show mikelma/craftium
Craftium is a voxel-based game engine (Luanti/Minetest fork) extended with reinforcement learning capabilities. The core system provides a moddable 3D world with block-based gameplay, Lua scripting API, client-server architecture, and procedural map generation. The craftium add-on supplies Python bindings, Gymnasium environment interfaces, and RL training scripts to enable machine learning research within the game world. The system supports both traditional gameplay and AI experimentation through environment-specific mods that define reward functions, observations, and termination conditions for agents.
The LLM identified 5 files worth highlighting for reuse:
Provides Gymnasium action/observation space wrappers (BinaryActionWrapper, DiscreteActionWrapper) and coordinate conversion utilities. This self-contained Python module solves the common problem of adapting action/observation spaces between standard RL frameworks and custom game environments, demonstrating skill in interface adaptation with minimal dependencies.
Implements an area storage system for tracking protected regions with vector and spatial indexing options. Includes caching mechanisms and thread-safe operations. This reusable component demonstrates effective spatial querying patterns that could be extracted for any application needing permission-based spatial management.
Provides Buffer and SharedBuffer classes for explicit memory management in performance-critical contexts. This self-contained C++ utility shows skilled manual memory management patterns with clear ownership semantics, suitable for game engines or real-time systems requiring precise memory control.
Implements threading abstractions including MutexedVariable, RequestQueue, and Semaphore patterns. This platform-independent threading utility demonstrates thoughtful encapsulation of concurrency primitives with practical patterns for thread-safe communication and work distribution.
Features a versioned serialization framework with error handling and backward compatibility support. This self-contained C++ component shows skilled handling of data persistence evolution, allowing safe schema changes while maintaining compatibility with existing saved data.