Instead of saving pixels to a nested vecs, just add more indices to your keys and normalize the pixel structure. Then use start and end bounds to look up individual chunks.
Space filling curves enable one to convey two dimensional space via one dimensional points. Thus, it is a very efficient way to achieve the same functionality currently offered by chunking, but with a simple stream of integers rather than coordinates. Then you can simply paginate through a list of pixels that are already chunked, without the chunks. This also enables you to easily look up any given pixel's color.
Not sure why the painter is being saved. It is expensive to store and load, and this information could be queried from an archive node. Some queries were running out of gas in my experience.
Easy
Instead of saving pixels to a nested vecs, just add more indices to your keys and normalize the pixel structure. Then use start and end bounds to look up individual chunks.
Hard
Space filling curves enable one to convey two dimensional space via one dimensional points. Thus, it is a very efficient way to achieve the same functionality currently offered by chunking, but with a simple stream of integers rather than coordinates. Then you can simply paginate through a list of pixels that are already chunked, without the chunks. This also enables you to easily look up any given pixel's color.
rust hilbert curve library https://docs.rs/fast_hilbert/latest/fast_hilbert/index.html
resources: https://en.wikipedia.org/wiki/Space-filling_curve, https://www.youtube.com/watch?v=3s7h2MHQtxc
Other
Not sure why the painter is being saved. It is expensive to store and load, and this information could be queried from an archive node. Some queries were running out of gas in my experience.