Re: Large map arrays in Python?
Hm.Pickling or Json exporting won't help much, Numpy also has functions for saving and compressing such arrays, but for arrays this size it won't help your loading issue either. Even if you writing a parser you'd still have to comb and overlay the data into the larger array, or comb through the larger array to save it.
These kinds of size bottlenecks aren't new for large open world games though, its one of the reasons such large environments are typically broken into discrete sections that are loaded around the player as they move through the map, rather than all at once. There are ways around it with different data types or things other than tiles, like quadtree's and such, but if your sticking with tiles then I would suggest taking the sector based approach by dividing larger maps into smaller chunks and loading sections as needed when the player gets near the boundaries of each sector. So, for example lets say you have a 1000 by 1000 by 1000 map, you could divide that into 200 by 200 by 200 chunks, or 125 sectors, and only load, say, 27 sectors at a time around the player. If they cross the boundary of the forward 9 set of sectors, unload the back 9 and load 9 new forward sectors as they go. Think of it as a floating bridge that ends in front of you, where as you walk forward across it new sections appear under your feet, and the sections behind you disappear. The bridge is there, but only the parts that are necessary appear when you need them.
-- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector