Fighting puzzle lag

Mat has a suggestion on how to reduce the lag in the game that many players experience:

It would be useful to temporary disable the the eterna energy model via a hotkey or button so we can add our bases to the puzzle at the start without eterna running slow on puzzles, because of all the calculations. It would be useful to delay energy calculation. Then hide the estimate button while energy model is turned off, as the energy estimate should be turned off too.

There would have to be a symbol or message letting the player know that the model is off. It could be as simple as a red cross over the energy calculation box. Plus a small message posted somewhere would be good, saying Notice energy model is turned off.

As long as it energy calculation is turned of, one won’t know if ones design solves with in the model or if there are misfolds. Also new players won’t get alerted that they have non standard pairs. But it will help fight lag.

A few available ways of avoiding the lag:
You might also have noticed when printing in the AU’s at the start that the energy doesn’t update until you release the mouse button. The energy model is suspended while the mouse button is clicked down.

Distribute the boost first, because energy model isn’t calculating for single bases. This makes sure that what gets added later, is often already stable, meaning it will take less time for calculation, when it do gets made.

Also there is the option of turning on Low performance mode in the gears. No bubbles, less lag.


Mat and I discussed the idea with John in chat. I put up the chat log to share and preserve the idea John got on how to make it work well.

jnicol: its a good idea [3:11 PM]
jnicol: how about , pressing a button, which will delay the calculation for 5 seconds, if you paint a base, then the 5 seconds will restart [3:12 PM]
jnicol: that way you wont have to remember to turn the energy calculations back on [3:12 PM]
mat747: is that 5 seconds from the last added base ? [3:15 PM]
Eli Fisker: John, I like your idea. However I’m thinking that one will have to press that button a lot. [3:17 PM]
Eli Fisker: But a variation would be neat like a 1 minute delay [3:17 PM]
Eli Fisker: giving one time to fill out the puzzle [3:17 PM]
Eli Fisker: This is the period where the lab is the biggest problem [3:19 PM]
jnicol: I just felt that if someone delays more than 5 seconds (resets after each change) then they would want to see the energy updated. [3:19 PM]
Eli Fisker: For filling out the puzzle the energy isn’t really needed [3:20 PM]
jnicol: and that suspend, would still be in effect, it restarts the 5 second delay when you hit the button again [3:19 PM]
Eli Fisker: It is only when the puzzle is filled, that it is relevant with energy between target and native [3:20 PM]
Eli Fisker: And energy model is only thought to be disabled for those who specific calls for it [3:20 PM]
Eli Fisker: at beginning at puzzle solving [3:21 PM]
jnicol: so, 2 modes, 1 to instantly calculate, 2 to delay 5 seconds before calculating [3:20 PM]
Eli Fisker: I like the instant calculate [3:21 PM]
Eli Fisker: but 5 second is too short delay [3:21 PM]
jnicol: and clicking the button changes the mode [3:21 PM]
Eli Fisker: when I fill out a puzzle [3:21 PM]
Eli Fisker: I like to fill out the whole thing [3:21 PM]
jnicol: and clicking the button changes the mode [3:21 PM]
Eli Fisker: when I fill out a puzzle [3:21 PM]
Eli Fisker: I like to fill out the whole thing [3:21 PM]
jnicol: we can test, perhaps 10 would be better? [3:21 PM]
Eli Fisker: before energy calculation kicks in [3:21 PM]
Eli Fisker: Let me check if i understand [3:22 PM]
jnicol: eli, the time resets to 5 seconds after each change [3:22 PM]
Eli Fisker: it will calculate every 10 seconds [3:22 PM]
jnicol: or 10 if you wish [3:22 PM]
mat747: john - yes a test beta would be good [3:22 PM]
jnicol: but I think 5 should work [3:22 PM]
Eli Fisker: but it will still be delayed, so I don’t have to reset [3:22 PM]
jnicol: let me give an example [3:22 PM]
Eli Fisker: yes, a test will be good [3:23 PM]
jnicol: we have a big darth vader puzzle with over 1000 bases :slight_smile: [3:23 PM]
Eli Fisker: :slight_smile: [3:23 PM]
jnicol: click the delay 5 second before calculation button [3:23 PM]
jnicol: it will not turn off [3:24 PM]
jnicol: when you change the 1st base, the timer starts [3:24 PM]
jnicol: after 3 seconds you change the 2nd base, the timer restarts at 5 seconds, no calcualtion are done [3:24 PM]
Eli Fisker: ah, so it is sort as long as you are working with filling out [3:25 PM]
Eli Fisker: then calculation is off [3:25 PM]
jnicol: change the 3rd base 4 seconds after changing the 2nd base, restart the timer again [3:25 PM]
Eli Fisker: moving ahead of you [3:25 PM]
jnicol: finally wait 5 seconds after changing the 3rd base and the calculation will be performed [3:26 PM]
Eli Fisker: I think that could work [3:26 PM]
jnicol: then change the 4th base and the 5 second timer restarts [3:26 PM]
jnicol: only get back to the instant mode by clicking the instant/delay option button again [3:27 PM]
Eli Fisker: Good [3:27 PM]
Eli Fisker: I was concerned about having to push that button all the time [3:27 PM]
Eli Fisker: But I see your idea will work [3:27 PM]
Eli Fisker: Perhaps if energy calculation detects that the whole puzzle is filled out, then auto turn of of the delay [3:28 PM]
jnicol: and like mat said, i can put it in dev and we can test for the best time delay [3:28 PM]
Eli Fisker: Because it is mostly only needed when filling out of a puzzle, not when flipping bases [3:28 PM]
Eli Fisker: Great idea [3:28 PM]
mat747: john - thanks [3:28 PM]
Eli Fisker: Big thx [3:28 PM]
jnicol: that being said, I am busy learning the backend scripts for collecting lab info and need to work on a script to collect the pilot labs [3:29 PM]

On my machine, the lag is almost entirely due to the saving of each update in a flash cookie, not the calculation. (I reset the flash storage to 0 when things slow down too much, at the cost of loosing any partially completed puzzles.) I would think that moving the flash cookie updating to a worker thread would make the biggest impact on any machine that has multiple cores.

1 Like

Omei addressed the thought rolling around in my head. “Distribute the boost first, because energy model isn’t calculating for single bases” - I used to think this made a difference in lag, but thousands of puzzles later I know it doesn’t make any difference whether the boosts are made first or last. If there was a way to continue the lag-free base/pair painting operation at will, that would be great. But is it really the calculation that is causing the lag?

Clearing several hundred or thousand flash cookies makes a marked speed difference during play

I really like what you and Omei are mentioning. If flash cookies is the greatest cause of lag, then it would be great to have an easy way to clear them. Like from for ingame, so we don’t have to go to outside programs to fix this problem.

I have sometime done this when the puzzle maker wasn’t working. But if others had not shared how to do it, I wouldn’t know how to.