Questions about assembler entity types

Place to get help with not working mods / modding interface.
Post Reply
FuryoftheStars
Smart Inserter
Smart Inserter
Posts: 2485
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Questions about assembler entity types

Post by FuryoftheStars »

I have two three different questions concerning assembler (crafting) entity types:
  1. Can they have animation variations? IE, when the entity runs this time, maybe it uses animation variation 1, and next time maybe it uses animation variation 2. (Edit: Oh, and I should mention, in my case, I'm working with working_visualisations to achieve the animations I want.)
  2. I've noticed that crafting_speed for them is read-only. Is there any other means of giving them bonuses/penalties to their crafting speed on a per entity basis at run-time? (I don't want to be spawning invisible, short range beacons.)
  3. According to the wiki, animation_speed at the default value of 1 is supposed to play an animation at a rate of 1 frame per tick (60 fps). In my testing, it seems to actually be at a rate of 1 frame per 2 ticks (30 fps). IE, if I have a 9 frame animation that I want to play over the course of 1 minute, I thought that setting the animation_speed to this:

    Code: Select all

    (1 / 3600) * 9
    would do it, but it instead plays the 9 frames over the course of 2 minutes (so I have to multiply my result by 2). Am I doing something wrong, is there a bug, or is the information on the wiki simply wrong?
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles

FuryoftheStars
Smart Inserter
Smart Inserter
Posts: 2485
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Re: Questions about assembler entity types

Post by FuryoftheStars »

No one have answers to these, or did everyone just get tired of me asking questions? :lol:
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles

Bilka
Factorio Staff
Factorio Staff
Posts: 3123
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Questions about assembler entity types

Post by Bilka »

FuryoftheStars wrote:
Fri May 06, 2022 4:04 am
According to the wiki, animation_speed at the default value of 1 is supposed to play an animation at a rate of 1 frame per tick (60 fps). In my testing, it seems to actually be at a rate of 1 frame per 2 ticks (30 fps). IE, if I have a 9 frame animation that I want to play over the course of 1 minute, I thought that setting the animation_speed to this:

Code: Select all

