if the player only goes toward the east this one file containing everything will be filled with 75% of 0.
Someone else told me that actually using a database such as MySQL could be usefull.
1 column for the coordinates (primary key), 1 column for the data.
Since I only open a session at the beginning of the game I won't lose time like when I need to acces 900 separated text files.
In addition to that I can even uses indexes for equality seach (on the coordinates) to speed those database access.
....
calculating the coordinate is not time consuming since the player position on the sector grid is always being tracked.
a sector contains more information but I'm only storing the data, since the coordinate are stored inside, storing the file with it's coordinate name is also quick.
public class Sector{
byte[][][] data;
int x,y;
int DL;
//some methods
}
I also noticed something weird today, using System.currentTimeMillis()
opening a file = 0ms
writing = 65ms
closing = 0 ms
same thing for reading, shouldn't opening the file be time consuming?