Page 1 of 1

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

Posted: Tue Jul 09, 2019 3:56 pm
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.

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

Posted: Tue Jul 09, 2019 5:11 pm
by Rseding91
How come you're using the fire entity for what looks like a smoke effect instead of the smoke entity?

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

Posted: Tue Jul 09, 2019 6:17 pm
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.

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

Posted: Wed Jul 10, 2019 11:36 am
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?

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

Posted: Wed Jul 10, 2019 12:06 pm
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.

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

Posted: Wed Jul 10, 2019 3:12 pm
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.

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

Posted: Wed Jul 10, 2019 3:19 pm
by Ranakastrasz
Smoke has a variant that deals damage, or rather does something ontick, just look at poison capsules.

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

Posted: Wed Jul 10, 2019 4:13 pm
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.

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

Posted: Wed Jul 10, 2019 4:20 pm
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?

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

Posted: Wed Jul 10, 2019 5:40 pm
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".

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

Posted: Wed Jul 10, 2019 6:17 pm
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

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

Posted: Wed Jul 10, 2019 8:39 pm
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.

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

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

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

Posted: Wed Jul 10, 2019 8:59 pm
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?

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

Posted: Wed Jul 10, 2019 9:01 pm
by Bilka
Can you post the prototype?

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

Posted: Wed Jul 10, 2019 9:10 pm
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

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

Posted: Wed Jul 10, 2019 9:28 pm
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)}

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

Posted: Wed Jul 10, 2019 9:50 pm
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.

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

Posted: Thu Jul 11, 2019 12:15 pm
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.