Page 1 of 1

[1.0.0] idle_animation does not draw when assembling machine is idle

Posted: Mon Sep 14, 2020 3:44 am
by kirazy
I have a modded entity of type assembling-machine, with definitions for animation and idle_animation. It originally used layers and had working_visualisations defined as well, but for the sake of trying to get the idle_animation to work, I have stripped it down to its most basic:

Code: Select all

entity.animation = {
    filename = reskins.angels.directory.."/graphics/entity/smelting/strand-casting-machine/strand-casting-machine-base.png",
    priority = "high",
    width = 167,
    height = 197,
    line_length = 6,
    frame_count = 24,
    animation_speed = 0.5,
    shift = util.by_pixel(0, -16.5),
    hr_version = {
        filename = reskins.angels.directory.."/graphics/entity/smelting/strand-casting-machine/hr-strand-casting-machine-base.png",
        priority = "high",
        width = 329,
        height = 392,
        line_length = 6,
        frame_count = 24,
        animation_speed = 0.5,
        shift = util.by_pixel(0, -16.5),
        scale = 0.5,
    }
}

entity.idle_animation = {
    filename = reskins.angels.directory.."/graphics/entity/smelting/strand-casting-machine/strand-casting-machine-idle-base.png",
    priority = "high",
    width = 167,
    height = 197,
    repeat_count = 24,
    animation_speed = 0.5,
    shift = util.by_pixel(0, -16.5),
    hr_version = {
        filename = reskins.angels.directory.."/graphics/entity/smelting/strand-casting-machine/hr-strand-casting-machine-idle-base.png",
        priority = "high",
        width = 329,
        height = 392,
        repeat_count = 24,
        animation_speed = 0.5,
        shift = util.by_pixel(0, -16.5),
        scale = 0.5,
    }
}
The expected result here is that when the machine is idle, the hr-strand-casting-machine-idle-base.png is drawn. However, the actual result is that I still have the hr-strand-casting-machine-base.png.

Based on my understanding of how this is coded and works, it should work the way I've done it. It shows on the property inspector in game, and I can see the image that should show up there, but it doesn't.

Which would suggest something is bugged?

Unless I'm missing something.

Edit: I've included the mods that aren't yet on the portal, and save that will pull the relevant mods.

Re: [1.0.0] idle_animation does not draw when assembling machine is idle

Posted: Tue Sep 15, 2020 10:33 am
by posila
The problem is the assembler has fluidboxes on it, so it doesn't go to sleep, and therefore the rendering doesn't consider the machine to be "idle".
It is definitelly an issue, I'll think about performance implications of making more expensive checks for being idle in rendering.

Re: [1.0.0] idle_animation does not draw when assembling machine is idle

Posted: Tue Sep 15, 2020 4:24 pm
by kirazy
Possible to use the same logic that determines whether working_visualisations is drawn? Unless you set always_draw = true with those, they do not draw on the machine in question when it is idle, so there's at least something detecting it's idle correctly.

Edit: I've moved everything into working_visualisations as a workaround: