Hi,
I have noticed with some experimenting that my savefile size fluctuates greatly depending on how i handle the actual functions of my "Builder" proc.
mob/human
proc
BuildEquipment()
var/olays[0]
if(type_hair != "bald")
var/hair = types_hair[type_hair || "bald"] + colour_hair; olays += hair
for(var/A in equipped)
var/cr1
var/obj/cr2
var/icon/cr3
var/item/equipment/B = equipped[A]
cr1 = B.eqwear
cr2 = new cr1()
cr3 = cr2.icon + B.colour
cr2.icon = cr3
olays += cr2
src.overlays = olays
This above code is the code i was using in a previous environment and it generates a 6KB savefile with 2 player slots one of which has 40 items, 3 of them in equipped list.
..
The same code in my new enviroment but instead of using eqwear (which is a link to a "holder object" with the same icon just no changed icon state) i use just B.type and it outputs a 28kb save with 14 items, 2 in equipped.. bit large IMO.
var/item/equipment/B = equipped[A]
var/icon/eqicon
eqicon = B.icon + B.colour
B.icon = eqicon
B.icon_state = "" //setting the iconstate back to null so it works with PM and stuff (usually on a map state)
B.layer = B.olayer
olays += B
Changing all the "Cr" parts to this snippet outputs a 6KB save. which is alright, it was previously outputting 16kb which i found odd (maybe cause i changed FILE_DIR settings?) (now gives 12kb with 76 items unequipped items, 2 equipped)
In any case im curious as to why the savefile sizes would change so much between the 2 different codes and enviroments, considering my old one still has more info stored yet less space taken.
Anyone got any thoughts?
Then i did abit of further code to clean it up by removing the directories (not that it did much other then remove icon = null lines)
I noticed that in old environment not wiping the icon/overlays then just F.dir.Remove(xxx) had a substantial increase in save sizes (42kb over 6kb.. WOA) whereas new enviroment was only 12kb over 9kb (when nulling icon/olay before save).
Why is this the case when you are wiping the data anyway through f.dir.remove or F["icons"] << null?