Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loosen types for get #20

Merged
merged 325 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
325 commits
Select commit Hold shift + click to select a range
489599f
Merge pull request #13 from noahwillcrow/patch-1
evaera May 13, 2022
ce1e9ad
trackedChanged edit
hatmatty May 18, 2022
bce23a4
one liner
hatmatty May 18, 2022
a129fa0
Fix comments on structure of _archetypes and _entityArchetypes
noahwillcrow May 20, 2022
b502b07
Switch from Foreman to Aftman
evaera Jun 4, 2022
5a5c572
Merge pull request #9 from flamenco687/export-types
evaera Jun 4, 2022
4e39136
Merge pull request #12 from Qualadore/correct-system-error-stacktraces
evaera Jun 4, 2022
4af982f
Fix formatting and add tests
evaera Jun 4, 2022
e3c60ee
Merge pull request #15 from hatmatty/main
evaera Jun 4, 2022
9657ae9
Merge pull request #16 from noahwillcrow/patch-1
evaera Jun 4, 2022
3550dd0
Update rojo
evaera Jun 4, 2022
6fb050c
Merge branch 'main' of https://github.com/evaera/matter
evaera Jun 4, 2022
d2eabd4
Update CHANGELOG.md
evaera Jun 4, 2022
6cedc31
Implement QueryResult:__iter
evaera Jun 4, 2022
4581a4f
Improve World error messages
evaera Jun 4, 2022
b1e8b95
Allow specifying default component data
evaera Jun 4, 2022
dca9abb
Remove additional queryChanged parameters
evaera Jun 4, 2022
e3fe7fc
Correct module casing
evaera Jun 4, 2022
42f889a
Remove dependency on llama
evaera Jun 4, 2022
e8c8724
Update example game for queryChanged changes
evaera Jun 4, 2022
86ada29
Add QueryResult:snapshot
evaera Jun 4, 2022
740f19d
Release version 0.2.0
evaera Jun 4, 2022
7109bbb
fix casing for module names
Ukendio Jun 6, 2022
ae853b5
Merge pull request #18 from Ukendio/correct-casing
evaera Jun 6, 2022
49ac08e
Add spawnAt and __iter
evaera Jun 21, 2022
5fd3371
Update example to use replication
evaera Jun 22, 2022
5f4641c
Add hot reloading support
evaera Jun 22, 2022
de4a909
Rename packages/example packages in example
evaera Jun 22, 2022
9d7106e
Improve hot reloading in example project
evaera Jun 22, 2022
7b78606
Emit warning when useEvent event changes
evaera Jun 22, 2022
63c36fe
Update CHANGELOG.md
evaera Jun 22, 2022
7c0c636
Update example readme
evaera Jun 22, 2022
e575fff
add test for spawnAt
evaera Jun 22, 2022
b9b793f
Add tests for evictSystem and replaceSystem
evaera Jun 23, 2022
9568c7e
Update CHANGELOG.md
evaera Jun 23, 2022
b7a68ef
Update query iteration warning
evaera Jun 23, 2022
eab00d4
Add better error message for invalid topo storage
evaera Jun 23, 2022
2891e3a
Release version 0.3.0
evaera Jun 23, 2022
ec15e47
exclude additional files in wally.toml
evaera Jun 23, 2022
23b0584
fix docs typo
evaera Jun 23, 2022
decc500
fix mistake in docs
evaera Jun 23, 2022
9d1ce9c
Make query not cause iterator invalidation
evaera Jun 25, 2022
84bf975
Update component:patch to use table.clone
evaera Jun 25, 2022
cbfd1b9
Update CHANGELOG.md
evaera Jun 25, 2022
326e4d6
Error if id already exists in spawnAt
evaera Jun 25, 2022
edbddd2
Average stress test over a longer period
evaera Jun 25, 2022
0da1165
Clean up queryChanged storage
evaera Jun 25, 2022
3691c58
Fix after table with hot reloading
evaera Jun 25, 2022
b96b347
Update CHANGELOG.md
evaera Jun 25, 2022
bab7a52
Use mock BindableEvents for test
evaera Jun 25, 2022
69df97b
Update CHANGELOG.md
evaera Jun 25, 2022
1607d73
Release version 0.4.0
evaera Jun 25, 2022
3629081
First version of debug ui
evaera Jun 27, 2022
ddb608f
Move hot reload logic into rewire fork
evaera Jun 27, 2022
5ec9a80
Move debugger into library
evaera Jun 28, 2022
99d02fc
Switch back to rewire
evaera Jun 28, 2022
7beef3c
support multiple events in debugger
evaera Jun 28, 2022
e5e8ecc
Update docs
evaera Jun 30, 2022
9af5326
add support for server debugger
evaera Jun 30, 2022
b009de8
Sync debugvision and debugger
evaera Jun 30, 2022
370699e
Add docs to debugger
evaera Jun 30, 2022
7fb8fdf
Use plasma multi-phase api
evaera Jun 30, 2022
6898595
Switch back to release plasma
evaera Jun 30, 2022
045ffbd
Update CHANGELOG.md
evaera Jun 30, 2022
44595f8
Add docs for authorize function
evaera Jun 30, 2022
d468be3
ex: remove server from entity map when despawned
evaera Jun 30, 2022
028d79d
Add new docs
evaera Jun 30, 2022
2af8e23
Add debugger to matter props
evaera Jun 30, 2022
54f7bcc
Handle skipSystems in replace loop
evaera Jun 30, 2022
f2c77bd
Release version 0.5.0
evaera Jun 30, 2022
028aa2b
Fix debug widgets with absolute references
evaera Jun 30, 2022
60b3388
Release version 0.5.1
evaera Jun 30, 2022
55e3c73
Respect anonymous function names and functions defined in the system …
4igz Jul 1, 2022
e2160b8
Update .gitignore
evaera Jul 2, 2022
b94e326
Update plasma
evaera Jul 2, 2022
4f8c3d9
Fix scrolling panel
evaera Jul 2, 2022
990a5f9
Use hydrateAutomaticSize
evaera Jul 2, 2022
931c161
Update CHANGELOG.md
evaera Jul 2, 2022
42ed678
Merge branch 'main' into pr/19
evaera Jul 2, 2022
be84e5b
Make systemName more useful
evaera Jul 2, 2022
a394781
Merge pull request #19 from 4igz/debug-ui-system-names
evaera Jul 2, 2022
1ea7bfd
Update CHANGELOG.md
evaera Jul 2, 2022
ac14802
Merge branch 'main' of https://github.com/evaera/matter
evaera Jul 2, 2022
ba58919
Release version 0.5.2
evaera Jul 2, 2022
7ee9b90
don't create new _storages every frame
evaera Jul 2, 2022
c56cb36
Add missing debug widgets
evaera Jul 3, 2022
4f67a95
Add link widget
evaera Jul 3, 2022
b12c62d
Add icons to selectionList
evaera Jul 3, 2022
a49d0c8
Make new windows work with event bridge
evaera Jul 3, 2022
064182f
Use refs in useInstance
evaera Jul 3, 2022
f81f05b
Add table viewer
evaera Jul 3, 2022
918e461
Add quick performance log
evaera Jul 4, 2022
b01db5c
Initial debugger design pass
evaera Jul 4, 2022
61e56a8
Support custom events through duck typing
Jul 4, 2022
ce9610c
Update CHANGELOG.md
Jul 4, 2022
bbf12f0
Update CHANGELOG.md
Jul 4, 2022
30d4e36
Update useEvent.lua
Jul 4, 2022
57719ee
Update useEvent.lua
Jul 4, 2022
d7fbbb6
Cleanup
Jul 4, 2022
7592c72
More cleanup
Jul 4, 2022
7aef20a
Commit
Jul 4, 2022
67ba165
Fix order
Jul 4, 2022
bd11979
Support passing in custom signals directly as the 2nd argument (backw…
Jul 4, 2022
89b61ab
Fix bugs
Jul 4, 2022
94649ad
Fix events not returning connection
evaera Jul 5, 2022
df5e012
Add world inspector
evaera Jul 5, 2022
a4a508b
Update for plasma v0.4.0
evaera Jul 5, 2022
fcded01
Update debugger screenshot
evaera Jul 5, 2022
0760501
Upgrade Plasma in example
evaera Jul 5, 2022
2fc0c8a
Release version 0.5.3
evaera Jul 5, 2022
aef8b5d
Fix error when deleting profiling info when not profling
evaera Jul 5, 2022
a7b3b34
Add docs and cleanup
Jul 5, 2022
6515b92
Update CHANGELOG.md
Jul 5, 2022
33e5c22
Merge branch 'main' into main
Jul 5, 2022
d0c29fd
Pass `self` as the first argument to custom cleanup methods
Jul 5, 2022
828924a
Improve docs
Jul 6, 2022
ec992dc
Fix automatic size for selection list
evaera Jul 6, 2022
b08f007
Improve formatTable function
evaera Jul 6, 2022
b0d40f0
Fix panel overflowing off screen
evaera Jul 6, 2022
59a80e1
Move inspectors into separate widgets
evaera Jul 6, 2022
911d123
Add highlight to world inspect
evaera Jul 7, 2022
cd9a053
Delete logo.lua
evaera Jul 7, 2022
db7d413
Centralize primary color style
evaera Jul 7, 2022
b342ff6
remove unused import
evaera Jul 7, 2022
7631798
drop the Id
evaera Jul 7, 2022
fef3f4a
Suggest compatible Plasma in debugger docs
benbrimeyer Jul 7, 2022
ce0e532
use pairs
evaera Jul 7, 2022
c58ccb4
Add caution tip for autoInitialize docs
benbrimeyer Jul 7, 2022
97f250e
Make queryChanged return existing entities
evaera Jul 8, 2022
4acf36d
Refactor debugger and add hover selection
evaera Jul 8, 2022
091ffc7
Update docs
evaera Jul 8, 2022
6e11de6
Merge pull request #23 from benbrimeyer/patch-2
evaera Jul 8, 2022
646bcf1
Merge pull request #22 from benbrimeyer/patch-1
evaera Jul 8, 2022
abd9d70
Merge branch 'main' into pr/20
evaera Jul 8, 2022
441e7c1
Tweak custom useEvent code
evaera Jul 8, 2022
5e254a8
Add some tests
evaera Jul 8, 2022
c43ad10
Merge pull request #20 from bubshayz/main
evaera Jul 8, 2022
2bd5bc3
Update plasma version in docs
evaera Jul 9, 2022
dce95a7
Update plasma in example
evaera Jul 9, 2022
8982c42
Release version 0.6.0
evaera Jul 9, 2022
16ee850
Fix debugger bug with deferred events
evaera Jul 9, 2022
544572b
Reorganize example game
evaera Jul 10, 2022
d14383b
Fix early return in system
evaera Jul 10, 2022
21ad994
Add query inspect
evaera Jul 10, 2022
1e13d25
Add error inspection
evaera Jul 10, 2022
806b6f2
useCurrentSystem return nil when not in system
evaera Jul 10, 2022
726d52c
Add Matter.log
evaera Jul 10, 2022
08bb129
Update CHANGELOG.md
evaera Jul 10, 2022
fb07cee
Update recommended plasma version
evaera Jul 10, 2022
5e1c278
Release version 0.6.1
evaera Jul 10, 2022
cf26ecb
fix docs
evaera Jul 10, 2022
53f9603
Fix example link.
ShouxTech Jul 11, 2022
ded326f
Merge pull request #25 from ShouxTech/patch-1
evaera Jul 11, 2022
1f622ca
Correct comment for _getStorageWithEntity
noahwillcrow Jul 14, 2022
975ecb8
Update home page
evaera Jul 19, 2022
ccdd6ed
Fix text on light theme
evaera Jul 19, 2022
e0772e0
fix mobile view
evaera Jul 19, 2022
a4eaa34
Ignore sourcemap.json.
Anaminus Jul 19, 2022
8e49885
Fix conversion of tombstone to System type.
Anaminus Jul 19, 2022
f319bbb
Fix iteration of customWidgetConstructors.
Anaminus Jul 19, 2022
2735954
Fix argument mismatch when formatting CFrame components.
Anaminus Jul 19, 2022
b87ab21
Fix iteration of dirtyWorlds.
Anaminus Jul 19, 2022
77d6259
Remove unused GuiService variable.
Anaminus Jul 19, 2022
2632c0e
Return nil explicitly for widgets.
Anaminus Jul 19, 2022
0858cc1
Return nil explicitly in _getStorageWithEntity.
Anaminus Jul 19, 2022
788e8ad
Use explicit returns in iterators.
Anaminus Jul 19, 2022
d4a1341
Don't hook queryChanged in debugger
evaera Jul 23, 2022
d8174dc
Release version 0.6.2
evaera Jul 23, 2022
6fbeac0
Merge pull request #27 from Anaminus/tidy-lsp
evaera Jul 23, 2022
a9827d3
Update comment
evaera Jul 23, 2022
bb17f5f
Merge pull request #26 from noahwillcrow/patch-2
evaera Jul 23, 2022
e425b7f
Fix broken link
samcparker Aug 3, 2022
03c153d
Merge pull request #34 from samcparker/patch-1
evaera Aug 3, 2022
970a4ba
Update Replication.md
rimuy Aug 28, 2022
dc6edff
Merge pull request #36 from Rimuy/patch-1
evaera Sep 6, 2022
e6678a9
Update Reconciliation for new QueryChanged API
Aloroid Oct 22, 2022
e812806
Merge pull request #37 from Aloroid/main
evaera Oct 22, 2022
1f95848
Correct typo (#42)
Nov 2, 2022
db856e7
Ensure exported matter object is read only (#41)
Nov 2, 2022
eda67a1
Change `Matter.log` to return nothing as expected (#43)
Nov 3, 2022
2e707d7
Improve docs for `Matter.useEvent` (#44)
Nov 5, 2022
c08c238
Update Rojo's version to 7.2.1 to mitigate attribute error (#47)
Nidoxs Nov 7, 2022
6cd5397
Get rid of unused variables (#48)
Dec 24, 2022
3d5dc3c
Create CommonMistakes.md
evaera Feb 17, 2023
25920f4
Improve docs
evaera Mar 19, 2023
dd4de4b
Improve error message when a component instance is accidentally passe…
May 16, 2023
90962b1
Improve error message
evaera May 16, 2023
1b1bd87
Debugger Appears Above Ingame UI (#49)
ambergamefam May 16, 2023
cdf0867
Improve system scheduler logic (#54)
metrowaii May 16, 2023
be89a87
Sort component list in worldInspect.lua (#55)
benbrimeyer May 22, 2023
2e27b46
Prevented systems with undefined dependencies from being scheduled (#57)
metrowaii Jun 1, 2023
2a8e392
allow worldView and objectStack views to be toggled (#60)
benbrimeyer Jun 7, 2023
cddfe6b
Replaced return statement with continue (#61)
Fizzyhex Aug 7, 2023
2d1ccfa
switch from mouse.Target to a new implementation
jackTabsCode Nov 13, 2023
6447fa7
Merge pull request #68 from jackTabsCode/patch-1
Ukendio Dec 13, 2023
6f73738
use ViewportPointToRay, not ScreenPointToRay
jackTabsCode Dec 16, 2023
a1d119c
Merge pull request #74 from jackTabsCode/patch-1
Ukendio Dec 19, 2023
9fa7d05
Fix system widgets not appearing sometimes
jackTabsCode Dec 20, 2023
fe988d4
Support functions in dummyHandles to support widget configs (#76)
jackTabsCode Dec 20, 2023
3311709
Provide a debugger config for component refresh frequency (#77)
jackTabsCode Dec 20, 2023
0119f07
Update changelog with my changes
jackTabsCode Dec 20, 2023
aa6aff2
Release version 0.7.0
jackTabsCode Dec 20, 2023
aa9c655
Bump wally.lock
jackTabsCode Dec 20, 2023
91a8482
Add check for config in dummyHandle (#78)
Ukendio Dec 20, 2023
3a2f553
Add workflow for linting and checking formatting (#81)
jackTabsCode Dec 21, 2023
5d8a63b
Run StyLua (#82)
jackTabsCode Dec 21, 2023
0165125
Add blame ignore
LastTalon Dec 21, 2023
c38b1fd
use example/src, not example in workflow
jackTabsCode Dec 21, 2023
b12381d
Merge pull request #83 from evaera/blame-ignore
Ukendio Dec 21, 2023
7b497f0
only lint example/src, not example
jackTabsCode Dec 21, 2023
5ea1088
Add release workflow (#86)
LastTalon Dec 21, 2023
9180d9a
Update editorconfig (#84)
LastTalon Dec 21, 2023
1c8d329
Add a .luaurc (#87)
LastTalon Dec 21, 2023
0af3598
Fix selene lints (#88)
jackTabsCode Dec 21, 2023
092fad8
Put TestEz under dev-dependencies in wally.toml (#89)
Ukendio Dec 29, 2023
643e61b
Improve usability of world inspect widget (#95)
memorycode Jan 3, 2024
241463f
Example packages regression fix (#100)
Ukendio Jan 5, 2024
842a8b9
Update README.md for the new org (#5)
LastTalon Jan 7, 2024
a3601fb
Update automations (#8)
LastTalon Jan 8, 2024
6d6f131
Format with StyLua v0.19.1 (#12)
LastTalon Jan 9, 2024
de2da13
Update community docs (#13)
LastTalon Jan 9, 2024
98ef2f4
Update package info (#14)
LastTalon Jan 9, 2024
96b0131
Add migration info (#15)
LastTalon Jan 9, 2024
4aa29be
Fix loop scheduler (#1)
metrowaii Jan 22, 2024
6cbbe93
Optimize query unpacking (#27)
Ukendio Jan 29, 2024
5463169
Make debugger more compact (#32)
jackTabsCode Jan 31, 2024
e74f5f3
Update tooling dependencies (#33)
jackTabsCode Jan 31, 2024
95c6262
Debugger panel improvements (#34)
jackTabsCode Jan 31, 2024
b53fe7a
Fix the release workflow (#37)
LastTalon Jan 31, 2024
62342d8
Remove the wally lockfile (#38)
LastTalon Feb 1, 2024
c1a25f0
Fix releasing again (#39)
LastTalon Feb 1, 2024
22dfc47
Update example game dependencies (#40)
LastTalon Feb 1, 2024
d01b203
Release v0.7.1 (#41)
LastTalon Feb 1, 2024
47492c6
Specify Debugger.authorize docs (#42)
jackTabsCode Feb 2, 2024
735699c
Return chainable iterator after QueryResult:without() (#18)
Ukendio Mar 19, 2024
36e51ba
Add discord badge to readme (#50)
jackTabsCode Mar 20, 2024
60f10ea
Fix debugger state view (#54)
jackTabsCode Apr 11, 2024
83338bb
Archetype Invariants (#4)
Ukendio Apr 14, 2024
f7d40c4
Disable AutoLocalize (#55)
jackTabsCode Apr 14, 2024
ff62f44
Fix scheduler not respecting priority (#51)
metrowaii Apr 15, 2024
f3fe9a2
Loosen types for get
Ukendio Apr 17, 2024
7d93e6b
Loop parameter names (#58)
jackTabsCode Apr 18, 2024
fcd2b7e
Track players in the debugger (#57)
jackTabsCode Apr 21, 2024
958ca63
Update documentation with migration changes (#25)
ATK422 Apr 21, 2024
d6a43dd
Add correct workflow permissions and ref name (#59)
LastTalon Apr 22, 2024
f11b192
Adds query views (#31)
Ukendio Apr 22, 2024
627635d
Update CHANGELOG.md (#60)
Ukendio Apr 23, 2024
5ac0ea5
Merge branch 'main' of https://github.com/matter-ecs/matter into get-…
Ukendio Apr 23, 2024
9e975f6
Fix whitespace
Ukendio Apr 23, 2024
71e1342
Update to v0.8.0
Ukendio Apr 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
tags: ["v*"]

jobs:
release:
build:
name: Release
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -38,4 +38,4 @@ jobs:
- name: Publish
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,23 @@ The format is based on [Keep a Changelog][kac], and this project adheres to

## [Unreleased]


## [0.8.0] - 2024-04-22

### Changed
- Added `Views` for random-accessing entities within queries.
- Views are optimized for terse indexing, making them useful for traversing graphs of entities.
- Added `Debugger.loopParameterNames` which allows for labelling things passed to Loop.
- Disabled `AutoLocalize` on many Plasma Widgets.
- This removes unnecessary computations for `LocalizationService::attemptLocalization`.
- Improved `QueryResult:without` to narrow archetype invariants.
- The filter now works on the archetype-level rather than filtering entities
ad-hoc which will immensely improve query performance.

### Fixed

- Fixed the Scheduler not respecting priorties of systems.
- Fixed padding of items in the Debugger's state view.
## [0.7.1] - 2024-01-31

### Changed
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
<a href="https://matter-ecs.github.io/matter/">
<img src="https://github.com/matter-ecs/matter/actions/workflows/docs.yaml/badge.svg" alt="Docs status">
</a>
<a href="https://discord.gg/6cvzthZC4X">
<img src="https://dcbadge.vercel.app/api/server/6cvzthZC4X?style=flat" alt="OSS Discord">
</a>
</div>
<br>

Expand Down
4 changes: 1 addition & 3 deletions docs/BestPractices/Reconciliation.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Reconciliation, in this context, means taking state from one form and turning it

When writing code in an ECS like Matter, it's ideal for all of our gameplay code to operate on the ECS world alone. In the Matter example game, for example, there are ships that fly to certain points in space. For example, instead of updating the ships in the Data Model directly, we store the current goal position in the Ship component. The Ship component knows nothing about the Data Model. It has no reference to the physical ship Instance in the Data Model, it only contains the state about the ship.

We can create another component (in the [Matter example game](https://github.com/evaera/matter/tree/main/example), we call it `Model`) that holds a reference to the ship Instance.
We can create another component (in the [Matter example game](https://github.com/matter-ecs/matter/tree/main/example), we call it `Model`) that holds a reference to the ship Instance.

We can loop over all Ships that don't also have a Model, and create one for it.

Expand Down Expand Up @@ -116,7 +116,6 @@ We can make a system that handles both of these cases for us.
for id, transformRecord in world:queryChanged(Transform) do

local model = world:get(id, Model)

-- Take care to ignore the changed event if it was us that triggered it
if model and transformRecord.new and not transformRecord.new.doNotReconcile then
model.instance:SetPrimaryPartCFrame(transformRecord.new.cframe)
Expand All @@ -127,7 +126,6 @@ end
for id, modelRecord in world:queryChanged(Model) do

local transform = world:get(id, Transform)

if transform and modelRecord.new then
modelRecord.new.model:SetPrimaryPartCFrame(transform.cframe)
end
Expand Down
2 changes: 1 addition & 1 deletion docs/GettingStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,4 @@ value, so we don't have to mutate the existing component.
## Next steps
You should dive in to the [API reference](/api/Matter)! The Matter API is simple and documented in detail.

And if you haven't already, check out the [`/example` directory in the matter repo](https://github.com/evaera/matter/tree/main/example/).
And if you haven't already, check out the [`/example` directory in the matter repo](https://github.com/matter-ecs/matter/tree/main/example/).
8 changes: 6 additions & 2 deletions docs/Guides/CollectionService.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sidebar_position: 4

# Using CollectionService tags

As a pure ECS first and foremost, Matter provides no special functionality for CollectionService tags out of the box. However, it's rather simple to implement this yourself. Here's an example taken from the official [Matter example game](https://github.com/evaera/matter/tree/main/example/server).
As a pure ECS first and foremost, Matter provides no special functionality for CollectionService tags out of the box. However, it's rather simple to implement this yourself. Here's an example taken from the official [Matter example game](https://github.com/matter-ecs/matter/tree/main/example/src/server).

```lua
local CollectionService = game:GetService("CollectionService")
Expand Down Expand Up @@ -52,4 +52,8 @@ return setupTags

```

This example can be modified to meet your game's needs as you see fit.
<<<<<<< HEAD
This example can be modified to meet your game's needs as you see fit.
=======
This example can be modified to meet your game's needs as you see fit.
>>>>>>> 627635d72d2278846eacb4a446ee4a2e85817fa1
2 changes: 1 addition & 1 deletion docs/Guides/HotReloading.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,5 @@ end, function(_, context)
end)
```

That's it! For a real example of this in action, check out the [Matter example game](https://github.com/evaera/matter/blob/main/example/src/shared/start.lua).
That's it! For a real example of this in action, check out the [Matter example game](https://github.com/matter-ecs/matter/blob/main/example/src/shared/start.lua).

12 changes: 7 additions & 5 deletions docs/Guides/MatterDebugger.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,20 @@ local function spinSpinners(world, _, ui)
end
```

This is accomplished using [Plasma](https://eryn.io/plasma/), an immediate-mode widget library. The widgets are only created while the debugger is active. Leaving the widget calls in your systems all the time is fine, because calling a widget function when the debugger is not open is a no-op.
This is accomplished using [Plasma](https://matter-ecs.github.io/plasma/), an immediate-mode widget library. The widgets are only created while the debugger is active. Leaving the widget calls in your systems all the time is fine, because calling a widget function when the debugger is not open is a no-op.

The [Matter example game](https://github.com/evaera/matter/blob/main/example/shared/start.lua) comes with the debugger set up already. If you want to see an example of the debugger already set up in a game, check out that page.
The [Matter example game](https://github.com/matter-ecs/matter/blob/main/example/shared/start.lua) comes with the debugger set up already. If you want to see an example of the debugger already set up in a game, check out that page.

## Adding the Matter debugger to your game

### Installing Plasma
You need to install [Plasma](https://eryn.io/plasma/) as a dependency to your project. We recommend you do this with [Wally](https://wally.run), the Roblox open source package manager.
You need to install [Plasma](https://matter-ecs.github.io/plasma/) as a dependency to your project. We recommend you do this with [Wally](https://wally.run), the Roblox open source package manager.

To find the latest version of Plasma, check out [this page](https://wally.run/package/matter-ecs/plasma) or run `wally search matter-ecs`.

```toml title="wally.toml"
[dependencies]
plasma = "evaera/[email protected]"
plasma = "matter-ecs/[email protected]"
```

### Create the debugger
Expand Down Expand Up @@ -145,7 +147,7 @@ The following Plasma widgets are available:
- table
- window

For details on these widgets, check out the [Plasma docs](https://eryn.io/plasma/api/Plasma)
For details on these widgets, check out the [Plasma docs](https://matter-ecs.github.io/plasma/api/Plasma)

## Demo videos

Expand Down
8 changes: 8 additions & 0 deletions docs/Guides/Migration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Migration
## Migrating from evaera/matter to matter-ecs/matter
Migrating from `evaera/matter` to `matter-ecs/matter` is easy! The only thing you need to do is change the package name in your `wally.toml` file.

```toml title="wally.toml"
[dependencies]
matter = "matter-ecs/[email protected]"
```
4 changes: 2 additions & 2 deletions docs/Guides/Replication.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Replication is not built into Matter, but it's easy to implement yourself. This guide will give you an overview of one way to implement replication with Matter.

This article will cover the way the [Matter example game](https://github.com/evaera/matter/blob/main/example/shared/start.lua) implements replication.
This article will cover the way the [Matter example game](https://github.com/matter-ecs/matter/blob/main/example/shared/start.lua) implements replication.

## Deciding which components to replicate

Expand Down Expand Up @@ -35,7 +35,7 @@ RemoteEvent.Name = "MatterRemote"
RemoteEvent.Parent = ReplicatedStorage
```

Let's convert the list of component names into actual components. This is assuming you have a Components module that exports your components, like [the matter example game does](https://github.com/evaera/matter/blob/main/example/shared/components.lua).
Let's convert the list of component names into actual components. This is assuming you have a Components module that exports your components, like [the matter example game does](https://github.com/matter-ecs/matter/blob/main/example/shared/components.lua).

```lua
local replicatedComponents = {}
Expand Down
2 changes: 1 addition & 1 deletion docs/Installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ registry = "https://github.com/UpliftGames/wally-index"
realm = "shared"

[dependencies]
matter = "evaera/[email protected]" # Don't copy this. This won't work.
matter = "matter-ecs/[email protected]" # Don't copy this. This won't work.
# Copy real string from page linked above.
```

Expand Down
82 changes: 39 additions & 43 deletions lib/Loop.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,6 @@ local function systemName(system: System)
return debug.info(fn, "s") .. "->" .. debug.info(fn, "n")
end

local function systemPriority(system: System)
if type(system) == "table" then
return system.priority or 0
end

return 0
end

--[=[
@class Loop

Expand Down Expand Up @@ -222,9 +214,46 @@ function Loop:replaceSystem(old: System, new: System)
end

local function orderSystemsByDependencies(unscheduledSystems: { System })
local sortedUnscheduledSystems = table.clone(unscheduledSystems)
local systemPriorityMap = {}
local visiting = "v"

local function systemPriority(system: System)
local priority = systemPriorityMap[system]

if not priority then
priority = 0

systemPriorityMap[system] = visiting

if type(system) == "table" then
if system.after then
for _, dependency in system.after do
if systemPriorityMap[dependency] ~= visiting then
priority = math.max(priority, systemPriority(dependency) + 1)
else
local errorStatement = {
`Cyclic dependency detected: System '{systemName(system)}' is set to execute after System '{systemName(
dependency
)}', and vice versa. This creates a loop that prevents the systems from being able to execute in a valid order.`,
"To resolve this issue, reconsider the dependencies between these systems. One possible solution is to update the 'after' field from one of the systems.",
}
error(table.concat(errorStatement, "\n"))
end
end
elseif system.priority then
priority = system.priority
end
end

systemPriorityMap[system] = priority
end

table.sort(sortedUnscheduledSystems, function(a, b)
return priority
end

local scheduledSystems = table.clone(unscheduledSystems)

table.sort(scheduledSystems, function(a, b)
local priorityA = systemPriority(a)
local priorityB = systemPriority(b)

Expand All @@ -242,39 +271,6 @@ local function orderSystemsByDependencies(unscheduledSystems: { System })
return priorityA < priorityB
end)

local scheduledSystemsSet = {}
local scheduledSystems = {}

local visited, explored = 1, 2

local function scheduleSystem(system)
scheduledSystemsSet[system] = visited

if type(system) == "table" and system.after then
for _, dependency in system.after do
if scheduledSystemsSet[dependency] == nil then
scheduleSystem(dependency)
elseif scheduledSystemsSet[dependency] == visited then
error(
`Unable to schedule systems due to cyclic dependency between: \n{systemName(system)} \nAND \n{systemName(
dependency
)}`
)
end
end
end

scheduledSystemsSet[system] = explored

table.insert(scheduledSystems, system)
end

for _, system in sortedUnscheduledSystems do
if scheduledSystemsSet[system] == nil then
scheduleSystem(system)
end
end

return scheduledSystems
end

Expand Down
42 changes: 42 additions & 0 deletions lib/Loop.spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,48 @@ return function()
connection.default:Disconnect()
end)

it("should call systems in order with dependent system after priority system", function()
local loop = Loop.new()

local order = {}
local systemB = {
system = function()
table.insert(order, "b")
end,
}
local systemC = {
system = function()
table.insert(order, "c")
end,
priority = 1000,
}
local systemA = {
system = function()
table.insert(order, "a")
end,
after = { systemC },
}

loop:scheduleSystems({
systemB,
systemC,
systemA,
})

local connection = loop:begin({ default = bindable.Event })

expect(#order).to.equal(0)

bindable:Fire()

expect(#order).to.equal(3)
expect(order[1]).to.equal("b")
expect(order[2]).to.equal("c")
expect(order[3]).to.equal("a")

connection.default:Disconnect()
end)

it("should not schedule systems more than once", function()
local loop = Loop.new()

Expand Down
21 changes: 1 addition & 20 deletions lib/World.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,26 +120,7 @@ export class World {
* @remarks
* Component values returned are nullable if the components used to search for aren't associated with the entity (in real-time).
*/
public get<a, T extends ComponentCtor>(
entity: a,
only: T,
): Includes<a extends Entity<infer A> ? A : never, ReturnType<T>> extends true
? ReturnType<T>
: ReturnType<T> | undefined;

/**
* Gets a specific set of components from a specific entity in this world.
*
* @param entity - The entity ID
* @param bundle - The components to fetch
* @returns Returns the component values in the same order they were passed to.
* @remarks
* Component values returned are nullable if the components used to search for aren't associated with the entity (in real-time).
*/
public get<a, T extends DynamicBundle>(
entity: a,
...bundle: T
): LuaTuple<a extends Entity<InferComponents<T>> ? InferComponents<T> : NullableArray<InferComponents<T>>>;
public get<T extends DynamicBundle>(entity: AnyEntity, ...bundle: T): LuaTuple<NullableArray<InferComponents<T>>>;

/**
* Performs a query against the entities in this World. Returns a [QueryResult](/api/QueryResult), which iterates over
Expand Down
Loading
Loading