LearnNewsExamplesServices
Frontmatter
id8544
titleEnhancement: Physics-based "Traffic" Animation (Variable Speed & Length)
stateClosed
labels
enhancementdesignai
assigneestobiu
createdAtJan 11, 2026, 2:46 PM
updatedAtJan 11, 2026, 3:30 PM
githubUrlhttps://github.com/neomjs/neo/issues/8544
authortobiu
commentsCount1
parentIssue8398
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJan 11, 2026, 2:55 PM

Enhancement: Physics-based "Traffic" Animation (Variable Speed & Length)

Closed v11.20.0 enhancementdesignai
tobiu
tobiu commented on Jan 11, 2026, 2:46 PM
  • Goal: Enhance the animation with physics-based "Traffic" dynamics to make it feel more organic and responsive.
  • Concept: The pulse should behave like a vehicle navigating the network:
    • Fast on Highways: High velocity on the vertical segments between nodes.
    • Slow in Towns: Decelerate when approaching a node to navigate the "orbit".
    • Accelerate out: Speed up as it leaves the node.
  • Visual Enhancement (Squash & Stretch):
    • The pulse length should be dynamic.
    • Long/Streaked when moving fast (motion blur effect).
    • Short/Condensed when moving slow (concentrated energy).
  • Technical Implementation:
    • Refactor TicketCanvas.mjs from time-based (t * speed) to stateful integration (pos += velocity * dt).
    • Implement a proximity-based velocity function: v = f(distance_to_nearest_node).
    • Increase base speed significantly to compensate for the slowdowns.
tobiu added the enhancement label on Jan 11, 2026, 2:46 PM
tobiu added the design label on Jan 11, 2026, 2:46 PM
tobiu added the ai label on Jan 11, 2026, 2:46 PM
tobiu referenced in commit 63767fe - "feat: Implement physics-based 'Traffic' animation with squash & stretch (#8544)" on Jan 11, 2026, 2:54 PM
tobiu
tobiu Jan 11, 2026, 2:55 PM

Input from Gemini 3 Pro:

✦ Implemented a physics-based animation system (The "Traffic" Model):

  1. Stateful Physics Loop: Replaced the time-based loop with pulseY += velocity * dt. This allows for variable speeds.
  2. Traffic Logic:
    • Base Speed: Increased from 0.15 to 0.5 px/ms (3x faster).
    • Highway: When far from nodes (>150px), the pulse accelerates up to 1.5x base speed (0.75 px/ms).
    • Town: When approaching a node (0px), it decelerates to 0.2x base speed (0.1 px/ms), creating a deliberate "slow down to orbit" effect.
    • Ease-Out Curve: Used a quadratic ease-out for smooth braking.
  3. Squash & Stretch:
    • The pulseLength is no longer static (100px).
    • It stretches up to 120px when moving fast (motion blur).
    • It compresses down to ~16px when moving slow (concentrated energy).

This creates a highly organic feel where the data "zooms" between nodes and "carefully negotiates" the connections.

tobiu closed this issue on Jan 11, 2026, 2:55 PM
tobiu assigned to @tobiu on Jan 11, 2026, 3:30 PM
tobiu added parent issue #8398 on Jan 11, 2026, 3:30 PM