Releases: jprochazk/uecs
Releases · jprochazk/uecs
v0.4.2
v0.4.0
- Iteration performance improved
- It's hard to measure, but it scales better now [1]
- Slight performance increase when constructing views (~5%)
- Remove no longer throws for non-existent/dead entities
⚠️ Dropped support for IE11- This resulted in a bundle size decrease from ~3.5 kB to ~2.5 kB, and probably played a role in the performance increase
[1]:
N components | Improvement |
---|---|
2 | ~5% |
3 | ~30% |
4 | ~42% |
0.3.1
0.3.0
- Added more documentation regarding
View
andView.each
behavior, including mentions in the tutorial - Tags can now be made from anything that has a
.toString()
method, such asstring
s,number
s, and even objects like:
const StrangeTag = { toString: () => "spooky" }
The intellisense for these is not ideal, so I don't recommend it, but it's possible. 🙂
0.2.7
- Fixed a bug with the entity sequence when using
World.insert
(1)
(1) The edge case is best explained with an example:
world.create(); // returns 0
world.insert(100); // returns 100
world.create(); // returns 101
world.insert(99); // returns 99...
world.create(); // returns 100 !!!!
In short, World.insert
didn't account for the current entity sequence, meaning you could easily cause strange behavior (such as entity components being overwritten (2)) without you knowing. The fix was to check if the entity we're inserting is greater than the current sequence, and only if it is, set the sequence to insertedEntity + 1
.
(2) Again, just to give an example of what would happen before the fix:
class A { constructor(value = 0) { this.value = value } }
world.insert(100, new A(100));
world.insert(99, new A(99));
const entity = world.create(new A(101));
// the above call overwrote entity#100:
entity === 100; // true
world.get(entity, A).value; // 101
And after the fix:
class A { constructor(value = 0) { this.value = value } }
world.insert(100, new A(100));
world.insert(99, new A(99));
const entity = world.create(new A(101));
entity === 101; // true
world.get(entity, A).value; // 101
world.get(100, A).value; // 100
0.2.6
0.2.5
- Added controls + explainer to simple-ai example
- Improved documentation
- Added a full walk-through of the API
- Updated README
- Fixed a bug where
insert
ing an entity would not increase the current entity sequence (code sample below)
world.insert(0, new A);
const entity = world.create(new B);
world.has(entity, A); // true !?