So it has been a while since I have programmed… job,stress, depression, messy code etc tend to get in the way of my development process a hell of a lot.
But that aside, I’m back at it again.
I’ve spent the last week or so re-writing the code for my existing game project so as to make things easier for me to work on.
I’ve also taken a bit more time out to do some more organised documentation and logging of progress which has really helped.
Currently, my goal is to learn how to save game data to a protected file, or save encoded data to a file so that it cannot be altered by other’s without loading the file in the game editor or the game itself.
To begin with, I have a procedurally generated game world using diamond-square algorithm, these procedural worlds will be created when a player creates a custom game with a randomized map generated based on a seed value that is determined by a bunch of slider values and check boxes. I want the procedural world generation to be very extensive, but not right now, I have to get the basics down first.
So at the moment, once I click my little world generation button, it stores a set of numbers (that represent terrain tile types), into a multi-dimensional byte array.
Currently, I have managed to get the engine to create a multi-dimensional array with 530,887,671 tiles in it, and the game runs the same as if there were 500,000 tiles, as the renderer culls out what it can’t see on the immediate viewing area.
In my head, I know what needs to be done, but I just don’t know HOW to do it, what techniques to use.
Without being too specific on map data, I have just been looking at how to save and load data using libGDX and java.
I checked out the libgdx documentation on file handling:
I have come across things such as preferences for things like player stat saving.
http://www.badlogicgames.com/wordpress/?p=1585
I have come across file and data output streams for storing and loading map data.
http://developer.nokia.com/Community/Wiki/How_to_create_2d_tiled_array_binary_file_and_load_it_in_Java_ME
And I have also come across dermetfan’s video where he saves data using JSON and base64.
So basically I know what to do, but just don’t know how to do it, and am looking for direction, or something I can learn from, rather than a direct answer (although I tend to learn from those pretty well too :P).
Either I have been searching the wrong things on youtube and google, or I’m just having a durpey moment (I am not all that intelligent…or at least it feels that way).
Any help would be greatly appreciated. While I wait, I am going to keep exploring the interwebz for information
Also, for those who don’t know or remember what I was/am working on, here is a youtube video:
nYEB2TrtViE