ID:2112505
 
(See the best response by GreatPirateEra.)
so is it bad to have some lists on ever turf??
I mean does it produce any lag?? it may sound silly, but I don't really know the internal mechanisms of byond so I can't be sure of anything

I mean that each turf has a list of other turfs with list length about 10-15 turfs. I mean it just increases ram usage right??

Also when increasing view movement becomes a little more laggy is there any reason, I would guess because more objects are present in the screen right??

Again I'm sorry if my questions are a little obvious just want to make sure.
Best response
Yup, sounds like a stupendously horrible idea. Depending on world size, you can have a MASSIVE amount of shit piled up. Why do you need 10-15 turfs stored inside of a list of a turf?
it speeds up my pathfinding because I store the neighboors of each group of turfs I define group of turfs so to reduce calculations in pathfinding.

hmmm then I'll have to optimize again, thanks for the help :)

btw do you know about the world.view slowing game down when moving if too big??
As stated before, having a list attached to every turf is going to create massive resource issues with your game, you might even end up hitting BYOND's list limit if you have a map big enough, which would cause any further interaction with lists to fail.

As for your view question, you pretty much nailed it on the head, every tile your view expands you exponentially increase the amount of processing both the client and server have to handle, the more you can see the more calculations need to be done as the map updates around you.
Victorqr wrote:
so is it bad to have some lists on ever turf??

Yes. Not necessarily if they're not initialized, but once they're in use, that turf has a data object that won't go away, even if you null out the var. And the list itself still takes up memory.

I mean does it produce any lag?? it may sound silly, but I don't really know the internal mechanisms of byond so I can't be sure of anything

I mean that each turf has a list of other turfs with list length about 10-15 turfs. I mean it just increases ram usage right??

Lag, no; not exactly. Having more turfs that have special vars will tend to slow down var reads on all turfs over time, although not by a lot. A better solution here, though, is probably an associative list of lists.

For pathfinding, it may also be worthwhile to simply store a number in an associative list, which is simply a set of bitflags indicating which neighbors are open.

Also when increasing view movement becomes a little more laggy is there any reason, I would guess because more objects are present in the screen right??

Higher view size means more turfs to process. Movable objects in view have to be searched for on all turfs in view, every frame, to see if they've updated. On the client side, more turfs means more icons which means more to sort and draw.

Map processing on the server is relatively fast; the client draw may take longer depending on various factors. Both of them scale with view size.