[0.18.24] Sprites save file size leak

Bugs that are actually features.
Post Reply
PyroFire
Filter Inserter
Filter Inserter
Posts: 356
Joined: Tue Mar 08, 2016 8:18 am
Contact:

[0.18.24] Sprites save file size leak

Post by PyroFire »

*this is just the dead data in the global table heh... Seemed like a lot to me*

Though i did manage to freeze factorio but running this command twice in quick succession? :D!

Code: Select all

/c global.sprites=global.sprites or {} for x,tbl in pairs(global.sprites)do for y,sp in pairs(tbl)do if(rendering.is_valid(sp))then rendering.destroy(sp) end end end local z=512 game.print("Sprites: " .. z/32 .. "x" .. z/32 .. " chunks (" .. z^2 .. " total tiles)") for x=-z,z do global.sprites[x]=global.sprites[x] or {} for y=-z,z do     global.sprites[x][y]=rendering.draw_sprite{sprite="entity/small-lamp",surface=game.player.surface,target={x,y},time_to_live=600} end end
Removing the global step prevents the freeze.

Code: Select all

/c local z=512
game.print("Sprites: " .. z/32 .. "x" .. z/32 .. " chunks (" .. z^2 .. " total tiles)")
for x=-z,z do for y=-z,z do
rendering.draw_sprite{sprite="entity/small-lamp",surface=game.player.surface,target={x,y},time_to_live=600}
end end
Maybe it's just me?
Last edited by PyroFire on Tue May 12, 2020 5:15 pm, edited 1 time in total.

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

Re: [0.18.24] Sprites save file size leak

Post by Rseding91 »

PyroFire wrote:
Tue May 12, 2020 5:02 pm
weird, right?
Not really, you never cleared your global table so you still have all the 263144 entries in it - which is where all of the size comes from.

Before:
before.PNG
before.PNG (42.28 KiB) Viewed 553 times
After:
after.PNG
after.PNG (42.6 KiB) Viewed 553 times
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Not a bug”