Ability to disable "some weird hardcoded movement of the explosion" posessed by fire entities

Things that already exist in the current mod API
Post Reply
User avatar
Reika
Filter Inserter
Filter Inserter
Posts: 582
Joined: Tue May 19, 2015 1:56 am
Contact:

Ability to disable "some weird hardcoded movement of the explosion" posessed by fire entities

Post by Reika »

Fire-type entities appear to have, in Klonan's words, "some weird hardcoded movement of the explosion". That is, the fire always "rises up out of the ground", mushroom-cloud style, which for entities which are not supposed to represent fire looks very silly.

https://i.imgur.com/sJYlwX6.mp4

Can we get some property in the prototype to disable that, or even better, choose some sort of "start animation" from things like fade in and the current one? That is, a string property called something like "start_animation" with values like "rise-from-ground", "fade-in", "none", and whatever else you think is worth doing.
Image

Rseding91
Factorio Staff
Factorio Staff
Posts: 13198
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Ability to disable "some weird hardcoded movement of the explosion" posessed by fire entities

Post by Rseding91 »

How come you're using the fire entity for what looks like a smoke effect instead of the smoke entity?
If you want to get ahold of me I'm almost always on Discord.

User avatar
Reika
Filter Inserter
Filter Inserter
Posts: 582
Joined: Tue May 19, 2015 1:56 am
Contact:

Re: Ability to disable "some weird hardcoded movement of the explosion" posessed by fire entities

Post by Reika »

Rseding91 wrote:
Tue Jul 09, 2019 5:11 pm
How come you're using the fire entity for what looks like a smoke effect instead of the smoke entity?
Fire felt more natural with how it is created, but the smoke effect has a forced animation too, of the "grow out from the center" variety.
Image

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

Re: Ability to disable "some weird hardcoded movement of the explosion" posessed by fire entities

Post by Bilka »

Reika wrote:
Tue Jul 09, 2019 6:17 pm
... the smoke effect has a forced animation too, of the "grow out from the center" variety.
No, it does not. This smoke doesn't move at all:

Code: Select all

data:extend{{
  type="smoke-with-trigger",
  name="test",
  affected_by_wind = false,
  movement_slow_down_factor = 0,
  color = {r=1,g=1,b=1},
  animation= {
    filename = "__base__/graphics/entity/lab/lab.png",
    width = 98,
    height = 87,
    frame_count = 33,
    line_length = 11,
    animation_speed = 1 / 3,
    shift = util.by_pixel(0, 1.5),
    hr_version =
    {
      filename = "__base__/graphics/entity/lab/hr-lab.png",
      width = 194,
      height = 174,
      frame_count = 33,
      line_length = 11,
      animation_speed = 1 / 3,
      shift = util.by_pixel(0, 1.5),
      scale = 0.5
    }
  }
}}
Considering this, do you still need your original request?
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

posila
Factorio Staff
Factorio Staff
Posts: 5201
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: Ability to disable "some weird hardcoded movement of the explosion" posessed by fire entities

Post by posila »

There is fade_in_duration on fire prototype already. Setting it to 0 will make it not rise.

If you don't need it to deal damage, or to use any special behavior of the fire entity (like it's unique "rising flames" animation, lol), using trival smoke will be performance win even if you need to create several smokes to achieve the same visual effect.

User avatar
Reika
Filter Inserter
Filter Inserter
Posts: 582
Joined: Tue May 19, 2015 1:56 am
Contact:

Re: Ability to disable "some weird hardcoded movement of the explosion" posessed by fire entities

Post by Reika »

posila wrote:
Wed Jul 10, 2019 12:06 pm
There is fade_in_duration on fire prototype already. Setting it to 0 will make it not rise.
That was the first thing I tried. It still rises.
posila wrote:
Wed Jul 10, 2019 12:06 pm
If you don't need it to deal damage, or to use any special behavior of the fire entity (like it's unique "rising flames" animation, lol), using trival smoke will be performance win even if you need to create several smokes to achieve the same visual effect.
I do need it to do damage; in fact, that is its primary purpose.
Image

