Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic render resolution #23

Open
Palats opened this issue Apr 3, 2022 · 2 comments
Open

Dynamic render resolution #23

Palats opened this issue Apr 3, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@Palats
Copy link
Owner

Palats commented Apr 3, 2022

As of writing, the whole map is rendered at the same resolution levels. However:

  • Given that the area chosen is square, lots of space is not interesting, esp. those not containing any player structure.
  • Highly detailed area are costly to render and store, even if there is nothing interesting.

It would be interesting to explore having a more dynamic rendering - with limited resolution where there is nothing of interest and better resolution on player structure for example.

It might not be completely straightforward:

  • Detecting whether there is something of interest or not is doable, maybe even with some configurability. It might be expensive to query many parts of the map, but I suspect that Factorio is quite efficient here.
  • We would need to store which zone is rendered at which level of details. In JSON, it might end up being some amount of data, though we can probably manage something decent there.
  • That would probably require to convince Leaflet to use a mix of tiles for rendering (based on that information). Leaflet is relatively simple, that might make be tricky.

[Original suggestion from Soul-Burn on the mod page]

@Palats Palats added the enhancement New feature or request label Apr 3, 2022
@Palats
Copy link
Owner Author

Palats commented Apr 3, 2022

Regarding Leaflet, there is at least some prior art: https://github.com/ghybs/Leaflet.TileLayer.Fallback. It relies on trying a different resolutions when a tile is not available. It does introduce some extra round trips, but has the advantage of simplicity as it would not require recording what exists and what does not exists, making the whole thing reasonably simple.

Soul-Burn added a commit to Soul-Burn/mapshot that referenced this issue Nov 17, 2023
Added min jpg quality when tile has no relevant entities.
When value 0 is used, the tile is skipped. Leaflet.fallback is used on frontend code to support this.
@Palats
Copy link
Owner Author

Palats commented Jan 13, 2024

9bd1015 added a way to decrease the quality of tiles with no user entities.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant