Skip to content

Releases: Quillraven/Fleks

2.2

26 Nov 18:13

Choose a tag to compare

2.2
  • BUGFIX: fixed an issue that was introduced in version 2.1 which caused families to not get updated properly when used in a nested iteration way. Thanks to @ernespn for reporting this issue!
  • NEW: added the get operator to the EntityBag interface. This allows to do a normal for loop over a family. Thanks to @ScottHamper for the proposal and contribution!
  • UPDATE: updated Kotlin to 1.7.21

2.1

23 Oct 16:40

Choose a tag to compare

2.1

A small update that brings some collection functionality when working with entities (EntityBag):

  • UPDATE: Kotlin and Dokka to 1.7.20
  • UPDATE: change Entity back to value class instead of data class
  • UPDATE: nested calls of entity and entity.configure are now possible. Also, the documentation of those two functions got updated to point out a potential risk.
  • NEW: add entity contains function to family
  • UPDATE: IntBag is now split into two classes: EntityBag and MutableEntityBag. You can use them in your own game if you want.
  • NEW: add a lot of collection functionality to EntityBag (thanks to @rubybrowncoat for the suggestion):
    • size
    • contains, containsAll
    • isEmpty, isNotEmpty
    • all, any, none
    • associate, associateBy, associateTo, associateByTo
    • count
    • filter, filterNot, filterIndexed, filterTo, filterNotTo, filterIndexedTo
    • find
    • first, firstOrNull
    • fold, foldIndexed
    • forEach, forEachIndexed
    • map, mapIndexed, mapTo, mapIndexedTo, mapNotNull, mapNotNullTo
    • random, randomOrNull
    • take
    • groupBy, groupByTo
    • flatMap, flatMapSequence, flatMapBag, flatMapNotNull, flatMapSequenceNotNull, flatMapBagNotNull

2.0

28 Sep 16:48

Choose a tag to compare

2.0

After almost one year, this release finally combines the JVM and KMP releases into one single release. I also tried to simplify Fleks for newcomers and be more consistent with the way of Kotlin, resulting in more concise and readable code.

This has the sideeffect, that there are several breaking changes in version 2.0 and you cannot simply upgrade from either 1.6-JVM or 1.6-KMP because of those API changes.

For more details, please check out the wiki which contains both, the hold and new API documentation.

If you want to migrate then also please have a look at this youtube video from myself, where I migrate some code segments from 1.6-JVM to 2.0.

I hope you like the new changes and try it out!

Special shout outs to @jobe-m and @czyzby who helped with the development of 2.0 by giving feedback and suggestions. And also for the verification in a KorGE game setup (jobe-m). Thanks!

1.6-KMP

19 Aug 11:29
d95f6bf

Choose a tag to compare

This release fixes a rare bug and improves the debugging capabilities of Fleks. In addition, it is now possible to load a specific "snapshot" for your world.

  • BUGFIX: fix an issue that entities did not get removed from families that only used the noneOf configuration. The reason is that a removed entity has no components which is then actually valid for such families. However, a removed entity should of course be removed from any family ;)
  • UPDATE: BitArray has a new toString function which makes it easier to debug certain things.
  • NEW: new snapshot and snapshotOf function for the World to get a snapshot of the entire world (=entities and components) or of a specific entity. This should also help with debugging. A new page to the Wiki was added as well regarding debugging.
  • NEW: new loadSnapshot function for the World to load a specific snapshot. This will clear the current world and create entities and components according to the provided snapshot.
  • Gradle got updated from 7.5 to 7.5.1

1.6-JVM

16 Aug 11:55

Choose a tag to compare

This release fixes a rare bug and improves the debugging capabilities of Fleks. In addition, it is now possible to load a specific "snapshot" for your world.

  • BUGFIX: fix an issue that entities did not get removed from families that only used the noneOf configuration. The reason is that a removed entity has no components which is then actually valid for such families. However, a removed entity should of course be removed from any family ;)
  • UPDATE: BitArray has a new toString function which makes it easier to debug certain things.
  • NEW: new snapshot and snapshotOf function for the World to get a snapshot of the entire world (=entities and components) or of a specific entity. This should also help with debugging. A new page to the Wiki was added as well regarding debugging.
  • NEW: new loadSnapshot function for the World to load a specific snapshot. This will clear the current world and create entities and components according to the provided snapshot.
  • Gradle got updated from 7.5 to 7.5.1

