Page 1 of 1

[0.17.72] Garbled biter graphics when they share the same position.

Posted: Wed Oct 23, 2019 3:51 pm
by eradicator
(Kinda afraid that any graphical issues are just my garbage iGPU again...)

The non-collision biter change caused the spawn() method from my mod /sudo to spawn biters all in the same position. When spawning a lot of them at once i noticed they cause graphical artifacts.

This is what one hundred biters look like:
100-small-biters.png
100-small-biters.png (44.79 KiB) Viewed 1744 times

Here's a gutted example command:

Code: Select all

/c
local p = game.player

spawn = function(name,count,position,force)
    local count = count or 10
    local pos   = p.position
    if not (name and pos) then return end
    local created_entities = {}
    for i=1,count do
      table.insert(created_entities,p.surface.create_entity{
        name  = name,
        force = force or game.forces.enemy,
        position = p.surface.find_non_colliding_position(name,pos,32*2,0.5) or pos,
        })
      end
    return created_entities
    end
    
p.character.destructible = false
spawn('small-biter',100)

Re: [0.17.72] Garbled biter graphics when they share the same position.

Posted: Wed Oct 23, 2019 4:23 pm
by posila
Thanks for the report ;)

This is side-effect of compressing sprites with premultiplied alpha. The compression artifacts in compressed blocks that are normally not noticable without close inspection, will add-up in blocks that are not uniformly transparent or opaque when you draw the same sprite 100x over itself. It's minor issue ... just don't do that :D

Re: [0.17.72] Garbled biter graphics when they share the same position.

Posted: Wed Oct 23, 2019 4:37 pm
by eradicator
posila wrote: Wed Oct 23, 2019 4:23 pm Thanks for the report ;)
You're welcome.
At least it's not just me then ;).