User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 2124
Joined: Thu Jun 12, 2014 3:05 am
Contact:

Re: Ability to disable "some weird hardcoded movement of the explosion" posessed by fire entities

Post by Ranakastrasz »

Smoke has a variant that deals damage, or rather does something ontick, just look at poison capsules.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16

User avatar
Reika
Filter Inserter
Filter Inserter
Posts: 582
Joined: Tue May 19, 2015 1:56 am
Contact:

Re: Ability to disable "some weird hardcoded movement of the explosion" posessed by fire entities

Post by Reika »

Ranakastrasz wrote:
Wed Jul 10, 2019 3:19 pm
Smoke has a variant that deals damage, or rather does something ontick, just look at poison capsules.
Yes, that is the smoke-with-trigger being discussed.
Image

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

Re: Ability to disable "some weird hardcoded movement of the explosion" posessed by fire entities

Post by Bilka »

Reika wrote:
Wed Jul 10, 2019 4:13 pm
Ranakastrasz wrote:
Wed Jul 10, 2019 3:19 pm
Smoke has a variant that deals damage, or rather does something ontick, just look at poison capsules.
Yes, that is the smoke-with-trigger being discussed.
Okay, so do you still need this request if smoke with trigger already works for you?
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

User avatar
Reika
Filter Inserter
Filter Inserter
Posts: 582
Joined: Tue May 19, 2015 1:56 am
Contact:

Re: Ability to disable "some weird hardcoded movement of the explosion" posessed by fire entities

Post by Reika »

Bilka wrote:
Wed Jul 10, 2019 4:20 pm
Reika wrote:
Wed Jul 10, 2019 4:13 pm
Ranakastrasz wrote:
Wed Jul 10, 2019 3:19 pm
Smoke has a variant that deals damage, or rather does something ontick, just look at poison capsules.
Yes, that is the smoke-with-trigger being discussed.
Okay, so do you still need this request if smoke with trigger already works for you?
I have explicitly stated that smoke-with-trigger is not working fully either. The smoke both grows from center and often has some initial lateral motion (which eventually stops). I need something with, ideally, a fade-in, but at least a completely static "pop in".
Image

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

Re: Ability to disable "some weird hardcoded movement of the explosion" posessed by fire entities

Post by Bilka »

Reika wrote:
Wed Jul 10, 2019 5:40 pm
I have explicitly stated that smoke-with-trigger is not working fully either. The smoke both grows from center and often has some initial lateral motion (which eventually stops). I need something with, ideally, a fade-in, but at least a completely static "pop in".
I have explicitly stated that it does not do that and provided an example prototype. Since you seem to not have tried that prototype, here is a video of it working:



Fade in can be controlled with this property: https://wiki.factorio.com/Prototype/Smo ... n_duration
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

User avatar
Reika
Filter Inserter
Filter Inserter
Posts: 582
Joined: Tue May 19, 2015 1:56 am
Contact:

Re: Ability to disable "some weird hardcoded movement of the explosion" posessed by fire entities

Post by Reika »

Bilka wrote:
Wed Jul 10, 2019 6:17 pm
Reika wrote:
Wed Jul 10, 2019 5:40 pm
I have explicitly stated that smoke-with-trigger is not working fully either. The smoke both grows from center and often has some initial lateral motion (which eventually stops). I need something with, ideally, a fade-in, but at least a completely static "pop in".
I have explicitly stated that it does not do that and provided an example prototype. Since you seem to not have tried that prototype, here is a video of it working:



Fade in can be controlled with this property: https://wiki.factorio.com/Prototype/Smo ... n_duration
I did try yours in that mine is functionally identical to that, just with added "action" parameters and different lifetime, name, sprites. The only noticable difference is that mine enables "cyclic" whereas yours does not, but that sounds completely unrelated.
Image

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

Re: Ability to disable "some weird hardcoded movement of the explosion" posessed by fire entities

Post by Bilka »

Okay, if it's functionally the same all is well and the issue is solved, that's great!
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

User avatar
Reika
Filter Inserter
Filter Inserter
Posts: 582
Joined: Tue May 19, 2015 1:56 am
Contact:

Re: Ability to disable "some weird hardcoded movement of the explosion" posessed by fire entities

Post by Reika »

Bilka wrote:
Wed Jul 10, 2019 8:59 pm
Okay, if it's functionally the same all is well and the issue is solved, that's great!

I have said TWICE now that this is not the case.


Here, I have a video too:


https://i.imgur.com/ULlp4gq.mp4


See how they always grow out from the center and some (like the second one in the GIF) start with some small movement (in this case downwards) and then abruptly stop?
Image

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

Re: Ability to disable "some weird hardcoded movement of the explosion" posessed by fire entities

Post by Bilka »

Can you post the prototype?
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

User avatar
Reika
Filter Inserter
Filter Inserter
Posts: 582
Joined: Tue May 19, 2015 1:56 am
Contact:

Re: Ability to disable "some weird hardcoded movement of the explosion" posessed by fire entities

Post by Reika »

Bilka wrote:
Wed Jul 10, 2019 9:01 pm
Can you post the prototype?
Here it is:

Code: Select all

local function createCloudVariant(name, size, duration, damage, speed)
	local ret = {
    type = "smoke-with-trigger",
    name = "fallout-" .. name,
    flags = {"placeable-off-grid", "not-on-map"},
    show_when_smoke_off = true,
    animation =
    {
		layers = 
		{
			{
			  filename = "__EndgameCombat__/graphics/entity/radiation/radiation_final_tinted.png",
			  line_length = 16,
			  width = 256,
			  height = 181,
			  frame_count = 128,
			  axially_symmetrical = false,
			  direction_count = 1,
			  blend_mode = "additive",
			  animation_speed = 0.5*speed,
			  scale = size/5
			  --shift = { -0.0390625, -0.90625 }
			},
		}
    },
    slow_down_factor = 0,
    affected_by_wind = false,
    cyclic = true,
    duration = math.ceil(60 * duration),
	fade_in_duration = 60,
    fade_away_duration = math.ceil((duration/3) * 60),
    color = { r = alpha, g = alpha, b = alpha },
	light = {intensity = 0.3, size = 20, color={r=0, g=1, b=0}},
    action =
    {
      type = "direct",
      action_delivery =
      {
        type = "instant",
        target_effects =
        {
          type = "nested-result",
          action =
          {
            type = "area",
            radius = size*0.7,
            --entity_flags = {"placeable-player", "player-creation", "player", },
            action_delivery =
            {
              type = "instant",
              target_effects =
			  {
				  {
					type = "damage",
					damage = { amount = damage, type = "radiation"}
				  }
			  }
            }
          }
        }
      }
    },
    action_cooldown = 5
  }
  return ret
end
Image

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

Re: Ability to disable "some weird hardcoded movement of the explosion" posessed by fire entities

Post by Bilka »

Your prototype doesnt have movement_slow_down_factor set to 0, set that to stop the movement, as seen in the example prototype. Your prototype does not display the "expanding" that you describe.

Here are the changes I made which make it work perfectly (mostly just getting it to load with vanilla + the slowdown thing):

Image

Here is what it looks like with the above changes:

Here is the code with those changes:

Code: Select all

