Description
map_octree
WIP version, expect issues and breaking changes
Development assisted by AI (code and documentation).
A library for saving large world regions as compressed octree snapshots. Useful for schematics, backups, and fast node queries on huge areas without exhausting server memory.
Documentation
Quick Start (for server admins)
All commands require server priv.
0. Admin UI
If the flow dependency is installed, you can do many of these operations via UI using /moct_ui
1. Save a region
Use /moct_pos1 and /moct_pos2 to mark corners (or //pos1 and //pos2 with WorldEdit), then: /moct_save <name>
Or save around yourself with a radius: /moct_save <name> <radius> [<height>]
Snapshots are stored at worldpath/map_octree/<name>.bin.
2. Place
/moct_place <name> [x,y,z]
If no position is given, it places at the original capture location.
3. Optimize for your server (recommended)
Go to a representative area of your world (e.g., a complex build, a dense city center, or a typical biome) and run:
/moct_autotune
This benchmarks your server and applies the optimal batch settings automatically.
Other useful commands
/moct_maps : List saved snapshots
/moct_info: Info about loaded snapshot
Use /help in-game for advanced options.
Settings
Configure in minetest.conf or via the Settings menu.
map_octree_max_total_ram_budget_mb (default: 1000): Max RAM (MB) for snapshot operations. Lower this on low-memory servers (e.g., 256–512).
map_octree_reduce_unload_timeout (default: false): Force aggressive mapblock unloading during saves. Enable only on very low-RAM servers where you experience crashes as it is annoying for other players. If you're running a potato server, try lowering the RAM budget first.
Note on RAM budget: This value is only an estimate. Lua memory usage and GC behavior make it impossible to enforce an exact cap. For safety, set the budget to roughly half of the maximum memory you are willing to allocate to map_octree. On large-scale operations or on servers that are already memory-heavy, the cap may be exceeded anyway (other mods, many active mapblocks, players online, etc.). Treat it as a starting point and tune it for your setup.
Releases
2026-05-28 02:18 UTC
0.6.2
NEW FEATURES
- Improved admin UI
- Autotune now applies optimized settings by default without requiring explicit flag
- Refined storage rename and place instance behavior for more predictable map lifecycle management
BUG FIXES
- Hardened admin UI privilege checks to re-verify on every form event
- Hardened the async scheduler and persistence layer: wrapped callbacks under error handling to prevent stranded operations, validated chunk data to reject corrupt blobs, and made deserialization return errors instead of crashing
- Fixed
/moct_save to clamp radius and height limits, preventing oversized batch plans from stalling the server
- Fixed the Update action to fall back to map bounds when bounds are not explicitly set
TECHNICAL CHANGES
- Moved tests out of
src/ into the top-level tests/ directory
- Parameterized Docker Compose project name and server port in test build configuration
- Added AGENTS.md
2026-04-14 02:20 UTC
0.6.1
NEW FEATURES
- Added support for resetting/storing node metadata
- Introduced OctLayers for saving and applying lightweight map differentials
- Added cooperative cancellation support for long-running asynchronous operations
- Added admin UI panels
- Added support for nested storage references in save commands
BUG FIXES
- Improved world relighting to ensure adjacent chunks are correctly lit after a restore
- Fixed structural hash collisions and population bound errors in octchunks
- Resolved issues where staged data was lost during asynchronous write failures
- Fixed a bug where memory-only dirty writes were incorrectly processed during restore tracking
- Added validation to reject malformed position arguments in placement commands
TECHNICAL CHANGES
- Massive codebase refactor to improve annotations, layout, and adherence to new code style guidelines
- Optimized cache management by budgeting based on expanded trees and deferring trims
- Improved serialization to provide detailed error reports for file and version load failures
- Improved the testing framework
- Optimized node-grid scans to deduplicate overlapping ranges
2026-03-26 02:18 UTC
0.5
- Remove obsolete template localization file
- Add onboarding for autotune settings on admin join
- Autotune: renamed trees in chunks and made the results clearer for non-developers
- Enhance restore scheduling: add chunk re-verification and settle logic for improved accuracy on liquids/LBMs/ABMs
- Add Docker-based test harness and CI configuration
- Enhance restore tracking: add persisted dirty state management and related API methods
2026-03-22 02:18 UTC
0.4
- Enhance snapshot save options with tracking and auto-load features
- Implement commit_tracked_changes functionality and enhance serialization
- BUGFIX: placing a schematic back into the world at custom unaligned coords wouldn't work when it was split in multiple chunks
- Enhance storage management functions: add get_storage_dir and delete_storage_file; streamline directory resolution in commands
2026-02-09 02:19 UTC
0.3
- Avoid storing param1 since we recalculate light anyway and it occupies space
- Update mod.conf to enhance description and ensure version compatibility
All releases
Threads
New thread
Information
Provides
map_octree
Dependencies
- Required
-
No required dependencies
- Optional
-
flow
mtt
Information
- Type
- Mod
- Technical Name
- map_octree
- Languages
-
English
- License
-
AGPL-3.0-or-later
for code,
CC0-1.0
for media.
- Maintenance State
- Work in Progress
- Added
- 2026-01-20 15:08 UTC
- Maintainers
-
giov4
Incredible
I saw this in the recent published mods and... wow. Another great api and mod by the author! It allowed me to save a huge map, give it to my friend and they pasted it in their world. I didn't know this was possible on Luanti, because world edit crashed when I tried it... Also the code seems very advanced but also very well-written...that makes it easier to understand what it does. Also the documentation is well made, and this is a 0.x version so it's very impressive. I haven't got any need for the api myself but the large schematics are very appreciated as someone who mostly plays and builds things with friends sometimes. I read the api allow for async map operations, I wonder if builder mods would benefit from this or if it's an overkill...?
Anyways ,gone are the days of of sharing things in a lot of tiny schematics :D