Out-of-tree Bunnyland plugin that adds swimming, diving, and the underwater — an expansion-pack-sized themed bundle of aquatic mechanics. Water rooms are their own little survival puzzle: dive deep, hold your breath, and surface with treasure. It is a natural companion to river-fording and fishing worlds.
The pack bundles five mechanics, each in its own module with its own tests:
- Water rooms / submersion — a
SubmergedComponenttags a room as deep water; any room with an aquaticRoomComponent.biomealso counts. Being submerged gates movement and drives the breath timer. - Breath + drowning — a
BreathComponentmeter (built on the shared needsMeter) drains while submerged and refills at the surface; running out damagesHealthComponent. A heldRebreatherComponentstretches every breath. - Diving for treasure — a
diveverb recovers loot from sunk caches with deterministic loot tables (a hash of the cache id and world epoch — no randomness);surfaceswims up an exit to dry land and catches your breath. Diving rejects if you cannot swim or have no air. - Currents & hazards — a
CurrentComponentdrifts swimmers toward an exit each tick; aHazardComponentbites the ungeared. Strong swimmers resist both. - Swim skill — a
SwimSkillComponentthat improves with use, reducing breath drain and hazard damage and letting a master hold their ground against currents.
This repo intentionally keeps all aquatic work outside the main bunnyland-server repo.
server/— Python Bunnyland plugin package with the components, the breath / current / hazard consequences, prompt fragments, a worldgen enrichment hook, thedive/surfaceverbs, spawn factories, and tests.
The plugin exposes bunnyland_aquasim.bunnyland_plugins() and contributes:
SubmergedComponent,RebreatherComponent,TreasureCacheComponent,BreathComponent,SwimSkillComponent,CurrentComponent,HazardComponent.BreathConsequence— drains/refills breath and drowns the airless each tick.CurrentConsequenceandHazardConsequence— drift swimmers and damage the ungeared.submersion_fragments,breath_fragments,swim_fragments— prompt fragments.AquaWorldgenHook— floods aquatic generated rooms and sinks treasure caches.diveandsurface— verbs for the diver (human or AI).spawn_rebreather,spawn_treasure_cache— spawn factories.- Optional Bunnyland 3D integration adds aquatic plants and coral plus an underwater enclosure skybox and a slow suspended-silt particle field in water rooms.
This package builds no containers. It is loaded into the stock server via --module:
bunnyland serve --module bunnyland_aquasimdefault_enabled=True, so no --plugin flag is required once the module is imported. The
bunnyland_aquasim package must be importable by the server (installed into the server's
environment, or on PYTHONPATH).
Run server tests against a sibling bunnyland-server checkout (no install required —
server/tests/conftest.py puts both packages on sys.path). From server/:
uv run --project ../../bunnyland-server -m pytest
uv run --project ../../bunnyland-server ruff check src testsSee server/README.md for more detail.
This plugin follows the Bunnyland project's
contribution guidelines and code of conduct,
which point back to the bunnyland-server repository.
Licensed under the GNU Affero General Public License v3.0. See LICENSE.