Coder Social home page Coder Social logo

Comments (5)

AaronVanGeffen avatar AaronVanGeffen commented on May 24, 2024 1

The mini map doesn't, indeed. Instead, it just uses 2x1 pixels per tile.

from openloco.

AaronVanGeffen avatar AaronVanGeffen commented on May 24, 2024

More evidence that map sizes used to be 512x512: the map window allocates space for two maps of 0x90000 pixels each, or 768x768 pixels. This makes sense given the 45ΒΊ map projection, i.e. 512*1.5=768. This constant (and 769) shows up a bunch in my implementation #2443

from openloco.

LeftofZen avatar LeftofZen commented on May 24, 2024

That's really interesting! For reference, the diagonal length of a square is √2 * sideLength from Pythagoras, so the diagonal length (and hence the height of the pixel grid/bitmap you would have to paint it on) would need to be 725 pixels minimum, not 768, though I realise 768 is a nice half-power-of-2 and that's why it was chosen.

√2 * 384 = 543.058...
√2 * 512 = 724.077...

Since the 384 one is greater than 512 pixels, that also makes sense why it was left at 768 and not reduced to 512 with the map size to 384, because that wouldn't have fit.

from openloco.

AaronVanGeffen avatar AaronVanGeffen commented on May 24, 2024

I was thinking it would have to do with the way tiles use an isometric projection, using 1.5 times the height for their width. However, I realise now that that was making it overly complicated: the reason the mini maps use two times the height to the width, is because every tile gets two pixels horizontally on the mini map! False alarm, heh.

from openloco.

LeftofZen avatar LeftofZen commented on May 24, 2024

The map doesn't use isometric projection though, so both of those reasons don't apply?

from openloco.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.