[1.1.42] energy_glow_animation flickers badly

Post Reply
User avatar
bolderbrush10
Burner Inserter
Burner Inserter
Posts: 12
Joined: Thu Oct 14, 2021 4:12 am
Contact:

[1.1.42] energy_glow_animation flickers badly

Post by bolderbrush10 »

This has been ongoing for at least several versions, but I finally made a demo to showcase what I'm experiencing.

Animations associated with a turret's energy_glow_animation flicker very badly.
It's visible on the default laser-turret, but modded turrets show the flicker as well and make it very obvious.
Changing the cooldown / duration on the laser attack seems to have no effect.
I've also tried experimenting with many different flags & draw_as___ options to no effect.

It seems possible that the energy glow animation is z-fighting when being redrawn every frame, like in these issues:
viewtopic.php?p=421477
viewtopic.php?f=7&t=91764
viewtopic.php?p=522051

I've attached a brief clip, a mod using my intended graphics, and a save demoing the laser turret, several draw_as____ versions.
(It looks worse in game than the 30fps clip can show)
energyGlowFlicker.mp4
(437.81 KiB) Downloaded 148 times
Attachments
energy-flicker-demo.zip
(1009.42 KiB) Downloaded 120 times
EnergyGlowFlicker_1.0.0.zip
(1.79 MiB) Downloaded 131 times

User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 2244
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [1.1.42] energy_glow_animation flickers badly

Post by boskid »

energy_glow_animation when being rendered uses a dynamically computed tint in form of Color(a, a, a, a) where the value of "a" changes from 0.8 to 1.0. Exact value changes from tick to tick because it is based on certain hash function that uses turret position and entity tick.

If you want i can add a turret prototype value, something like "energy_glow_animation_flicker_strength" with a default value of 0.2 (equal to the current value). Would that be useful for your use case?

Other than that it does not look like a bug because it is intentionally implemented in a way that it flickers heavily (usage of hash function and explicitly given formula for the tint). I may move this to modding interface requests

User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 2244
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [1.1.42] energy_glow_animation flickers badly

Post by boskid »

Ok i am just considering this a modding interface request (moving out of Bug reports).

It is now implemented for 1.1.43:
Changelog for 1.1.43 wrote:Added TurretPrototype::energy_glow_animation_flicker_strength.

User avatar
bolderbrush10
Burner Inserter
Burner Inserter
Posts: 12
Joined: Thu Oct 14, 2021 4:12 am
Contact:

Re: [1.1.42] energy_glow_animation flickers badly

Post by bolderbrush10 »

Oh that's awesome, thank you!

Post Reply

Return to “Implemented mod requests”