Giter VIP home page Giter VIP logo

minecraft-dynmap-timemachine's Introduction

Minecraft Dynmap Time Machine

Build Status

Python 2.7, 3.3+ and PyPy command line script that downloads tiles from a Minecraft's Dynmap plugin HTTP server and composes one image in extremely large resolution suitable for print.

Scaled down image

This is a scaled down and croped image form original 20736 x 13824px. You can also download full size 389 MB image. See example bellow.

List of all parameter is as follows:

$ dynmap-timemachine.py -h
usage: dynmap-timemachine.py [-h] [--list-worlds] [--list-maps] [-t [THRESHOLD]] [-q] [-v]
               base_url [world] [map] [center] [boundary_size] [zoom] [dest]

positional arguments:
  base_url              Dynamp server URL
  world                 world name, use --list-worlds to list available worlds
  map                   map name, use --list-maps to list available maps
  center                minecraft cooridnates, use format: [x,y,z]
  boundary_size         size in tiles, use format: [h,v]
  zoom                  zoom level, 0 = maximum zoom
  dest                  output file name or directory

optional arguments:
  -h, --help            show this help message and exit
  --list-worlds         list available worlds from this Dynmap server and exit
  --list-maps           list available maps for this world and exit
  -t [THRESHOLD], --threshold [THRESHOLD]
                        threshold for timelapse images
  -q, --quiet
  -v, --verbose

Installation

Most easily install using pip:

$ pip install dynmap_timemachine

1. Example - capture one large image

Let's say we want to download a 20736x13824px map (286 Mpx image) from map.majncraft.cz at Minecraft position [3300,65,-2630].

  1. First see what worlds are available and what's the name of the world that we want

    $ dynmap-timemachine.py --list-worlds http://map.majncraft.cz/
    world - Svět Majncraft | Overworld
    world_space - Vesmír | Space
    world_nether - Nether Reloaded
    

    We want the first world on the list called simply world.

  2. Then list all maps avaialble for this world

    $ dynmap-timemachine.py --list-maps http://map.majncraft.cz/ world
    surface - Prostorová - Den
    surface_night - Prostorová - Noc
    populated - Osídlení světa - prostorové
    flat - Plochá - Den
    populated_flat - Osídlení světa - ploché
    

    This lists flat, isometric, cave and all other types of maps together. Map names depend on Dynmap's configuration. We want the first one called surface which is an isometric map.

  3. Make a test image with Minecraft's coordinates

    Check your coordinates on Dynmap or simply walk in Minecraft at the position that you want to capture and press F3 to see what are your Minecraft's coordinates. Then make a test image to make sure that the position captured by minecraft-dynmap-timelapse is correct:

    $ dynmap-timemachine.py http://map.majncraft.cz/ world surface \
        [3300,65,-2630] [3,2] 0 majncraft.test.png
    

    Used parameters:

    • http://map.majncraft.cz/ - Dynmap's HTTP server URL
    • world - World name
    • surface - Map name
    • [3300,65,-2630] - Minecraft coordiantes that will be automatically converted to tile names
    • [3,2] - Number of tiles I want to download in each direction from specified coordinates. That's two to the left and right, two to the top and bottom. This will actually download 6x4 grid where each tile is 128x128 pixels. In total this image will be 768x512 pixels
    • 0 - Zoom level. 0 means maximum zoom in. Number of zoom levels depend's on Dynamp's configuration
    • majncraft.test.png - Output file name

    This should generate a 768x512 image:

    Preview from 6x4 grid

  4. Make a full size image in 20736x13824 resolution (162x108 tiles)

    Finally, we can make the full size image:

    $ dynmap-timemachine.py -v http://map.majncraft.cz/ world surface \
        [3300,65,-2630] [81,54] 0 majncraft.3320.full.png
    

    This takes a while because in total it needs to download 81 * 2 * 54 * 2 = 17496 tiles. The final image has 389 MB.

    The final image scaled down to 728px width

    You can download the full 20736x13824 size image for this example (389 MB) or a different, smaller 16384x10240 image (168 MB) if you just want to see what it looks like in full resolution.

2. Example - create timelapse video

Another use case is creating timelapse animations from multiple images captured from a Dynmap.

Usage is the same as capturing a single image but this time the last argument is not an output file name but it's a directory for timelapse images instead. File names are generated automatically. The script captures an image from Dynmap and then compares it with the last image in the directory. Only if these two are significantly different (by default 1% of pixels; you can change it with -t|--threshold) it saves the new image.

You can ideally schedule to run this script every few minutes when you're building something and it'll genereate series of images capturing your progress named by the time they were captured.

  1. Create a directory for timelapse images
$ mkdir images
  1. Run dynmap-timemachine.py periodically (eg. with cron)
$ dynmap-timemachine.py -v http://map.majncraft.cz/ world surface \
    [3300,65,-2630] [4,3] 0 images/

Note that this image should be relatively small because we want it to capture the map at this particular moment. That's why it can't take hours like the previous example.

minecraft-dynmap-timemachine's People

Contributors

kisaragieffective avatar martinsik avatar

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.