(1 / 3600) * 9
would do it, but it instead plays the 9 frames over the course of 2 minutes (so I have to multiply my result by 2). Am I doing something wrong, is there a bug, or is the information on the wiki simply wrong?[/list]
Unless you disabled it (https://wiki.factorio.com/Types/Working ... tant_speed), the animation speed is affected by the crafting speed of the machine.

As far as I know, the answers to 1 and 2 are no.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

FuryoftheStars
Smart Inserter
Smart Inserter
Posts: 2485
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Re: Questions about assembler entity types

Post by FuryoftheStars »

Bilka wrote:
Thu May 12, 2022 4:31 pm
FuryoftheStars wrote:
Fri May 06, 2022 4:04 am
According to the wiki, animation_speed at the default value of 1 is supposed to play an animation at a rate of 1 frame per tick (60 fps). In my testing, it seems to actually be at a rate of 1 frame per 2 ticks (30 fps). IE, if I have a 9 frame animation that I want to play over the course of 1 minute, I thought that setting the animation_speed to this:

Code: Select all

(1 / 3600) * 9
would do it, but it instead plays the 9 frames over the course of 2 minutes (so I have to multiply my result by 2). Am I doing something wrong, is there a bug, or is the information on the wiki simply wrong?[/list]
Unless you disabled it (https://wiki.factorio.com/Types/Working ... tant_speed), the animation speed is affected by the crafting speed of the machine.

As far as I know, the answers to 1 and 2 are no.
Thanks for the response, Bilka.

For the animation speed, I have not set constant_speed, and crafting_speed = 1. Is the animation speed (as cited) based on a crafting_speed other than 1?
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles

Bilka
Factorio Staff
Factorio Staff
Posts: 3123
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Questions about assembler entity types

Post by Bilka »

FuryoftheStars wrote:
Thu May 12, 2022 5:15 pm
Thanks for the response, Bilka.

For the animation speed, I have not set constant_speed, and crafting_speed = 1. Is the animation speed (as cited) based on a crafting_speed other than 1?
Okay well apparently there is a / 2 for the conversion of performance (basically crafting speed and power satisfaction) to frameReference for crafting machines. I don't know why that is there (the original / 2 is from 2014), so I guess you'll just have to mulitply by 2.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

FuryoftheStars
Smart Inserter
Smart Inserter
Posts: 2485
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Re: Questions about assembler entity types

Post by FuryoftheStars »

Bilka wrote:
Thu May 12, 2022 5:23 pm
Okay well apparently there is a / 2 for the conversion of performance (basically crafting speed and power satisfaction) to frameReference for crafting machines. I don't know why that is there (the original / 2 is from 2014), so I guess you'll just have to mulitply by 2.
Ok, thanks! So this means the information on the wiki is wrong then, and could conceivably be updated by someone based on this information?
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles

Bilka
Factorio Staff
Factorio Staff
Posts: 3123
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Questions about assembler entity types

Post by Bilka »

FuryoftheStars wrote:
Thu May 12, 2022 5:35 pm
Bilka wrote:
Thu May 12, 2022 5:23 pm
Okay well apparently there is a / 2 for the conversion of performance (basically crafting speed and power satisfaction) to frameReference for crafting machines. I don't know why that is there (the original / 2 is from 2014), so I guess you'll just have to mulitply by 2.
Ok, thanks! So this means the information on the wiki is wrong then, and could conceivably be updated by someone based on this information?
It's only wrong for the animations used by the crafting machines, which makes changing the wiki a bit awkward. So I've made the change: https://wiki.factorio.com/index.php?tit ... did=188886.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

FuryoftheStars
Smart Inserter
Smart Inserter
Posts: 2485
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Re: Questions about assembler entity types

Post by FuryoftheStars »

Thanks again, Bilka.

In my work on this mod, I have run into one more question concerning assembler type entities and animations (hopefully this is the last one). I suspect the answer to this is "no", but I was wondering if there was a method to change where in its animation of working_visualisations it is based on crafting_progress in order to keep them synced?

Explanation:
In my case, by default, the assemblers (called "planters") only have a 1 frame animation (the base entity, an empty planter) and the item they are "crafting" (a sapling tree) is a separate entity that is spawned on top of the planter. This allows the sapling to have variations in sprite and color, as well as being affected by pollution (so they can potentially die :twisted: ). However, this requires having all of the planters in a loop that has associated UPS overhead (though I've been making very good progress in reducing that, by at least x4.5+ so far). The recipe the planters use is given a craft time of max sapling grow time + a buffer for the update loop, so the update loop for the saplings takes care of removing the sapling and resetting the planter, while the planter's loop takes care of creating the sapling once its crafting_progress is > 0.

There's a startup option the player can select that will change this. It'll remove all of the saplings that are in planters, and give the planters a working_visualisations animation with the animation speed set to allow all of the frames to play in the same time frame as the recipe crafting time (which is also changed to the average of the min & max grow times of the sapling). In this way, I don't need to loop the planters, and the only saplings the mod needs to worry about are ones planted manually outside of planters, giving massive UPS savings at the trade off of all the saplings in the planters being identical (seems we can't have variations), among a few other things.

When this happens, though, any planters that were already crafting become "out of sync" with the working_visualisations (it's supposed to be a 9 frame animation of the sapling growing from a planted seed to an (almost) adult tree, so what I'm seeing, for example, is that it's showing the planted seed frame at a crafting progress percent other than 0 to 0.111, often to extremes like around 0.5 or even 0.9) until they stop for some reason (lack of input or full output). I wonder if this is in part because I'm changing the recipe's craft time? So far, the only way I can think to fix this is to reset the crafting_progress to 0 (and refund the input ingredient), then disable the planter for a tick before re-enabling (not ideal as it'll add temporary overhead and then suddenly all of the planters will be in perfect sync, not to mention the loss of progress), or to retool it so the recipe craft time doesn't change (though I don't know if that'll work, and that'll have it's own complications regarding growing time one way or the other).
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles

FuryoftheStars
Smart Inserter
Smart Inserter
Posts: 2485
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Re: Questions about assembler entity types

Post by FuryoftheStars »

FuryoftheStars wrote:
Mon May 16, 2022 2:23 pm
In my work on this mod, I have run into one more question concerning assembler type entities and animations (hopefully this is the last one). I suspect the answer to this is "no", but I was wondering if there was a method to change where in its animation of working_visualisations it is based on crafting_progress in order to keep them synced?
Ok, well it looks like this is a definite "no". What testing I've done so far I haven't been able to find a way to force them to reset to the first frame at crafting_progress = 0. In fact, it looks to me like when you have a bunch of them out there or near each other, the game is purposely off-setting which frame they are on so they're not all at the same point in the animation.
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles

Post Reply

Return to “Modding help”