Repository navigation
v0.2.0-alpha.1 - Entity-component system
Pre-release
Pre-release
·
26 commits
to main
since this release
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.
Transformhandles position, rotation and scale, whileSpriteRenderersimply 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.setTickRateAPI.
The scripting API has been updated with 3 new objects:
Scenehandles all the APIs related to the new ECS: you can add and delete entities and freely modify their components.Componentis a new class that implements common methods for the two built-in components. Later this will be the base for custom components.Entityis a new class that helps mods handle common entity functions, such asEntity.getComponentorEntity.delete.- To improve development experience, the monolithic
runtime/index.tswas split up into different files each managing a subset of the API.
Full Changelog: v0.1.1-alpha.1...v0.2.0-alpha.1