nd-race for axil-nd, ported from SIC to libxylem.
git clone https://github.com/tty-pt/nd-raceDocumentation
axil-nd-race
nd-race for axil-nd, ported from SIC to libxylem.
Owns the five playable races: their per-attribute bonuses, their fight weight, and the nameβid association. It co-implements nd-attr's attr_stat chain (base value + race bonus, read through nd_last()), implements fighter_wt with the racial weight, and is the first and only consumer of the engine's nd_assoc XY hook.
Install
make install
Installs:
lib/libnd-race.so
include/nd/race.h
There is deliberately no lib/nd-race.so symlink (see axil-nd-wts for why: mods.load names the installed filename, and the OpenBSD packing list never lists a symlink).
Also packaged across all 9 platforms (deb, apk, rpm, pacman, brew, openbsd, winget + Scoop, android-lib, and ios-lib + SwiftPM XCFramework) from a v* tag.
Build from source
make
Needs libxylem and the engine's game API, <nd/xy.h>, plus <nd/attr.h> for the chain this module co-implements. Note the Makefile carries no sibling -I: <nd/attr.h> resolves from the installed nd-attr package (or a checkout at ../axil-nd-attr only if the compiler already finds it), so build against an installed engine and installed nd-attr, or add the -I yourself for a fully uninstalled tree. CI names the deps explicitly (axil-nd,libxylem,nd-attr).
git clone https://github.com/tty-pt/nd-race && cd nd-race
make
What it does
xy_install()registers theracetable (auto-indexed), therace_id
and race_sid maps, and the race_rhd secondary index, then associates names to ids through the engine's nd_assoc hook.
race_set/race_query/race_addassign and look races up;
attr_stat adds the racial bonus on top of the chain value; fighter_wt answers the racial weight; on_add and on_status cover creation and display.
In-Game Commands (man-src/)
Race selection is handled during onboarding (begin.10) and reported via character sheet review (status.10).
Packaged Assets (art/)
Racial heritage portraits, avatar silhouettes, and species icons.
Wire Protocol & BCP Integration
Racial attribute adjustments (e.g. elf dexterity, dwarf constitution) fold into BCP_STATS frames.
Modder Extension Guide
To introduce a new race:
- Define a
race_trecord specifying baseline attribute bonuses, weight, and size. - Register the race into the
racetable duringxy_install(). - Co-implement the
attr_statandfighter_wtXY chains.
Testing
There is no test.sh here. Behaviour is asserted by the engine's own suite:
cd ../axil-nd
make && ./test.sh
Notes from the port
SIC_DEFβXY_IMPL,mod_installβxy_install,sic_last(&last)β
nd_last(&last). stat became attr_stat: the bare name collides with libc's stat(2) (pulled in via <sys/stat.h>).
- This TU
XY_IMPLsattr_statfrom<nd/attr.h>, so it defines
ATTR_IMPL before including it.
fighter_wtdeliberately returns only the racial weight with no
nd_last() term β an open call, not an omission.
- The link line is libxylem alone.
NEEDEDislibxylem.soandlibc.so.6.
License
BSD 2-Clause, carried over from tty-pt/nd-race. See LICENSE.