Improve performance with many enemies

This commit is contained in:
Simon Brodtmann 2026-01-22 00:07:13 +01:00
parent 745fd090b5
commit 0fcefd036c

View file

@ -290,7 +290,7 @@ function make_wriggler(prefix, scale, health, damage, tints, factoriopedia_simul
},
dying_speed = 0.015 / scale,
decay_frame_transition_duration = 150,
time_before_removed = 1 * 60 * 60, -- 1 minute
time_before_removed = 30 * 60, -- 30 seconds
use_decay_layer = true,
direction_shuffle = { { 1, 2, 3, 16 }, { 4, 5, 6, 7 }, { 8, 9, 10, 11 }, { 12, 13, 14, 15 } },
@ -338,7 +338,7 @@ function make_wriggler(prefix, scale, health, damage, tints, factoriopedia_simul
target_effects = {
{
type = "create-particle",
repeat_count = 13,
repeat_count = 2,
repeat_count_deviation = 1,
probability = 1,
affects_target = false,
@ -359,33 +359,6 @@ function make_wriggler(prefix, scale, health, damage, tints, factoriopedia_simul
tail_width = 3,
rotate_offsets = false
},
{
type = "create-particle",
repeat_count = 12,
repeat_count_deviation = 3,
probability = 1,
affects_target = false,
show_in_tooltip = false,
particle_name = "lignumis-blood-particle-small",
offsets = {
{ 0, -0.4 },
{ 0, 0.5 },
{ 0, 0.6 }
},
offset_deviation = { { -0.25, -0.25 }, { 0.25, 0.25 } },
initial_height = 0.1,
initial_height_deviation = 0.1,
initial_vertical_speed = 0.055,
initial_vertical_speed_deviation = 0.075,
speed_from_center = 0.03,
speed_from_center_deviation = 0.03,
frame_speed = 1,
frame_speed_deviation = 0,
tail_length = 52,
tail_length_deviation = 25,
tail_width = 3,
rotate_offsets = false
},
{
type = "play-sound",
sound = base_sounds.medium_gore
@ -396,19 +369,9 @@ function make_wriggler(prefix, scale, health, damage, tints, factoriopedia_simul
}
data:extend {
--wriggler,
wriggler_stable,
wriggler_corpse,
wrigger_explosion,
make_particle
{
name = prefix .. "wriggler-skin-particle",
life_time = 300,
pictures = particle_animations.get_pentpod_skin_particles_small({ scale = 1 * scale, tint = lerp_color(tint_mask, { 255, 255, 255, 255 }, 0.7) }),
shadows = particle_animations.get_pentpod_skin_particles_small({ scale = 1 * scale, tint = shadowtint(), shift = util.by_pixel(1, 0) }),
ended_in_water_trigger_effect = default_ended_in_water_trigger_effect(),
render_layer_when_on_ground = "lower-object-above-shadow"
},
wrigger_explosion
}
end