Dynmap-timemachine.py

마인크래프트Dynmap 플러그인으로 생성된 웹 지도 서버에서 타일을 다운로드하고 인쇄에 적합한 매우 높은 해상도의 단일 이미지를 제작할 수 있는 Python 2.7, 3.3+ 및 PyPy 명령줄 스크립트이다.

모든 매개 변수 보기:

$ 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

설치

pip를 사용하면 쉽고 간편합니다.

  • $ pip install dynmap_timemachine
  • $ pip3 install dynmap_timemachine - python3

사용

다음은 플레이시티 블록에서 사용하는 설정입니다. 이를 참고하여 사용해주세요. 제작 방식의 문제로 이미지 제작에 시간이 다소 소요될 수 있습니다.

1:1 지도란, dynmap-timemachine.py 스크립트를 사용했을 때 1px = 1블록에 대응되는 이미지를 의미합니다.

주간 업데이트 그룹

  • 자유섬 1:1 추적 지도 dynmap-timemachine.py http://map.throgo.com block16 flat [-17320,64,4572] [22,22] 2 block16-freee-230520.png
  • 자유섬 1:1 추적 지도 입체 dynmap-timemachine.py http://localhost:8120 block16 surface [-17320,64,4572] [29,15] 2 block16-freee3d-240313.png
  • 서버 전체 지도 dynmap-timemachine.py http://map.throgo.com block16 flat [0,64,480] [64,64] 4 block16-all2-240313.png

도시 별 1:1 지도 및 기준 좌표

아래 명령어는 5월 기준으로 최신 명령어와 다소 일치하지 않을 수 있습니다.

  • 좌표 변환 방법론
  • 극점 좌표
최북단 (최대 y 값): y 좌표 중 가장 큰 값
최서단 (최소 x 값): x 좌표 중 가장 작은 값
최동단 (최대 x 값): x 좌표 중 가장 큰 값
최남단 (최소 y 값): y 좌표 중 가장 작은 값
  • 중앙값 계산 및 128의 배수로 조정

중앙값을 계산하고 이를 128의 배수로 가장 가까운 값으로 조정합니다.

x 중앙값: (최서단 + 최동단) / 2 → 가장 가까운 128의 배수로 반올림
y 중앙값: (최북단 + 최남단) / 2 → 가장 가까운 128의 배수로 반올림
  • 거리 정보 계산

동서 및 남북 길이를 128으로 나누고, 소수점은 올림하여 거리 정보를 구합니다.

동서 길이 (a): ceil((최동단 - 최서단) / 128)
남북 길이 (b): ceil((최북단 - 최남단) / 128)
  • 최종 좌표 및 거리 정보 포맷팅
좌표 형식: [x,64,y]
x: 중앙값으로 조정된 x 좌표
y: 중앙값으로 조정된 y 좌표
거리 정보 형식: [a,b]
a: 동서 길이 정보
b: 남북 길이 정보

컴퓨터 성능은 조금이라도 절약할 수록 이득이니까, 효율적인 좌표를 자동으로 계산해주는 python 스크립트

import math

def ceil_division(value, divisor):
    return math.ceil(value / divisor)

def closest_multiple_of_128(value):
    return round(value / 128) * 128

def transform_coordinates(coordinates):
    # 좌표 분리
    x_coords = [coord[0] for coord in coordinates]
    y_coords = [coord[1] for coord in coordinates]
    
    # 최북단, 최서단, 최동단, 최남단 찾기
    north = max(y_coords)
    south = min(y_coords)
    west = min(x_coords)
    east = max(x_coords)
    
    # 중앙값 계산 및 128의 배수로 조정
    x_center = closest_multiple_of_128((west + east) / 2)
    y_center = closest_multiple_of_128((north + south) / 2)
    
    # 거리 정보 계산
    a = ceil_division(east - west, 128)
    b = ceil_division(north - south, 128)
    
    # 결과 포맷
    coordinate_str = f'[{x_center},64,{y_center}]'
    distance_str = f'[{a},{b}]'
    
    return f'{coordinate_str} {distance_str}'

# 예제 사용(원하는 극점 좌표로 대체)
coordinates_example = [
    (888, -1821),
    (503, -1494),
    (1213, -1474),
    (934, -1156)
]

result = transform_coordinates(coordinates_example)
print(result)  # Output: [1024,64,-1280] [6,6]

청라특별시, 평천군, 북청군

  • dynmap-timemachine.py http://mc.throgo.com:8120 block16 flat [-1000,64,2000] [20,39] 2 block16-cheongna-240501.png
  • dynmap-timemachine.py http://localhost:8120 block16 flat [5555,64,432] [29,21] 2 block16-pyeongcheon-240501.png
  • dynmap-timemachine.py http://localhost:8120 block16 flat [-4256,64,-3120] [20,18] 2 block16-bukcheong-240501.png

남해도

청산도

해강도

염안도

미등록