v0.1.1NeverDark ModuleBSD-2-Clause

nd-region for axil-nd, ported from SIC to libxylem.

GitHub
git clone https://github.com/tty-pt/nd-region

Documentation

axil-nd-region

nd-region for axil-nd, ported from SIC to libxylem.

Governs world regions, land ownership, administrative authority, and dynamic module hotloading (loadmod / unloadmod).

Role & Subsystem

nd-region partitions the game universe into hierarchical 4D spacetime regions identified by the pair (id, plen). Region owners can claim territories, grant or deny building permissions, manage player bans, and dynamically attach or detach gameplay modules per region (loadmod / unloadmod).

Morton Key Prefix & Bitmask Arithmetic

Every region in nd-region is an arbitrary prefix of the 64-bit Morton spacetime keyspace. Bit depth controls spatial domain and modder authority:

Prefix Width (plen)High-Bit MaskSpatial Scale / ScopeHierarchy & Modder Governance
plen = 00x0000000000000000Cosmos (Universe)Root tier. Server administrator / engine core. Global laws & baseline modules.
plen = 110xFFE000000000000032-Planet Super-SectorSovereign sector governor ($2^5 = 32$ worlds, covering worlds 0..31). Loads baseline gameplay suite once.
plen = 160xFFFF000000000000Single Planet / WorldPlanetary ruler ($2^{16} = 65,536$ worlds total). Local planetary laws, biomes, and rules.
plen = 240xFFFFFF0000000000Hemisphere / ContinentContinental governor. Regional mechanics, sub-factions.
plen = 320xFFFFFFFF00000000District / Zone / AreaDistrict magistrate / modder. Area-specific custom graphics (e.g. liblamina viewport).
plen = 480xFFFFFFFFFFFF0000City / SettlementTown mayor / settlement builder. Local vendors, town laws.
plen = 640xFFFFFFFFFFFFFFFFSingle Room / CellRoom architect / individual player room. Custom room scripts and fixtures.

Hierarchical Modder Attribution: The outermost modder claims a coarse prefix (e.g. 11 bits for a 32-planet sector) and loads baseline modules once. All nested worlds automatically inherit and execute these modules via XY hierarchical dispatch. Inner modders claim narrower prefixes (16, 32, 64) to customize their local space. Ancestor deny rules strictly cascade downward.

In-Game Commands (man-src/)

CommandSectionDescription
region10Claim an arbitrary Morton prefix region: region <width> [here \| world <N> \| cosmos \| <x> <y> <z> <w>]
regions10List all claimed regions in the universe
planet / planets10Convenience backward-compatible alias for region 16 world <N> and regions
grant10Delegate building/administrative authority over any prefix: grant <player> [<width> <point>]
release10Relinquish ownership of a region: release [<world> \| <width> <point>]
deny10Forbid a hook or module in a region and its subtree: deny <hook\|module> <name> [<world> \| <width> <point>]
ban / unban10Prohibit or permit players from entering a region
loadmod10Dynamically load an nd-* module into any region: loadmod <module> [<world> \| <width> <point>]
unloadmod10Detach a module from a region: unloadmod <module> [<world> \| <width> <point>]
modlist10List all active modules in a region: modlist [<world> \| <width> <point>]
here10Inspect region boundaries and current zone properties
target10Select default region target for administrative operations: target [<world> \| cosmos \| here \| none \| <width> <point>]

Install & Build

make
make install

Installs lib/libnd-region.so and in-game man pages under share/axil-nd/man/.

Maintained by:tty-pt