Skip to content

Flecs v4.0.2-alpha

Pre-release
Pre-release
Compare
Choose a tag to compare
@SanderMertens SanderMertens released this 30 Apr 08:22
cf1a8ef

What is this?

This is another early preview of the upcoming v4 release! 🎉

You can use this release to familiarize and play around with the new APIs and features before v4 comes out. The biggest difference between v3 and v4 is a new query engine that unifies filters, queries and rules in a single API.

What's new since v4.0.1-alpha

  • A new Flecs Script parser with an improved syntax, new features and a new script manual!
  • A few tweaks to the query DSL that reduce complexity and make it (slightly) less verbose
  • Query fields are now indexed from zero! (so it.field(0) instead of it.field(1))
  • Lots of improvements to API ergonomics & removal of tech debt
  • Lots of bug fixes since the last alpha release

This version does not work with the explorer because of a breaking change in the query DSL. To use the explorer with the alpha, use this URL: https://www.flecs.dev/explorer/v4?remote=true.

The release should be stable enough for experimentation.

Flecs script example

// New: a cleaner syntax allows for more natural type descriptions
struct Position {
  x = f32
  y = f32
}

assembly CheckBox {
  prop checked = bool: false

  // New: conditional logic!
  if $checked {
    Image("checked.png") // New: improved anonymous entity notation
  } else {
    Image("unchecked.png")
  }
}

// New: new syntax that improves ergonomics of working with assemblies
CheckBox my_checkbox(checked: true) {
  Position: {x: 400, y: 300} // New: a more consistent way to specify components

  // Streamlined syntax for creating child entities
  Label my_lbl("Hello world") {
    Position: {x: 100, y: 0}
  }
}

Query DSL example

// Old
Item, Player($this:self|up(ContainedBy))
// New
Item, Player($this|self|up ContainedBy)

What is missing?

  • A big usability update to prefabs is still underway
  • There are a handful of known bugs that still need to be fixed
  • Performance testing hasn't finished yet
  • Documentation has not been updated yet

When will v4 come out?

The updated goal is to release around the end of May, with a beta release coming out in around two weeks.

Where can I share feedback?

Post v4 feedback in this discussion post: #1181 or on the Flecs discord server, whichever you prefer!

⚠️ Do not use this release in an actual project! ⚠️