At what point do ds grids become too intensive?

The manual says that ds grids can be memory intensive, but it doesn't say at what point this occurs. For example, I will have a grid in my game that'll be around 11 spaces wide and at least 30 spaces tall (probably no more than 60 tall). It's in a persistent object so it's always available, but it's also always running. Is this too memory-intensive? If it is, what are my other options for storing this data?
That is extremely far from being too memory intensive. Warnings like that in the manual make sense in the context of data structures overall (as in, comparatively), but there's no need to worry about it, especially for such a small grid. Use what you need to use and only worry about optimisation if you actually start to experience overly large memory use or in-game slowdown (which absolutely should not happen for your grid, it's nowhere near the limit where you would need to optimise to a different method of storing data).


Friendly Tyrant
Forum Staff
No that's not memory intensive. Having 1000 of them might be, or having a grid that is 10000 x 10000 would be. Or worse having 1000 10000x10000 grids would definitely be! :)


It wouldn't be too intensive.

Data structures tend to slow down a game if they're constantly used in loops. So if you were checking a large grid (we're talking closer to several hundred tall and several hundred wide) constantly, then it might cause some slowdown, if you're checking it just from time to time, you'll be ok.


It obviously isn't at the scale you're using it.

Taking the high end of your dimension estimates and assuming that only floats will go into it, your grid weighs 11*60*8 = 5280 bytes.

This is much smaller than even a single 32x32 sprite, and backgrounds and music are likely already several orders of magnitude larger.

Don't try to micro-optimize stuff like this, especially if you're doing it with feelings instead of math.
Thanks for the input! I'm so used to the small scale of my game that it never even occurred to me that you could make data structures with thousands and thousands of entries. Definitely nothing to worry about now