Skip to content

v0.0.70

Choose a tag to compare

@mococa mococa released this 03 Feb 05:35
· 216 commits to main since this release

Release Notes — v0.0.70

Overview

v0.0.70 is a fairly chunky release. The game loop got a real upgrade, there’s a brand-new input system, and a bunch of ECS internals were tightened up. The main goals here were better performance, clearer APIs, and smoother ergonomics for server-authoritative multiplayer setups.


What’s New

Game Loop

  • Built-in loop state: The game loop now tracks its own lifecycle (running, paused, etc.), so you don’t need to manage that yourself.
  • New GameLoop class: Cleaner exports and a more explicit API around loop-related utilities.
  • Tick reset on stop: Tick count is properly reset when the loop stops, avoiding timing weirdness on restarts.
  • InputManager wired in: Input handling now lives directly inside the loop.
  • Clearer driver naming: Loop drivers were renamed to better reflect what they actually do.

Input System

  • New InputManager with first-class keyboard and mouse support:

    • Key state tracking
    • Mouse position and button states
    • Frame-accurate input snapshots
  • Cleaner state handling overall, especially around snapshots and transitions between frames.

Intent System

  • IntentDataOnly type: Exported from define-intent to make intent payload extraction painless.
  • New helper types to pull just the data fields from a DefinedIntent.
  • Stricter server-side validation: Better client tick tracking and validation for intent processing.

ECS Improvements

  • SystemBuilder upgrades:

    • Field descriptors for safer, clearer component access
    • Faster entity proxy creation
    • Predicate-based conditions
    • A proper despawn method for cleanup
  • JIT-level optimizations: Faster component bit clearing and entity queries.

  • Component registration cleanup: Switched to Object.values for better scalability.

Ticker

  • Accumulator reset now happens alongside tick resets for consistency.
  • Improved floating-point handling to reduce drift in long-running simulations.

Benchmarks & Tooling

  • More detailed ECS benchmarks, including variance and memory usage.
  • Frame-based throttling added to health and combat systems during benchmarks.
  • Smarter benchmark runs with entity conditions and cleanup logic.

Bug Fixes

  • Fixed floating-point precision issues in ticker calculations.

Docs

  • Clarified when input snapshots are available in BaseEvents for client-side loops.

Refactors

  • Renamed private GameLoop properties for consistency.
  • Reworked parts of the input state and snapshot architecture.

Examples

  • Added a new ECS + Pixi.js example showing recommended integration patterns.

Migration Notes

Game Loop State

If you were tracking loop state manually, you can now rely on the built-in status:

const loop = new GameLoop(/* ... */);

loop.start();
// loop.status === 'running'

loop.pause();
// loop.status === 'paused'

Input Handling

The new InputManager replaces most ad-hoc input logic.

It is already in the game loop tick & render event ready to use:

    this.events.on('tick', ({ tick, deltaTime, input }) => {
      this.renderer.storePreviousState(this.world);
      this.world.runSystems(deltaTime);
      this.renderer.cleanup(this.world);


      // hold space to spawn more entities
      if (input.keys['Space']?.down) {
        this.spawnEntities();
      }
    });

Intent Types

Use IntentDataOnly to work with intent payloads without extra boilerplate:

import { IntentDataOnly } from 'murow';

type MyIntentData = IntentDataOnly<typeof myIntent>;

Breaking Changes

None.


Performance Highlights

  • Faster component bit operations
  • Lower overhead entity proxies
  • More stable tick math
  • Improved entity query performance

Changelog

Full diff available in the commit history:
v0.0.60...v0.0.70


Install

npm install murow@0.0.70
yarn add murow@0.0.70
bun add murow@0.0.70

If you want it even more blunt / changelog-y (or more marketing-ish), say the word.