Skip to content

Optimization#2

Open
Senthemodder wants to merge 12 commits intoConstellationStarStudio:mainfrom
Senthemodder:main
Open

Optimization#2
Senthemodder wants to merge 12 commits intoConstellationStarStudio:mainfrom
Senthemodder:main

Conversation

@Senthemodder
Copy link

Using round robin scheduling, delta time calculated via Date.now() and a idle state along with caches to reduce api calls
get happens once on load, ui logic only runs when the machine is viewed, set only is called when data is changed . Machine instant is registered onLoad and stored persistently . Multi-tiered ticking allowed idle machines to tick silently while more active machines tick faster. Idle machines are moved to a watchdog stop list . Save data have an internal cache that compares old data and new data to cache more efficiently . Also, you can no longer steal UI items.

Raycast also works with UI now.

Review this :3 thx

@Zaharichek
Copy link
Collaborator

Zaharichek commented Feb 2, 2026

Allright.
I have checked machine part of refracted's pull request.
It have some potential and better optimization but it also have some bugs and problems.
First of all, you really had'nt tested last commit because it have fatal error with missing block update file what makes all scripts don't work.
What about working commits(i tested "holy mother of optimization" commit). So perfomance is good but the tps of most machines was decreased to 2 tps and interaction system does'nt work at all. It supposed to be fixed in "gravity fixed" commit which i did'nt tested so this problem might be fixed.
What about other bugs:
Infinite energy: if you connect energy storages in a way in image you will have infinite energy. The standart addon version does'nt have that problem. Also that error in log.
Solar panels destruction doesn't break invinsible blocks.
Also, machines running on two ticks bypass machines connected to
the wire network twice to compensate for the difference, and I'm not sure if this is the right solution to the problem.
infinite energy bug
Update:
I tested the last working commit and the interaction problem was'nt fixed there.
So i can talk about it.
The machine breaking now is much junker than it was. The number of failed hits was increased.
Since the tickrate of machines that do not perform active work has been reduced and the code that was supposed to increase the tickrate when opening the ui does not work well, the smoothness of energy charging nd some other things that are not related to active work is now lower. This is not critical in the case of standart mechanisms, but with mechanisms that have buttons, it works terribly and with a visible delay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants