Skip to content

v0.2.0-alpha.1 - Entity-component system

Pre-release
Pre-release

Choose a tag to compare

@MesterMan03 MesterMan03 released this 22 May 23:58
· 26 commits to main since this release
53a9ef7

Whatever v0.2.0 - Entity-component system

This update implements many of the features that make Whatever an actually usable engine, that being the Entity-component system (ECS). ECS adds proper entities with components that the scripting API can freely attach, remove or edit.

  • Built-in components: the engine provides 2 components out of the box. Transform handles position, rotation and scale, while SpriteRenderer simply renders an image sprite.
  • Support for custom components: to continue the engine's philosophy, mods are allowed to register their own custom components. While the infrastructure has been implemented in the engine, this functionality is still missing from the scripting API and will be added in the future.
  • The current scene architecture has been completely reworked to support the new systems and to allow mods to interact with entities and components.
  • Mods can now subscribe to a new "Tick" event. On every tick, all subscribing mods will be queried, and the engine will wait until all of them reply. To prevent crashes from misbehaving mods, a new watchdog was implemented that actively detects if a tick hangs.
  • To support this system, the engine now runs on a fixed tick rate. The default tick rate is 60, but can be dynamically modified during runtime using the new Engine.setTickRate API.

The scripting API has been updated with 3 new objects:

  • Scene handles all the APIs related to the new ECS: you can add and delete entities and freely modify their components.
  • Component is a new class that implements common methods for the two built-in components. Later this will be the base for custom components.
  • Entity is a new class that helps mods handle common entity functions, such as Entity.getComponent or Entity.delete.
  • To improve development experience, the monolithic runtime/index.ts was split up into different files each managing a subset of the API.

Full Changelog: v0.1.1-alpha.1...v0.2.0-alpha.1