Page 1 of 1

[1.1.65] Max flame count doesn't behave right for a high value

Posted: Tue Aug 23, 2022 4:20 pm
by Muppet9010
If you create a fire with the max initial_ground_flame_count of 255, the fire doesn't burn like the a high fire count should. This can be seen by creating a fire at 255 and at 254 (1 less). The 254 fire spreads out from the center for a bit and will catch any near by trees on fire. But the 255 value fire just burns briefly in its center and then goes out. It also won't set any trees on fire
start.PNG
start.PNG (530.78 KiB) Viewed 1188 times
after few seconds.PNG
after few seconds.PNG (427.75 KiB) Viewed 1188 times

Code: Select all

/c game.player.surface.create_entity({name = "fire-flame", position = {0,0}, initial_ground_flame_count = 255}) game.player.surface.create_entity({name = "fire-flame", position = {10,0}, initial_ground_flame_count = 254})

Re: [1.1.65] Max flame count doesn't behave right for a high value

Posted: Thu Sep 08, 2022 4:18 am
by boskid
This behavior is because value of 255 is internally used as a special marker when creating a fire flame saying "use initial_flame_count value from prototype instead" which for a fire-flame is 0. Value of 0 is then interpreted as "use particle offset count / 5" which is equal to 6 or 7 based on variation selected.

Usage of such high values is pointless because the flame count is internally capped anyway. There are 15 hardcoded particle offset variation patterns, largest one (index 5) has 35 offsets defined which means usage of a value higher than 35 has no observable behavior differences other than the value of 255. I am not considering this to be a bug.