I am currently making a 3D game for a computing project I am undertaking, but i am stuck on a problem I assumed to be easy.
I will be having a couple of set maps the user can play on, and all objects and entities to be placed on the map will be given a x, y and z co-ordinate. Creating these co-ordinates as an array in java I can do easily enough, but then the problem I am having now, is I will want the data for the maps to be saved in a text file.
So I am wondering how I am able to save a detailed array such as this in a txt file. I can write to the file and read from it no problem. But it is more, what will be saved in what order that is my problem.
For example, and 2D array would be saved in a simple table in rows and columns, but then how would I save a 3D array in a easy format such as a table?
The only way I have thought of, is having the data for x and z input into seperate tables for each y co-ordinate, which I think is simply unnecessary. So does anyone else have any suggestions?
Sorry for any misunderstanding, I tried to make it as clear as possible,