local function createCloudVariant(name, size, duration, damage, speed)
	local ret = {
    type = "smoke-with-trigger",
    name = "fallout-" .. name,
    flags = {"placeable-off-grid", "not-on-map"},
    show_when_smoke_off = true,
    animation= {
      filename = "__base__/graphics/entity/lab/lab.png",
      width = 98,
      height = 87,
      frame_count = 33,
      line_length = 11,
      animation_speed = 1 / 3,
      shift = util.by_pixel(0, 1.5),
      hr_version =
      {
        filename = "__base__/graphics/entity/lab/hr-lab.png",
        width = 194,
        height = 174,
        frame_count = 33,
        line_length = 11,
        animation_speed = 1 / 3,
        shift = util.by_pixel(0, 1.5),
        scale = 0.5
      }
    },
    movement_slow_down_factor = 0,
    affected_by_wind = false,
    cyclic = true,
    duration = math.ceil(60 * duration),
	fade_in_duration = 60,
    fade_away_duration = math.ceil((duration/3) * 60),
    color = { r = alpha, g = alpha, b = alpha },
	light = {intensity = 0.3, size = 20, color={r=0, g=1, b=0}},
    action =
    {
      type = "direct",
      action_delivery =
      {
        type = "instant",
        target_effects =
        {
          type = "nested-result",
          action =
          {
            type = "area",
            radius = size*0.7,
            --entity_flags = {"placeable-player", "player-creation", "player", },
            action_delivery =
            {
              type = "instant",
              target_effects =
			  {
				  {
					type = "damage",
					damage = { amount = damage, type = "poison"}
				  }
			  }
            }
          }
        }
      }
    },
    action_cooldown = 5
  }
  return ret
end

data:extend{createCloudVariant(1,5,4,3,9)}
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

User avatar
Reika
Filter Inserter
Filter Inserter
Posts: 582
Joined: Tue May 19, 2015 1:56 am
Contact:

Re: Ability to disable "some weird hardcoded movement of the explosion" posessed by fire entities

Post by Reika »

Bilka wrote:
Wed Jul 10, 2019 9:28 pm
Your prototype doesnt have movement_slow_down_factor set to 0, set that to stop the movement, as seen in the example prototype. Your prototype does not display the "expanding" that you describe.

Here are the changes I made which make it work perfectly (mostly just getting it to load with vanilla + the slowdown thing):

Image

Here is what it looks like with the above changes:

Here is the code with those changes:

Code: Select all

local function createCloudVariant(name, size, duration, damage, speed)
	local ret = {
    type = "smoke-with-trigger",
    name = "fallout-" .. name,
    flags = {"placeable-off-grid", "not-on-map"},
    show_when_smoke_off = true,
    animation= {
      filename = "__base__/graphics/entity/lab/lab.png",
      width = 98,
      height = 87,
      frame_count = 33,
      line_length = 11,
      animation_speed = 1 / 3,
      shift = util.by_pixel(0, 1.5),
      hr_version =
      {
        filename = "__base__/graphics/entity/lab/hr-lab.png",
        width = 194,
        height = 174,
        frame_count = 33,
        line_length = 11,
        animation_speed = 1 / 3,
        shift = util.by_pixel(0, 1.5),
        scale = 0.5
      }
    },
    movement_slow_down_factor = 0,
    affected_by_wind = false,
    cyclic = true,
    duration = math.ceil(60 * duration),
	fade_in_duration = 60,
    fade_away_duration = math.ceil((duration/3) * 60),
    color = { r = alpha, g = alpha, b = alpha },
	light = {intensity = 0.3, size = 20, color={r=0, g=1, b=0}},
    action =
    {
      type = "direct",
      action_delivery =
      {
        type = "instant",
        target_effects =
        {
          type = "nested-result",
          action =
          {
            type = "area",
            radius = size*0.7,
            --entity_flags = {"placeable-player", "player-creation", "player", },
            action_delivery =
            {
              type = "instant",
              target_effects =
			  {
				  {
					type = "damage",
					damage = { amount = damage, type = "poison"}
				  }
			  }
            }
          }
        }
      }
    },
    action_cooldown = 5
  }
  return ret
end

data:extend{createCloudVariant(1,5,4,3,9)}
Adding the movement_slowdown_factor parameter fixes the initial movement and/ the expansion. Either something is off in my filesystem or these parameters interact in an unexpected way.
Image

posila
Factorio Staff
Factorio Staff
Posts: 5201
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: Ability to disable "some weird hardcoded movement of the explosion" posessed by fire entities

Post by posila »

Reika wrote:
Wed Jul 10, 2019 3:12 pm
posila wrote:
Wed Jul 10, 2019 12:06 pm
There is fade_in_duration on fire prototype already. Setting it to 0 will make it not rise.
That was the first thing I tried. It still rises.
It doesn't when I try it.

Post Reply

Return to “Already exists”