Re: Large map arrays in Python?

I've been considering how to go about this, and here's what I came up with:
My map has a parser already built in. Since all my regions are going to be 100 x 100 x 100, I can potentially make a single list of such size and then store all the other entries in a dictionary with the region as the key, i.e, 0 for 0 to 100 on x y and z and 1 for 101 to 200, and a list of all the lines that qualify as the value of that key. Here is my issue: I still store textual information for the map in memory. Granted, it is significantly less than my earlier issue of 1.2 or so gigs of zeros, but still. I could, potentially, only store the index of where the lines are so I could just seek to them when parsing the given tiles, but if my files are encrypted, I am not sure as to how feasible it would be to open the file, unencrypt it, parse it, and then close it if a player is within, say, 5 tiles of a region boundary.
That brings me to the next question: Why would I want to load the next region while the player is still on the edge of another one? To put it in numbers, why would I choose to load the next region when the player is at 100 100 100 and not at 101 101 101?
The entire solution that I came up with seems a bit too dense and over complicated. I have no doubt that I would be able to make it work, but I'm not sure how happy would I be with the resulting code. I tried googling, but all I came up was people splitting world maps into regions and people splitting maps into regions based on the game's state.

-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : magurp244 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : frastlin via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : frastlin via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : frastlin via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector

Reply via email to