Matter v0.3.0
[0.3.0] - 2022-06-22
This release adds support for saving and restoring World state, hot reloading, and client replication.
Saving and restoring World state
World now has an __iter
metamethod which allows iteration over all entities in the World. This can be used to serialize the data however you want.
World now also has a method called spawnAt
, which lets you spawn an entity with a specific entity ID. This can be used to restore all entities from a save file and ensure they still have the same ID on the other end.
Hot reloading
Hot reloading is now officially supported in Matter. The Matter example game supports hot reloading automatically. Check it out
ywXqBncg.mp4
Client replication
The Matter example game has been updated to support client replication.
Most of this was possible before this release, but it makes use of the ability to iterate over a World to send the initial payload to a client when they connect.
Added
- Added
World:spawnAt
to spawn a new entity with a specified ID. - Added
World:__iter
to allow iteration over all entities in the world the world from a for loop. - Added
Loop:evictSystem(system)
, which removes a previously-scheduled system from the Loop. Evicting a system also cleans up any storage from hooks. This is intended to be used for hot reloading. Dynamically loading and unloading systems for gameplay logic is not recommended. - Added
Loop:replaceSystem(before, after)
, which replaces an older version of a system with a newer version of the system. Internal system storage (which is used by hooks) will be moved to be associated with the new system. This is intended to be used for hot reloading. - The Matter example game has been updated and adds support for both replication and hot reloading.
Changed
- The first entity ID is now
1
instead of0
- Events that have no systems scheduled to run on them are no longer skipped upon calling
Loop:begin
.
Fixed
- Old event listeners created by
useEvent
were not properly disconnected when the passed event changed after having been already created. The event parameter passed to useEvent is not intended to be dynamically changed, so an warning has been added when this happens.
Pull requests since the last release
New Contributors
Full Changelog: v0.2.0...v0.3.0