Skip to content

v0.3.0

Latest

Choose a tag to compare

@mkh-user mkh-user released this 02 Nov 14:13
· 54 commits to main since this release

Pite v0.3.0

Pite 0.3 brings a major leap forward for the engine πŸŽ‰ β€” introducing a pure-Rust 2D physics subsystem powered by Rapier2D, an ergonomic Python API redesign with native vector math and declarative node descriptors, robust hot reload with state preservation, broad audio format support via Symphonia, macOS cross-platform support, and automatic player downloads for exports.


Highlights πŸ”₯

Pure-Rust 2D Physics Subsystem (Rapier2D)

Pite now features a dedicated 2D physics subsystem powered by rapier2d 0.23 in a new workspace crate pite-physics. Running in a deterministic 60 Hz simulation loop (dt = 1/60) and feeding _physics_process(delta) in Python scripts:

  • Kinematic & Dynamic Bodies: CharacterBody2D with built-in move_and_slide() obstacle response and contact flags (is_on_floor(), is_on_wall(), is_on_ceiling()), RigidBody2D with dynamic forces (apply_force, apply_impulse), and StaticBody2D for solid level geometry.
  • Colliders & Triggers: CollisionShape2D supports box, circle, and capsule geometries with interactive editor wireframe visualization. Area2D provides trigger detection with engine signals (body_entered, body_exited, area_entered, area_exited).
  • Spatial Raycasting: pite.raycast(from, to, mask=1) performs line intersection queries returning hit points, surface normals, distances, and collider nodes.

Python API Redesign & Direct Handles

Scripting in Pite is now significantly faster and more expressive:

  • Vec2 Math Class: Native 2D vector class supporting arithmetic operations (+, -, *, /), in-place mutations (+=, -=, etc.), tuple sequence unpacking (x, y = self.position), .length(), and .normalized().
  • Direct Handle Mutation: Mutating self.position.x += 10 or assigning self.position = (x, y) directly syncs to the engine without redundant end-of-frame Python object traversals or string allocations.
  • Attribute-Based Input API: Clean attribute syntax pite.held.<key>, pite.pressed.<key>, and pite.released.<key> (e.g. pite.held.right, pite.pressed.space), rejecting old string calls with clear errors.
  • Declarative Descriptors & Proxy Caching: pite.child("Name") and pite.node("../Path") descriptors cache node lookups on first access, while ScriptHost caches resolved node proxies across frames.
  • Hybrid Signal Callbacks: signal.connect() accepts arbitrary Python callables (lambdas, functions, bound methods) alongside engine-dispatched signals.

Bulletproof Hot Reload & State Preservation

Modifying code or assets while building games should never reset your workflow:

  • Continuous Editor Polling: Hot reload watches and reloads scripts and scenes in edit mode while idle or paused, without requiring gameplay to be running.
  • Python State & Physics Velocity Preservation: Reloading a script preserves custom instance attributes (__dict__) and physics body velocity across reloads while purging stale module dicts in sys.modules.
  • Scene Isolation: Touching unrelated .ptscn files no longer triggers unnecessary scene rebuilds.
  • Asset Invalidation: Modifying .png textures or .atlas.json spritesheets invalidates cached GPU textures and triggers viewport redraws immediately.

Symphonia Audio: OGG, MP3, FLAC & Extended WAV

Audio decode is now 100% pure Rust via symphonia:

  • Native support for Ogg Vorbis (.ogg), MP3 (.mp3), FLAC (.flac), and extended WAV (8/16/24/32-bit int and 32-bit float).
  • pite check validates audio decodability and header integrity for all project audio assets.
  • Asset pipeline adds dedicated importers for manifest tracking and asset renames.

Seamless Exports & Automatic Player Downloads

  • pite export now automatically downloads the target platform's pite-player release binary when not present locally, caching it under ~/.cache/pite/toolchains/players/.
  • Releases now include standalone player binaries for Linux, Windows, and macOS, alongside unified all-platform bundles.

Platform Expansion & Scene Extension

  • macOS Support: Full macOS support for both the editor and games with cross-compilation in CI and release workflows.
  • .ptscn Scene Extension: Standardized scene file extension to .ptscn (was .pitescene) across the entire engine, tooling, templates, and documentation.

Changes Overview πŸ“œ

β€’ 2D physics subsystem with Rapier2D: pure-Rust 2D physics powered by rapier2d 0.23 in pite-physics, running in a fixed 60 Hz simulation loop (dt = 1/60) and driving _physics_process(delta) in Python scripts.
β€’ Kinematic character controller: move_and_slide() computes sliding obstacle collision response against solid geometry while ignoring trigger sensors, automatically updating velocity and contact flags (is_on_floor(), is_on_wall(), is_on_ceiling()) relative to up_direction.
β€’ Dynamic rigid bodies: apply_impulse((x, y)) and apply_force((x, y)) for simulation, with configurable mass, gravity_scale, and lock_rotation.
β€’ Area trigger signals: Area2D emits engine-owned body_entered, body_exited, area_entered, and area_exited signals with node ID arguments.
β€’ Spatial raycasts: pite.raycast(from, to, mask=1) performs line intersection queries against solid obstacles, returning intersection point, surface normal, distance, collider node, and body node.
β€’ Editor visualization and inspection: pite-editor paints semi-transparent collision shape wireframe overlays (box, circle, capsule) directly in the viewport in design mode, with shape dropdowns and physics property controls in the Inspector.
β€’ Python API redesign with direct handles and vector math: Vec2 class supporting vector operations, in-place mutations, indexing, and tuple unpacking.
β€’ Direct engine transform mutations: mutating self.position.x or assigning self.position = (x, y) directly updates ScriptHost, deleting redundant end-of-frame synchronization passes.
β€’ Attribute-based input API: pite.held.<key>, pite.pressed.<key>, and pite.released.<key> with TypeError on string calls.
β€’ Declarative node descriptors: pite.child("Name") and pite.node("../Path") descriptors with automatic first-access proxy caching.
β€’ Node proxy caching: repeated get_node() lookups are cached in ScriptHost to eliminate tree walks.
β€’ Hybrid signal callbacks: signal.connect() accepts arbitrary Python callables alongside engine-dispatched signals.
β€’ Editor pause-on-error: script exceptions during gameplay automatically pause the editor, log formatted Python tracebacks, and open the failing script.
β€’ Hot reload reliability: continuous editor idle reload, scene reload isolation, Python state and physics velocity preservation, and asset cache invalidation.
β€’ Expanded audio formats: pure-Rust decoding via symphonia brings support for Ogg Vorbis (.ogg), MP3 (.mp3), FLAC (.flac), and extended WAV.
β€’ Download fallback for export: pite export automatically downloads the target platform's pite-player release archive when absent beside the engine binary.
β€’ Standalone and all-platform player release assets: release workflow publishes standalone player bundles for each platform alongside all-platforms player archives.
β€’ Scene file extension is now .ptscn (was .pitescene): editor dialogs and detection, asset-rewrite scans, docs, examples, and scaffolds all follow.
β€’ macOS support (both for editor and games) with cross-compile added.


Download ⬇️

β€’ pite-v0.3.0-linux.tar.gz / pite-v0.3.0-windows.zip / pite-v0.3.0-macos.tar.gz: engine + player binaries (any machine exports for all supported platforms), verified by SHA256SUMS.
β€’ pite-player-v0.3.0-<platform>: standalone player binaries for lightweight deployments and export toolchains.
β€’ Install scripts: install.sh (Linux/macOS) / install.ps1 (Windows) from the repo root.