Skip to content

Releases: needmorecowbell/drawfinity

v0.0.3 — Turtle Herding & Server-Side Sync

27 Mar 23:38

Choose a tag to compare

Turtle Herding & Multi-Turtle Scripting

This release transforms turtle graphics from a single-turtle system into a full multi-turtle simulation engine. Spawn flocks of turtles, coordinate their movement, and build emergent patterns — all from a single Lua script.

Turtle Herding

  • spawn(x, y) / spawn_at_scale(x, y, s) — create child turtles that inherit the parent's origin and drawing context
  • Handle-based API — each spawned turtle returns a handle with full turtle methods (t:forward(), t:right(), t:pencolor(), etc.)
  • Interleaved replay — multiple turtles execute in round-robin for smooth parallel animation
  • Lifecycle managementkill(handle), killall(), list_turtles(), configurable spawn limits
  • Origin inheritance — spawned turtles draw relative to the parent's position, working correctly at any zoom level

Turtle Communication & Awareness

  • nearby_turtles(radius) — query neighboring turtles within a radius (local and remote)
  • send_message(handle, msg) / receive_message() — inter-turtle messaging for coordinated behavior
  • TurtleAwareness — broadcasts turtle positions via Yjs awareness protocol in multiplayer rooms
  • Remote turtle rendering — see other players' turtles with distinct visual indicators
  • "Share Script" button — publish your script to the collaboration room

Turtle Tool Access

  • Full tool API from Luaset_brush_preset(), set_pen_mode(), set_shape_tool(), erase_at(), use_eraser()
  • Pen modes — switch between "brush", "shape", and "eraser" modes within scripts
  • All brush presets — access Pen, Pencil, Marker, Highlighter programmatically
  • Shape tools — draw rectangles, ellipses, polygons, and stars from turtle scripts

Zoom-Aware Scaling

  • scale_pen(factor) — scale pen width relative to the current zoom level
  • min_pixel_size(px) — set minimum rendered size to keep detail visible at extreme zoom-out
  • Fractal zoom spawningspawn_at_scale() for self-similar patterns that reveal detail as you zoom in

Example Scripts

6 new advanced scripts: Sierpinski Zoom, Fractal Zoom Tree, Game of Life (25×25 grid with 7 seed patterns), Langton's Ant, Starfield, plus beginner/intermediate scripts (Shape Showcase, Smiley Face, Brush Presets, Flower Garden, Spirograph).


Collaboration Server

Server-Side Yjs Document Merging

The collaboration server now maintains a proper server-side Yjs document per room using the yrs crate (Rust port of Yjs).

  • All updates persisted — both SyncStep2 (full state) and incremental YjsUpdate messages are merged into the server-side doc and durably written to disk. Previously, edits made after initial sync could be lost on server restart.
  • Proper y-protocols decoding — strips lib0 var-uint length prefix from wire format before passing to yrs
  • Backward-compatible — old .bin files from pre-yrs servers load correctly via format detection
  • 63 server tests covering yrs operations, payload extraction, room management, and full edit-disconnect-reconnect integration cycles

Input Validation & Security

  • Message size limits and y-websocket protocol validation on all incoming WebSocket messages

Bug Fixes

  • Fixed turtle exchange import on Windows — added AbortController-based fetch timeouts (5s), cache-first import strategy for installed scripts, and @tauri-apps/plugin-http fallback for WebView2 fetch failures (#32, #33)
  • Fixed Windows installer missing logo.exe and NSIS installer now display the Drawfinity icon correctly (#31)

Documentation


Full Changelog

v0.0.2...v0.0.3

v0.0.2

27 Mar 03:14
b08909f

Choose a tag to compare

What's New in v0.0.2

Browser Persistence Robustness

  • IndexedDB storage — drawings now persist in IndexedDB instead of localStorage, with automatic fallback when IndexedDB is unavailable
  • Automatic migration — existing localStorage drawings migrate to IndexedDB on first launch
  • Storage quota detection — warns when available storage drops below 1 MB; notifies on save failures
  • Corruption recovery — detects corrupt Yjs state on load and offers to restore from a last-known-good backup
  • Clear all data — new "Danger Zone" option in Settings to wipe all local drawings (with confirmation dialog)

Rendering & Stability Fixes

  • Z-order correctness — strokes now render in proper creation order
  • Dot stroke rendering — single-point strokes render as visible dots instead of being invisible
  • Zoom-aware eraser — eraser hit detection now accounts for camera zoom level
  • Vertex cache correctness — fixed stale cache invalidation issues
  • Undo transaction integrity — eraser batching and shape zoom jitter no longer corrupt undo history

Documentation & Distribution

  • Documentation site — added GitHub Pages docs site with downloads page
  • AppImage builds — local Linux AppImage build support
  • README overhaul — updated project documentation with "Built with AI" credits

Test Suite

  • Fixed 9 unhandled wasmoon/WASM errors in test suite
  • Added coverage for storage quota, corruption detection, and clearAllData
  • 1421 tests passing, 0 errors

Full Changelog: v0.0.1...v0.0.2

Drawfinity v0.0.1

22 Mar 22:36
ba8217b

Choose a tag to compare

What's Changed

Full Changelog: https://github.com/needmorecowbell/drawfinity/commits/v0.0.1