ID:172634
 
I've figured out the source of this problem, I just don't know why it does it. For the game I'm working on, I made a map (40x40x20). Everything worked fine and I've been coding here and there. Recently, I realized that a larger map is needed, so I made one that is 60x60x20.

When I use this new map, I get an error immediately when Dreamseeker starts:

Byond(334.839) ERROR: maximum number of lists exceeded (65535)!

runtime error: Cannot execute null.Add()

proc name: New (/world/New)



I'm not sure why a larger map creates this problem. Is there some sort of maximum on the size of the map or is there something else with the coding I'm unaware of here.

All I know is, when I click ON for the smaller map, everything is fine. When I use the larger map (clicking off for the smaller map, on for the larger map), it chokes. Why?

-Dagolar
It may be some extra stuff you're doing when the world, or turfs, are created. Have you added anything to world/New(), or any of the turfs' New() procs?
Do each of your turfs have a list? Because if so, there's your problem. 40x40x20 is 32,000, and BYOND can handle 32,000 lists. But 60x60x20 is 72,000, which is over the limit; as the error message says, you can only have 65,535 lists at once.

Solution? Don't give each turf its own list. =)
In response to Jon88
It's just the size of the new world (60x60x20) that chokes it. I haven't even put any turfs on it, it's just a blank map. The turfs have no procs. The turfs I have are as simple as they get.

turf
category1
grass
icon_state = "grass1"

They're all pretty much like that, some with density 1, others with opacity 1, some both, etc. Pretty simple. I don't get it. Smaller map, 60x60x15, works fine. And it makes no sense because another game there was a map I had that was 300x300x8, which is a lot bigger in total number of squares.

-Dagolar
In response to Crispy
The turfs themselves do not have a list, and even if they did, I haven't put any on this new larger map - and it still stalls up. Can't even get the dreamseeker going. Likewise, if I make a new map that's just a bit smaller, like 60x60x15 I tried, it works fine...

-Dagolar
Well, there is nothing inherently wrong with a 60x60x20 map, so it has to be a list problem. Post your world/New() proc, so we can see where the null.Add() problem is happening. It really looks there is either a list var for all turfs, or for all atoms, since turfs are atoms.
In response to Dagolar
Every tile in the game world is a turf. A 60 x 60 x 20 map is a measured in turfs. For some reason, your turfs DO all have a list and that is why you get that error. It could be from a library you've included. It could be inherited from /atom.

Place this verb in your code, select a small enough map to compile, run the game and execute the verb. It will tell you all the list vars of the turf. The built in lists (overlays, underlays, verbs, vars, and contents) are safe. Anything else it reports is a source of trouble.
turf/verb/turflist()
usr << "[src] List Vars:"
var/flag=1
for(var/V in vars)
var/X = vars[V]
if(istype(X,/list))
flag=0
usr << V
if(flag)
usr << "No lists found."
In response to Shadowdarke
Yeah, there was a list "Status" programmed way back when I first received the code. It's gone now. Thanks.

-Dagolar