The size of a pixmap inside a dmi
I don't get what you're saying, though. What you said before doesn't really make any sense. However I'm not sure it has any relevance to this issue anyway; we've already established you're using big icons.

The important thing here is, I need a way to reproduce your issue.
Well, looks like my reconnect issue was cause i was deleting the mob in logout. when i replaced it with the supercall the issues went away. I get clones when i relog with the supercall instead of calling del now but thats more of a dev help issue.
I'll keep an eye out to see if this also solved my random disappearing icons/swapping icons too
nvm it didnt even fix reconnect i just didnt have a lot of players on at the time
So another weird twist it looks like its not just big icons, a player who had a 96x96 icon as their mob icon could not be seen by some

but again I can't get a demo of this working cuz it never happens in a local environment
96x96 is technically still a big icon if your world.icon_size is smaller than that. Larger icons may show an increased propensity toward this problem, but I suspect just the fact of it being above normal size is a triggering factor.

I still need some inkling of how to reproduce this, though.
Would hosting with linux cause any issues? I dont know what to do or how to isolate this

also this isnt limited to just changing a mobs icon it happens from adding overlays too in some random cases. it really looks like their rsc files randomly gets messed up somehow
Well i tried hosting with a windows machine still had the same issues. I did notice that even some sounds are not playing until you close and reopen. So i'm assuming something is up with the rsc files

heres an example of a player whos icons kept getting swapped around. (notice the invisble characters but you can still see some overlays)
https://gyazo.com/671dd019d2982a876d2de6699bbdd8db
that was only happening on their screen and the issue fixes if they completely close and reopen the client
any idea how i can pin this down further
it seems to be a mix of a cache/rsc bug and that big icon issue

the only solution i could see is maybe saving icons inside the savefiles and hoping that would fix it
So i'm not sure why but it looks like this was causing the reconnect/reboot issues with overlays/icons for me.
mob
var
hairColor="#3ecd82"
proc
ReturnHair()
switch(hair)
if(0)
return null
if(1)
return 'hair1.dmi'
if(2)
return 'hair2.dmi'
if(3)
return 'hair3.dmi'
if(4)
return 'hair4.dmi'
if(6)
return 'hair6.dmi'
if(7)
return 'hair7.dmi'
if(8)
return 'hair8.dmi'
else
return null
RemoveHair()
RemoveMask()
var/icon/a=new(ReturnHair())
a+=hairColor
overlays-=a
RebuildHair()
RemoveHair()
if(Race=="Consumed")
return
var/icon/a=new(ReturnHair())
if(!a) return
a+=hairColor
overlays+=a

Once I took out the part where I made a new icon and added color to it the issue seemed to disappear. Right now i'm just returning the hair files and adding them as an overlay as a work around.

This would explain why it would happen randomly because the game auto saves every 10 minutes and has to remove and re-add the hair during the save process.

It also seemed to almost completely solve the big icon issue I was having. I only get like 1-2 cases of invisible large icons now a day and that still goes away with a hard login logout

Is what i was doing a bad practice?
Bad practice all around here.

First, ReturnHair() should be using a list instead of that gigantic switch() block; there's really no reason to use a switch() there.

Second, if you're doing icon math, you really should do something to cache the icons you've created so you don't have to do the same color addition every time. This for instance is a simple color cache:

var/list/_iconcache = new
proc/IconCacheColorAdd(icon, c)
var/list/cache = _iconcache["addcolor"]
if(!cache) iconcache["addcolor"] = cache = list()
var/list/ic = cache[icon]
if(!ic) cache[icon] = ic = list()
. = ic[color]
if(.) return
var/icon/I = new(icon)
I.Blend(c, ICON_ADD)
ic[color] = . = fcopy_rsc(I)

The chained assignments in there are 511-only syntax, so on 510 you'd have to make some modifications.

However, doing icon math at all is unnecessary now, because we have color matrices that will do this for you.

RemoveHair()
RemoveMask()
var/I = ReturnHair()
if(!I) return
var/obj/O = new
O.layer = FLOAT_LAYER
O.plane = FLOAT_PLANE
O.icon = I
O.color = list(null, null, null, null, hairColor)
overlays -= O
RebuildHair()
RemoveHair()
if(Race=="Consumed") return
var/I = ReturnHair()
if(!I) return
var/obj/O = new
O.layer = FLOAT_LAYER
O.plane = FLOAT_PLANE
O.icon = I
O.color = list(null, null, null, null, hairColor)
overlays += O

An icon with a color matrix is a much better option than doing icon math, especially if you're not using a cache for your icon math.
Thanks!
I've never really used color matrices but i went with what you posted in your snippet and the issue is gone + I have hair colors again
Page: 1 2