As always, KMP version will be released a few days later.

1.5-KMP

25 Jul 11:22

Choose a tag to compare

This is a small release that brings in an important bugfix, some utility functions for families and some internal version upgrades:

  • BUGFIX: fixed numEntities of a family to return the correct number of entities instead of the highest ID of any entity inside the family
  • NEW: added isEmpty, isNotEmpty, first and firstOrNull functions to a family
  • Update Kotlin version to 1.7.10
  • Update Gradle to 7.5

1.5-JVM

24 Jul 09:15

Choose a tag to compare

This is a small release that brings in an important bugfix, some utility functions for families and some internal version upgrades:

  • BUGFIX: fixed numEntities of a family to return the correct number of entities instead of the highest ID of any entity inside the family
  • NEW: added isEmpty, isNotEmpty, first and firstOrNull functions to a family
  • Update Kotlin version to 1.7.10
  • Update Gradle to 7.5

1.4-JVM

05 Jul 17:35

Choose a tag to compare

This is a small update to the JVM version containing the new DSL to create and configure a world, which was added in the latest KMP version.
JVM and KMP are now up-to-date again featurewise.

Be aware, that this version contains a breaking change when it comes to creating a world. This must be done via the new DSL.

Also, the wiki got updated and the API/example area is now removed from the ReadMe file. Everything got moved to the wiki which also contains the documentation for the new DSL!

1.4-KMP-RC1

28 Jun 07:33

Choose a tag to compare

One bigger release for the KMP version of Fleks bringing all the changes done in the JVM version since 1.1 into it. In addition, a new DSL was added to configure a world in a nicer way.
Also, the project setup was converted from a JVM project to a real Kotlin multiplatform project with different sourceSets for the different targets. This makes it now possible to add Fleks via normal dependencies to a KMP project like e.g. in a KorGE game.

Refer to the full changelog below:


Changelog:

  • BUGFIX: Entities created inside a system's constructor are now properly added to their family and also EntityListener get notified correctly in this case
  • BUGFIX: ComponentListener did not get notified when entities are created in a system's init block
  • UPDATE: change dokka from 1.6.10 to 1.6.21
  • UPDATE: the used parameter of an injectable is removed because injectables are now properly resolved and cleared once the world is created
  • UPDATE: minor memory management improvements
  • NEW: make world a default dependency for the dependency injection mechanism. That way it is now possible to easily pass the world to a ComponentListener
  • NEW: add getter for world's systems
  • NEW: add configureEntity to world. This makes it now possible to modify an entity outside of a system as requested in the comments section of my YouTube channel
  • NEW: add support to create families out of a system via the world. This is the biggest change of this version and adds new flexibility on how to handle and iterate over entities with specific component configurations
  • NEW: users have now access to the family of an IteratingSystem
  • NEW: family now also contains a configureEntity function which allows users to modify an entity outside of a system in a convenient way
  • NEW: a new FamilyListener support is added which allows users to react on when an entity is added to, or removed from a family
  • NEW: new DSL to create a world. Use components , systems, injectables or families block to define your world. For more details, refer to the ReadMe
  • NEW: the KMP setup was updated to a proper multiplatform gradle setup. That way it is now possible to add Fleks to a KorGE dependency via following line in the korge block
    dependencyMulti("io.github.quillraven.fleks:Fleks:1.3-KMP", registerPlugin = false)

1.3-JVM

02 Jun 18:10
6dddca0

Choose a tag to compare

Another update within a short period of time because the last version introduced a bug. I should not work an releases ~midnight time - note to myself for the future! :)

Anyway, here is the changelog:

  • BUGFIX: ComponentListener did not get notified when entities are created in a system's init block
  • BUGFIX: nested Family iteration was not properly handled when entities got removed during iteration. The entity removal delay was removed by the inner loop instead of the outer
  • NEW: users have now access to the family of an IteratingSystem
  • NEW: family now also contains a configureEntity function which allows users to modify an entity outside of a system in a convenient way
  • NEW: a new FamilyListener support is added which allows users to react on when an entity is added to, or removed from a family

ReadMe is updated as well. You can find examples for the new Family and FamilyListener functionality at the end before the Performance section.

Enjoy!