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

Windows Save data

G

Gresse

Guest
Hey I created a game in which the player has the option to play a mission (he has to reach a specific height with a limited amount of fuel(and other variables)) so because I don't have the time to manualy test all combinations of the settings and what height is possioble with them and all write them down in code. I thought the computer could do the job of testing the different missions. I set up a system where the computer generates random values for all variables test what height it would reach and then decides if this would be an "interessting mission" (it checks if the values are at least a bit realistic).
Now I thought I can't say to every player just wait 30 min with starting to play the game because missions must be created, so I decided I can just let my computer run once for 2h and create some missions. I have all the setup to collect data done:

Code:
test_flight_hight_ = //some value
test_flight_fuel_mass_ = //some value
I have the data (for example these two variables) but now I have two problems:

1. I need a way to store these values so that I theoretically can have an infinite amount of variables. I thought about storing them in a ds_list, like:
Code:
test_flight_hight_ = ds_list_create();
test_flight_fuel_mass_ = ds_list_create();
But I'm not sure how to add values, I saw somting that I could just do it like an array, but I also saw something about some ds_list comands to add new values. My question is which way I should use and how I do that.

2. How can I store data that my computer created and store it in the game that if an other guy plays the game he also has the data?
 

Relic

Member
I’m really confused about your issue!

If you let your computer run for 2h, and it finds “interesting variables”, can’t you just have it output those variables in the debug message or save the data to an ini file then you could just manually write these variable straight into your game for all future games to have access to?
 
G

Gresse

Guest
I’m really confused about your issue!

If you let your computer run for 2h, and it finds “interesting variables”, can’t you just have it output those variables in the debug message or save the data to an ini file then you could just manually write these variable straight into your game for all future games to have access to?

My problem is how I don't have to manually write the variables in my game?
 

Relic

Member
You can’t have any data within your game be retained and passed on to future projects (so your ds list is no good).

The closest you can get is to have your “testing” game write all the interesting variables to a ini file. An ini file is external to the game, so after your testing you can get the ini file (which will be on your harddrive), make it an included file to your actual game. Now all future players who Install the game will have this ini file with the data ready to be read.
 
Top