Hello, anybody knows a good way of storing level data? I mean, I have for example a 2d map made of squares and its dimensions are 1k by 1k. So it makes 1 million squares. Any ideas for storing such things?
Really depends on what each square in your level map represents. For example, if it's just (say) the colour of that tile then you could easily represent that as a simple in-memory 2D array for a a few 10s of Mb. If however you're talking about height-map data, references to textures, objects within the world, etc. then that approach will obviously break down very quickly.
Minecraft has like even larger map, and it is 3d. So it makes it 50 if not more times larger. How does minecraft store such things?!
All games that have large maps use pagination
The 'world' is segmented into tiles (or chunks of the map) and only those in view reside in memory. As the character avatar or camera or whatever moves around the map, chunks are loaded into memory and added to the view, chunks that are no longer needed are discarded (usually on a background thread with suitable caching). What data is in each tile and the granularity of the tiles is really down to the individual application / game.
I've used this approach to represent very large 3D world maps with each tile containing the actual terrain height-map with additional information such as cosmetic objects (trees models, rocks, etc), lighting, ambient colours, AI spawn/routing data, yada yada.