Skip to content

v0.6.5 - Rachel's Song

Latest

Choose a tag to compare

@krispya krispya released this 06 Feb 00:59
· 50 commits to main since this release
c24159d

This was going to be a small release but it turns out I added three substantive features instead.

Koota agent skill

Koota now has an officially maintained agent skill. You can install it using the skills CLI, or manually copy it out of the repo.

npx skills add pmndrs/koota

It will be updated often so be sure to check for the latest version time to time. Eventually we will be able to properly version the skill.

readEach for read only query iteration

Currently the only ergonomic way to get the trait data per entity is to query and use updateEach. I found there was a lot of situations where I did not want to write, but just read the data. There is now a read only method that is a bit more performant to boot called readEach.

// This reads and writes
world.query(Position, Velocity).updateEach(([position, velocity]) => {
  position.x += velocity.x * delta
  position.y += velocity.y * delta
})

// This only reads
const data = []
world.query(Position, Velocity).readEach(([position, velocity]) => {
  data.push({ x: position.x, y: position.y })
})

You can use logical OR with Added, Removed and Changed

I had a situation recently where I needed to run a system if either position or velocity changed, it did not matter which. However, this was not supported! That has now changed along with some slight tune ups to the query internals while I was in there.

world.query(Or(Changed(Position), Changed(Velocity))).updateEach(([position, velocity]) => {
   // Do something
})

And that is it for now. Big refactors are on the way, and, with luck, an actual doc site too. Stay tuned.

What's Changed

Feat

Fix

Full Changelog: v0.6.4...v0.6.5