• 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!

Large amount of data in a game?

I've used GameMaker Studio off and on for several years now. I've made some simple 2d games with it. I am not an advanced user, but I know my way around.

I have a desire to create a game that is not text based, but will be very heavily driven by menu selections with text output - also some light static graphics and animations. It will be a strategic baseball simulator.

I know I can create the front end and scripts to generate all of the random player data and game data, but storing it is where I run in to a problem. I've only used simple flat text files in the past to store a very minimal amount of data (player score, high score, player health, etc.).

This new baseball simulation game I plan on developing will have a ton of data. I am thinking of having 12 teams * 19 players each * 25 seasons. Each player will have their own stats, plus I would want to store their season stats (hits, walks, homeruns, etc.). You can see just about how much data this is going to grow in to.

Can GameMaker Studio handle this much data and store it properly, and if so, could someone please point me in the right direction of a tutorial that properly demonstrates how to store all this data in GameMaker Studio? If you know this is possible, but don't know of a tutorial, could you just give me the keywords for what I am trying to do so I may research it on my own?

Note - I am trying to avoid proper text adventure software as the user will not be entering any text in to the game. All selections will be made using a graphical menu system. I need to have the freedom of building my own custom front end - that is why I am comfortable with GameMaker Studio.

Thanks all for any feedback!
 
Arrays and structs are all you need, GMS doesn't really have limitations on "data". Though you will have trouble finding tutorials for this sort of thing as most tutorials are aimed at "action" style games and not data heavy games.
 

curato

Member
I agree. I have a set of game state data that i need to keep between play sessions. I use a dsmap to hold the data then just save it to a file. You could do a similar thing just have a similar structure in a file and just load it when the game starts and pull from it as needed.
 

Yal

šŸ§ *penguin noises*
GMC Elder
This new baseball simulation game I plan on developing will have a ton of data. I am thinking of having 12 teams * 19 players each * 25 seasons. Each player will have their own stats, plus I would want to store their season stats (hits, walks, homeruns, etc.). You can see just about how much data this is going to grow in to.

Can GameMaker Studio handle this much data and store it properly, and if so, could someone please point me in the right direction of a tutorial that properly demonstrates how to store all this data in GameMaker Studio? If you know this is possible, but don't know of a tutorial, could you just give me the keywords for what I am trying to do so I may research it on my own?
It's pretty much impossible to run out of memory by just having data. A numerical variable is a double float, which means it takes up 2 words = 8 bytes. 12 * 19 * 25 * 8 = 45600 = 44,5 kilobytes. Strings basically use 1 byte/character (C/C++ unicode strings have a variable amount of bytes per character and you'll typically use A-Z/0-9 the most) so it's in the same order of magnitude even if it's more variable. All your player data is not even close to the amount of memory a single minute of OGG music takes up.

TL;DR you can use infinite variables, assets is what takes up the most memory.
 

Rob

Member
Unless you're generating your players/teams procedurally, I'd recommend using csv files.

For example, a lot of my games are stat-heavy, and I want to give them specific stats for HP/Attack/Defence etc. I open an excel sheet, fill the stats out, then save it as a csv file and in gamemaker all I have to do is:

GML:
global.stats = load_csv("stats.csv");
And now I have a grid that contains all those stats. I can also use ds_grid_write/read to easily save and load data externally, for when you want to track the stats of the players/teams.
 

Khao

Member
Asked a similar question not too long ago and the general consensus was that it's fine. My game can hold up to 31200 variables at a time just to track personal player statistics and custom settings and I've yet to run into any issues.
 
Top