- How "big" are the different variable types in BYOND when they are null? All the same size? (I.E. var/obj vs var/list vs var/num, etc)
- How detrimental is it to resources to have a large percentage of variables that will remain null? If I have 40,000 objects and over 100,000 empty variables, is this going to cause performance problems?
I ask both these questions in an effort to determine how necessary it is to be granular with type declaration. For example, theoretically which is better if one plans to have a lot of objects:
This:
obj
var
hp
cost
damage
skill
lightradius
burntime
Or this:
obj
var
hp
cost
sword
var
damage
skill
torch
var
lightradius
burntime
Cheers
-- John M.
As to lag, I don't believe much is caused when the variables are null, though I've never had the opportunity to test it myself. Regardless, try not to make variables that can easily be handled by another plus an operation of some kind. For example, if my attack damage is my strength*2 I really don't need a variable just for my attack damage, instead I can just call the operation when necessary. Then again, there are some cases where saving the result of an operation can be beneficial, such as if the operation is taxing on the CPU (icon operations,etc.)
That's just how I see things though.