• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

how much variables can a DS Grid can handle

L

Lain V0hn Dyrec

Guest
hi been using GM for 2 years now and ive stumble upon a problem where i NEED to put 14x300 variables in a ds_grid (width is 14 and height it 300) been searching all over the forum for answers and cant find it ( my skills for searching is but a noob) and im very sorry about that.. that i decided to create a thread

so my question is how much can a ds grid can handle?

what im about to do is to store all of this then use ds_grid_write to convert it in to a string then save it in to a text file so that my game can call it fast enough without loading.
 
A

Aura

Guest
There is no hard-coded maximum dimension. A grid of size 14 by 300 means 4200 entries; with an optimistic estimate of 8 bytes per entry, your grid is going to take 33600 bytes (approximately 33.6 KB) of the player's RAM.

Writing 33.6 KB of data to a file should be fast enough as far as I'm aware. But you can always use the profiler to make sure:

http://docs.yoyogames.com/source/dadiospice/001_advanced use/profiling.html

If you feel that the performance is being curtailed, writing the grid into a file as chunks should be a viable option. But I doubt you'd have to do that.
 
L

Lain V0hn Dyrec

Guest
There is no hard-coded maximum dimension. A grid of size 14 by 300 means 4200 entries; with an optimistic estimate of 8 bytes per entry, your grid is going to take 33600 bytes (approximately 33.6 KB) of the player's RAM.

Writing 33.6 KB of data to a file should be fast enough as far as I'm aware. But you can always use the profiler to make sure:

http://docs.yoyogames.com/source/dadiospice/001_advanced use/profiling.html

If you feel that the performance is being curtailed, writing the grid into a file as chunks should be a viable option. But I doubt you'd have to do that.
hi Aura, thank you for your time
i just tried a 14x800 entries, and it compiles pretty fast, and do a ds_grid_write so i can save it to a file as a very long string.

also i tried to call it every time i press its button just to see how fast it can be and it was so fast and there are no noticable stutter. just checked it in debugger and in the Max Memory, together with my game functions + this ds_grid calling(ds_grid destroy for every call) and it only uses 5mb.

so is it safe to say that ds_grid capacity depends in the system of the owner?
and there is no limit to how many it can handle as long your machine can right?
 
L

Lain V0hn Dyrec

Guest
Yes, there are no GM-side restrictions and it depends on the RAM of the player.
Thank you very much.. now i can proceed without thinking about it.
have a great day sir
 
Top