Code Monkey home page Code Monkey logo

Comments (11)

LannyRipple avatar LannyRipple commented on August 23, 2024 1

Nope. Seems the center gets used in some way I'm not figuring out yet.

Thanks for all the help! I think I've got enough info to play around and eventually tease it out.

from papyri.

jason-green-io avatar jason-green-io commented on August 23, 2024

from papyri.

LannyRipple avatar LannyRipple commented on August 23, 2024

Oh right! Ok. BTW supports the grid but I'm guessing the map data doesn't have it. Gives me something to work with.

Will close this. Thanks for the clue.

from papyri.

LannyRipple avatar LannyRipple commented on August 23, 2024

(Sorry to re-open. Need a bit more info.)

Seems I have zCenter and xCenter. The maps are drawn correctly. Then merged-maps seem to draw the upper-left map quadrant in the lower-right position with upper-left, upper-right, lower-left being left empty.

Looking at the code it seems all maps get translated into a scala 4 coordinate system and drawn on the merged-maps. I only have scale 4 maps so would expect to see the same images as in maps but instead seeing the shift mentioned above.

from papyri.

LannyRipple avatar LannyRipple commented on August 23, 2024

A picture being worth 1000 words I've added screen shots.
Screen Shot 2022-12-12 at 3 51 31 PM
Screen Shot 2022-12-12 at 3 51 44 PM
I've highlighted map_0 (center 0,0) in maps and merged-maps. Oddly merged-maps thinks the coordinates (I believe upper-left point) are -2048,2048. That would end up drawing only the upper-left quadrant of a 0,0 map in the lower-right quadrant of merged-maps.

from papyri.

jason-green-io avatar jason-green-io commented on August 23, 2024

I'd love to see the map_*.dat files so I can see the nbt in them.

from papyri.

LannyRipple avatar LannyRipple commented on August 23, 2024

Sure. I'm going to pull out colors since as you can see from the maps directory the data is in there.

map_0: {data: {zCenter: 0, width: 128s, scale: 4b, dimension: 0b, xCenter: 0, colors: [], height: 128s}}
map_1: {data: {zCenter: -2048, width: 128s, scale: 4b, dimension: 0b, xCenter: 0, colors: [], height: 128s}}
map_2: {data: {zCenter: 0, width: 128s, scale: 4b, dimension: 0b, xCenter: 2048, colors: [], height: 128s}}
map_3: {data: {zCenter: 0, width: 128s, scale: 4b, dimension: 0b, xCenter: -2048, colors: [], height: 128s}}
map_4: {data: {zCenter: 0, width: 128s, scale: 4b, dimension: 0b, xCenter: -4096, colors: [], height: 128s}}
map_5: {data: {zCenter: 2048, width: 128s, scale: 4b, dimension: 0b, xCenter: 0, colors: [], height: 128s}}
map_6: {data: {zCenter: 4096, width: 128s, scale: 4b, dimension: 0b, xCenter: 0, colors: [], height: 128s}}
map_7: {data: {zCenter: 4096, width: 128s, scale: 4b, dimension: 0b, xCenter: 0, colors: [], height: 128s}}

The maps 6 and 7 have the same coords. Map 6 was lost while not paying attention to creepers.

I'm wondering if Minecraft versions that use a grid are not centered at 0,0 but maybe another reference point? That is maybe my map_0 should have center 1024,1024.

from papyri.

LannyRipple avatar LannyRipple commented on August 23, 2024

Hmm. I tried to shift all coords by 1024 in papyri.py to test above. The maps are now fully drawn but not in their correct locations. :/
Screen Shot 2022-12-12 at 4 56 13 PM

from papyri.

jason-green-io avatar jason-green-io commented on August 23, 2024

Yup, so starting in 1.8, the centre of the map depends on where the level 0 map was created and zoom level, explained here: https://minecraft.fandom.com/wiki/Map#Zoom_details

Pretty sure the maps you have there are impossible to create in versions past 1.8. I take advantage of the >=1.8 method as as shortcut. Since I know all maps at lower levels will tile evenly without trimming in a "level 4" map.

from papyri.

LannyRipple avatar LannyRipple commented on August 23, 2024

Ah.

At zoom level 0, a map created on the point (0,0) has (0,0) at the center of the map. At higher zoom levels of the same map, the coordinate (0,0) is in the top left square of the map.

So I can probably just rewrite my xCenter, zCenter and it will work.

from papyri.

LannyRipple avatar LannyRipple commented on August 23, 2024

In the end it was just adjusting the map's center when read in. Trick was to use an adjustment of 1024 - 64.

from papyri.

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.