Skip to content

2.0.0

Latest

Choose a tag to compare

@ctreffs ctreffs released this 07 Nov 08:36
· 1 commit to main since this release
feeda37

FirebladeECS 2.0

FirebladeECS 2.0 brings a value-type component model, contiguous component storage and significant performance gains.

⚠️ This is a major update with API / breaking changes:

  • Components are now value types (formerly classes). Reading a component returns a copy, and every write goes through set, modify or forEach(reading:writing:), which makes every change to your data explicit.
  • Components are stored contiguously, in a new archetype storage by default or optionally in a sparse set, so systems iterate tightly packed memory.
  • Entity identifiers carry a generation, so a destroyed entity never matches a later one.
  • The state machine moved into its own FirebladeFSM product, and the macros no longer re-export the library.
  • The deprecated 1.x lookups are removed.
  • Swift 6.2 or later is required.

Migration

The Migrating to FirebladeECS 2 guide walks through the move from 1.x. Most projects need three steps: fix the 1.x deprecation warnings, turn component classes into structs, and replace writes that relied on reference semantics. Read the for var hazard first, because the compiler cannot catch it.

Performance

The 1.4.3 vs 2.0.0 benchmark report (full suite, 10 replicates) shows 2.0 faster on every workload at larger entity counts:

  • Family iteration and system updates: 24–89×
  • Component add and remove: 3–7×
  • Entity creation: 2–6×
  • Entity lookup: 1.4–3.4×

What's Changed

  • Update dependency nicklockwood/SwiftFormat to v0.64.0 by @renovate[bot] in #153
  • Update dependency nicklockwood/SwiftFormat to v0.64.1 by @renovate[bot] in #156
  • Require Swift 6.2 or later by @ctreffs in #157
  • Run CI on labeled pull requests into any branch by @ctreffs in #162
  • Add generational entity identifiers by @ctreffs in #158
  • Store components in sparse sets by @ctreffs in #159
  • Add opt-in value change events by @ctreffs in #160
  • Add in-place component mutation to Entity by @ctreffs in #163
  • Make components value types by @ctreffs in #164
  • Add read/write family iteration by @ctreffs in #165
  • Declare families as types with @FamilyTraits by @ctreffs in #166
  • Add component spans by @ctreffs in #167
  • Support structs and enums in the Component macro by @ctreffs in #168
  • Add an archetype storage next to the sparse set by @ctreffs in #169
  • Use the archetype storage by default by @ctreffs in #170
  • Remove the deprecated 1.x lookups and the macro module re-export by @ctreffs in #171
  • Move the entity state machine into the FirebladeFSM product by @ctreffs in #172
  • Document FirebladeECS 2.0 and the migration from 1.x by @ctreffs in #173
  • Update Mint non-major dependencies by @renovate[bot] in #174
  • Update Renovate rules for swift-syntax and add CI config validation by @ctreffs in #177
  • Migrate default branch from master to main by @ctreffs in #178
  • Remove sync-master workflow by @ctreffs in #180
  • Update dependency nicklockwood/SwiftFormat to v0.64.4 by @renovate[bot] in #179
  • Update dependency ordo-one/benchmark to from: "1.38.1" by @renovate[bot] in #183
  • Support multi-version documentation deployment, version navigation, and Swift Package Index integration by @ctreffs in #182
  • Update actions/upload-artifact action to v7 by @renovate[bot] in #184
  • Update non-doc markdown files and contribution guides by @ctreffs in #185
  • Lint by @ctreffs in #186
  • Read registered component indices lock-free by @ctreffs in #189
  • Remove fixed per-call costs at small entity counts by @ctreffs in #190
  • Benchmarking by @ctreffs in #187
  • Update Mint non-major dependencies by @renovate[bot] in #188
  • Fix lint and add lint CI workflow by @ctreffs in #191
  • Label benchmark refs and check release sources by @ctreffs in #192
  • Update dependency nicklockwood/SwiftFormat to v0.64.6 by @renovate[bot] in #193
  • Add 1.4.3 vs 2.0.0 benchmark report by @ctreffs in #194

Full Changelog: 1.4.3...2.0.0