You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current syncing of indexer state to client does not scale.
Getting data from the indexer is quick and no problem. It is the updating of the entities store that takes long (currently about 10 seconds) and blocks the UI in the process, so we can't show any progress indication either.
We are currently getting everything from the indexer, syncing it all to the entitites store, then filter it down to only the machines etc... that are in the player's own pod.
This problem will get worse and worse very quickly.
Current method
We set up listeners for all tables we are interested in here:
Problem
Current syncing of indexer state to client does not scale.
Getting data from the indexer is quick and no problem. It is the updating of the
entities
store that takes long (currently about 10 seconds) and blocks the UI in the process, so we can't show any progress indication either.We are currently getting everything from the indexer, syncing it all to the
entitites
store, then filter it down to only the machines etc... that are in the player's own pod.This problem will get worse and worse very quickly.
Current method
We set up listeners for all tables we are interested in here:
this-cursed-machine/packages/client/src/svelte/initNetwork.ts
Line 25 in 016d5f9
The svelte store is then update on each update from the chain:
this-cursed-machine/packages/client/src/svelte/modules/systems/createComponentSystem.ts
Line 20 in 016d5f9
So far this works OK once you are in the game – but not on load when you get 3000+ updates quickly.
Possible solution 1
Filter what we sync from the indexer.
We need:
carriedBy
component value)Can we filter by the
carriedBy
value?How do we know the id of the players pod before syncing?
Possible solution 2
Get state from indexer.
Set
entities
in one go.Avoiding the many calls to
entities.update
.Possible solution 3
Move updating the
entities
store to a webworker.Probably not possible.
The text was updated successfully, but these errors were encountered: