Repository navigation
ZoneService v0.4.0-beta
·
16 commits
to main
since this release
- API rework: removed all old zone registration methods and all string key usage. New API forces the user to register zones and track entities in correct order. For example, with the new API you cannot try to observe an entity before it's registered or before a group is registered
- Added Zone, Group, and Tracked objects
- Zone and Group objects can be instantiated with .new while Tracked objects are returned when calling :track
- Zone specific methods (anything that used to require a zone name) moved onto new Zone object
- Method name changes: isPointInZone -> isPointInside, getRandomPointInZone -> getRandomPointInside, updateZone -> update, removeZone -> destroy, entered -> onEnter, exited -> onExit, changed -> onZoneChange, addZone -> ZoneService.new, addZoneFromPart -> ZoneService.fromPart
- getSubjectsInZone method removed
- Subject type changed to "Entity" and all subject variables renamed to entity for more clarity
- Added metadata and destroyed flag to zones
- New group creation method via Group.new
- Add/remove zones to/from groups using new :add and :remove methods
- Destroy groups using Group:destroy
- If a zone is not added to any group, it defaults to a default internal group. In this state, zones cannot be observed with :zoneChanged
- A single zone can now belong to multiple groups, which scales better than creating multiple copies of the same zone under different groups. That said, scaling with multiple groups is still not amazing due to an information limit, so it's recommended the user does not add the same zone to multiple groups unless absolutely necessary
- Max groups limit removed
- Reworked group tracking logic: scalability with number of groups improved significantly
- Removed unnecessary internal bookkeeping
- changed signal (now called onZoneChange) moved onto Tracked handle
- getZones method moved onto Tracked handle
- Added adaptive polling algorithm: dynamically selects the optimal frame interval, improves performance significantly in some cases
- Polling interval is no longer configurable; instead, there is a new polling rate config
- Added strict typing for new type solver