Galacticraft icon indicating copy to clipboard operation
Galacticraft copied to clipboard

Arc Lamps ticking higher than usual

Open jacoballen1 opened this issue 4 years ago • 2 comments

Minecraft version: 1.12.2 Galacticraft version: 4.0.2.224

Single player (SSP), Multiplayer (SMP), or SSP opened to LAN (LAN)? SMP

  • Sponge

Any Galacticraft add-ons installed? please list all GalacticraftPlanets-1.12.2-4.0.2.224

Please provide screenshots / crash report / log / full modlist as needed

Image: https://imgur.com/gallery/rpjWpLX

As shown in the image above, each of the Arc Lamps is ticking at 100ms each, while this may not be an issue with SSP, this is a bigger issue in SMP with multiple bases uses multiple arc lamps.

jacoballen1 avatar Mar 13 '20 16:03 jacoballen1

100 microseconds, not milliseconds.

Please provide a link to the tool you are using for the measurements for this test. I want to understand whether this is a "worst case" test, or an average over several ticks.

Please also show a comparison with other blocks which can be activated / de-activated using redstone, including a vanilla lamp.

Normally Arc Lamp ticks should be very fast, the only thing they do every tick is to see if they are receiving a redstone signal. (Redstone checking is not the fastest thing in Minecraft, that's due to vanilla code, but we re-wrote and optimised it as much as we could.)

1 tick out of 100, an Arc Lamp will do a slower check to update the light levels in the volume of space it is illuminating, which is potentially up to about 5000 blocks - this is similar to the vanilla lighting engine for torches, but over a larger volume (because the lamp is brighter) and again we massively optimised the vanilla code. It is still 'expensive' in computational terms. It could easily be taking 100 microseconds per lamp.

We could randomise the 1 / 100 tick checking. Right now it is doing the slow check regularly every 100th tick, so if you have a lot of Arc Lamps in the same chunk (like in your screenshot), probably they will all reach tick 100, tick 200 etc at the same time. I am wondering if the timing tool you are using happens to be showing the timings for tick 0 or tick 100?

radfast avatar Mar 30 '20 23:03 radfast

link to the tool you are using for the measurements for this test

Looks like LagGoogles mod

QuantumStatement avatar May 03 '20 22:05 QuantumStatement