Skip to main content

kirby-terrain

Terrain objects, geometry and durability for the Kirby HERO System platform.

Overview

This package provides geometric primitives — points, segments and polygons — all measured in metres. It has zero dependencies and holds no game rules. It describes only what is physically present.

Key Properties

  • All units are metres. Scale conversion belongs at a source boundary (e.g. a map-tool reader) and does not leak inward.
  • No rules. A Segment does not know whether it blocks sight. A Polygon does not know how much damage breaks it. These types describe shape and space; rules live in other repositories.
  • Immutable. All types are frozen dataclasses, safe to share and reason about.

Geometry

Point

A position in three dimensions, with x, y, and optional z (height above ground, defaulting to 0.0).

Segment

A straight line between two points. Provides a length_m property (accounting for elevation) and an is_degenerate check.

Polygon

A closed region defined by a list of points. Provides:

  • is_degenerate: True if fewer than three points, or if points are collinear (no area).
  • centroid: The average of the vertices, suitable for labels or spawns.

Durability

Durability data (how hard materials are to break) comes from HERO System 6E2, p173. This package holds no durability logic; that belongs in other layers.

TerrainObject

TerrainObject is one primitive for everything physically present — a wall, a door, a window, a floor, a zone. It carries a shape (Segment or Polygon), a height_m, and an optional kind naming what it IS.

When kind is a row of OBJECT_DURABILITY (a wall, door or pane of glass from the 6E2 p173 Objects Table), pd, ed and body come from that table, overridable per object. When kind is None — "not identified": a floor, a tree, a vehicle, anything the table has no row for — the caller must supply pd_override, ed_override and body_override directly.

from kirby_terrain import OBJECT_DURABILITY, Point, Segment, TerrainObject

wall = TerrainObject(
    id="w1", name="north wall", kind="brick wall",
    shape=Segment(Point(0.0, 0.0), Point(5.0, 0.0)),
    height_m=3.0,
)
wall.pd, wall.ed, wall.body  # (5, 10, 3), from the table

Map Readers

Readers for map-tool exports (FoundryVTT, etc.) arrive in a later change. They translate whatever units an export uses into metres and instantiate these types.

License

PolyForm Noncommercial License 1.0.0. See LICENSE for details.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kirby_terrain-0.1.0.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kirby_terrain-0.1.0-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file kirby_terrain-0.1.0.tar.gz.

File metadata

  • Download URL: kirby_terrain-0.1.0.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for kirby_terrain-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3524061616cdc57cbee22a92fcaaf051c9e3cb042e9b178cd0553b121ce97e06
MD5 97cedd79ba88d5b54d24a4b286d61e3e
BLAKE2b-256 cd90ef423638e720fb33cacd9d1fd9f2f8f9504cf50b14fe4a7e49a6768afc13

See more details on using hashes here.

File details

Details for the file kirby_terrain-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: kirby_terrain-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for kirby_terrain-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0d83b496ca0bb604019f13e6de78e9d7355bac84552aaed690bfa3295b759898
MD5 35abe82af190c9a1ffe20e99bc231c53
BLAKE2b-256 acd13eba8cab01a61c1724c3183115d9aa3a417a25b7beffc45eb923f2907b40

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page