Limits and efficiency in Design Philosophy
|
|
I've heard about the limits BYOND has on what can be in the world, but I don't think I've ever seen a complete list. I've heard the limits are around 65k?
Anyways, I'm just looking for either a link to where these limits might be listed or some more information about these limits. Are they cumulative? (Like, do lists have their limit, or do they simply take away from the main limit) How are literals handled? (Like numbers, etc.)
One main reason that I'm asking is that for a fan game, I put some data from the original game... which takes the form of 32 lists of 100 numbers each. Right now, I just define each list as a global var. Are these 3200 numbers going to be a problem when it comes to efficiency and limits? My other option was to create the list in the code and have it built every time I need to get data from one of the lists, but I wasn't sure whether building a 100 number list regularly would be more strain than just building them once and holding them.
(The numbers are all numbers 1-20, so its not like I'm using very many, just the same ones repeated)
|
For the most part, you can safely bet on the number 65535 for internal limits -- 65535 mobs, 65535 list elements, 65535 strings, so on and so forth. It takes a lot of effort to reach this limit, so most projects don't even need to worry about these.
As for your question about numbers and the such, BYOND's internal referencing stashes each unique copy of a string, number or other item exactly once. If you have:
...you've used precisely one memory address, and contributed one item toward the limit. This is because 20 is stored for the variable a, and the variable b references the memory location of a. Ultimately, this saves a ton of redundant memory allocations, which is why it takes significant effort to hover around internal limits (and also why operations like if(a == b) work).