Re: Representing 3d Staircases? (Python)

@19
I honestly don't know.  You've taken what is a very simple encoding of a list of values and overcomplicated it.

All the technique I've given you does is take a list like [1, 1, 1, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5] and make it really really small by using the fact that it has lots of repeated values.  This isn't even related to maps.  All I've described is a thing that takes a list like that and makes it small.

You go map[x][y][z].  There's an outer list that holds all the y lists.  Then each of the y lists has some z lists inside it.  You are just replacing the z lists with compressed lists.  Absolutely nothing more happens here.

You know which x-y pair your compressed z axis goes with.  When you decompress it, you just use the fact that you did map[2][3] to get to that array and fill the 2 and the 3 in as you go.

Let me walk through this.

Map is a list of lists of lists.

map[x] is a list of lists.
map[x][y] is a list.
map[x][y][z] is a tile.

Now, with the compressed version:

map is a list of lists of compressed lists.
map[x] is a list of compressed lists
map[x][y] is a compressed list.
map[x][y][z] is a tile.

If you still don't get it, there is literally no better way I can explain this other than to tell you to google voxels and run length encoding and stuff like that to find examples or something.  If this is still confusing, I suggest either doing small maps or getting a library if you can find one.

-- 
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 : camlorn via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : camlorn 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 : camlorn via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : camlorn 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
  • ... AudioGames . net Forum — Developers room : camlorn 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 : camlorn 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 : camlorn via Audiogames-reflector

Reply via email to