(Solved) terrain files

hello guys, i want to ask one question :slight_smile:

how i can save terrain to file with coordinates , object data place like <object name="monkey" x=100 z=50> with terrain height and some other data? ( i heard that if i save a lot of data to xml and load it in runtime it could cause some problems because file will be loaded to memory)

if my map is huge? whats best choice of saving?

and anybody know how large is MMO's terrain saved to files? in megabytes?



thanks. srry for my english, it's not my native language.

It seems that you might have several issues mixed together.



Do you want to save the whole state of your world into a file and load it every time? Or do you need to load some "static" content and then add some other dynamic content in another way?



If you want to save the whole world, you can save to binary format. The problem is that  it would only work well for static content (houses, trees) and not things like the player's position and the like.



Also, usually in MMO's what you have is a more sophisticated algorithm for loading the map. You don't want to load the whole thing at once, you want to load it progressively as you walk through, by unloading the last area and loading the next one.

yes i know , i want to save world with (building , trees, NPC's and other mobs) to file and when you login u're at 9 tiles system where are u at middle.



but my question is that how do i places tiles in one file at user pc.

i saw some world editors, they place tiles in separate files like 1,0.world , 2,1.world and something like that.

and is it better to stream world from server or just download whole world and load 9 tiles?

DarkDio said:

yes i know , i want to save world with (building , trees, NPC's and other mobs) to file and when you login u're at 9 tiles system where are u at middle.

but my question is that how do i places tiles in one file at user pc.
i saw some world editors, they place tiles in separate files like 1,0.world , 2,1.world and something like that.
and is it better to stream world from server or just download whole world and load 9 tiles?


It seems to me like you want to compress all your data into a very limited amount of files.. Am I right?
Java has pretty good support for zip, which you may want to look into.
In the end every single file is just an amount of bytes that you can put into a binary file, and then load parts of it as you please.

http://java.sun.com/developer/technicalArticles/Programming/compression/

(:

- Mikkel

- Mikkel
Mikkel said:

DarkDio said:

yes i know , i want to save world with (building , trees, NPC's and other mobs) to file and when you login u're at 9 tiles system where are u at middle.

but my question is that how do i places tiles in one file at user pc.
i saw some world editors, they place tiles in separate files like 1,0.world , 2,1.world and something like that.
and is it better to stream world from server or just download whole world and load 9 tiles?


It seems to me like you want to compress all your data into a very limited amount of files.. Am I right?
Java has pretty good support for zip, which you may want to look into.
In the end every single file is just an amount of bytes that you can put into a binary file, and then load parts of it as you please.

http://java.sun.com/developer/technicalArticles/Programming/compression/

Good luck (:

- Mikkel

thank you :slight_smile:



Solved :slight_smile:

Also keep in mind that it is not possible to go infinitely into one direction in the scenegraph. Very high values for spatial locations result in inaccuracies due to the 32bit float. So it is best to move the player "back" when he reaches the point where the tiles are switched and move the terrain accordingly. You will have to check when (and if) this becomes a problem for you.