I draw the cubes in my game using a 3d array, so somehow I'd have to export it like that.
Does anybody have any advice or tips to get me started?
editor save:
open file
for x=0 x<1000 x++
for z=0 z<1000 z++
for y= 0 y< 60 y++
writecube(x,y,z)
close file
game load:
open file
for x=0 x<1000 x++
for z=0 z<1000 z++
for y= 0 y< 60 y++
readcube(x,y,z)
close file
writecube() writes the data for one cube to your "level map" data file.
readcube() reads the data for one cube from your "level map" data file and puts it in the game's 3d array.
the file format is up to you. it can be text or binary. binary will be faster.
the slickest way is if the data structure (the 3d array) is the same in the editor and the game. then you can just blockwrite the entire 3d array as one binary blob of data, and blockread it directly into the game's 3d array. fastest possible load and save, just one line of code to load or save the whole thing. the downside is if the data structure of a cube changes, you have to convert existing level maps to the new cube data structure. an efficient workaround for this is to save the individual fields of a cube struct in order individually one at a time, instead of writing the whole struct in one shebang. then when you add a new variable to the struct, you just add the code to write that one variable to the end of the save routine. have the game init the 3d array with some default value for the new variable. then you load in your old levels, and save them out again. this writes them out with the new variable data in them. then you add the code to read the new variable data to your load routine, and your all done - new data structure, new load and save routines, and all old level maps are converted to new format with a default value for the new variable.