TopoMC: Minecraft Worlds From Real Data
2014 Jul 13 Update
Due to changes in Minecraft and the USGS, this project is on hiatus. It will be revived when the following issues are resolved:
Minecraft changes very quickly, and its changes often break tools like pymclevel. I do not have the time or the interest to roll my own equivalent to pymclevel, so I will wait until someone else does -- hopefully Mojang, but right now anyone who can keep up with the changes will do. On the bright side, I'm really liking Go so either language is good for me.
The USGS web services have become less and less useful over the past few years as they steer customers towards the National Map viewer. I am looking into bulk data transfers (i.e., sending them a hard drive upon which they write terabytes of data before sending it back to me) but then I have to figure out how to store that data in something like PostGIS such that I can retrieve what I need as I have from the USGS in the past. Making this change will also inconvenience anyone else running TopoMC since they too will have to solve the data problem, but if I do it right they can use the National Map viewer to download the portion of the United States that fits their requirements instead of the whole thing like me.
I welcome any assistance with these issues.
- a simple, well-maintained API for Minecraft level creation is available for Python or Go, and
- a replacement for the USGS web services is developed
Welcome to TopoMC!
The TopoMC project facilitates the construction of superficially realistic Minecraft worlds leveraging data from the USGS, specifically the NED and NLCD datasets.
- TopoMC now generates Anvil worlds with full 256-block heights thanks to @codewarrior0 and his changes to mcedit/pymclevel! Thank you!
- TopoMC also now runs on Windows! Kinda. I think. It works for me, anyway! See this for more details!
- The array and world code has been replaced with region-based code which improves accuracy while saving CPU and memory. The new commands to retrieve, prepare, and build regions are documented below.
- GPGPU support has been added. Yes, your video card can help you build Minecraft worlds! This latest feature relies on PyOpenCL but is optional.
- The landcover code has been rewritten to support the usage of MCEdit schematics as templates for certain areas, specifically croplands (farms) and developed areas. More information about this feature can be found here.
- pymclevel has been included as a submodule. This release of pymclevel includes an accelerated NBT module which must be compiled before use, as seen below. This module can have a significant impact on performance.
- The test dataset has been removed.
The following examples were selected as representative of various types of region: cities, natural features, water-related regions, and 'exotic' (i.e., outside the contiguous US) locales.
|SanFrancisco||--ymax 37.8238 --xmin -122.55 --ymin 37.7003 --xmax -122.344|
|Boston||--ymax 42.3846 --ymin 42.3119 --xmin -71.1032 --xmax -70.9824|
|NewYorkCity||--ymax 40.8846 --ymin 40.6763 --xmin -74.069 --xmax -73.890|
|Yosemite||--ymax 37.7597 --ymin 37.7196 --xmin -119.6112 --xmax -119.5445 --scale 7 --vscale 7 --trim 1205 --sealevel 2 --maxdepth 1|
|GrandCanyon||--ymax 36.1806 --xmin -112.004 -ymin 36.0124 --xmax -111.758 --scale 16 --vscale 16 --trim 735|
|MeteorCrater||--ymax 35.0406 --ymin 35.0106 --xmin -111.0353 --xmax -111.0102 --scale 1 --vscale 1 --trim 1562 --sealevel 8 --maxdepth 4|
|Yellowstone||--ymax 44.634 --ymin 44.331 --xmin -110.995 --xmax -110.652 --trim 2034|
|CraterLake||--ymax 42.9986 --ymin 42.8917 --xmin -122.189 --xmax -122.037 --trim 1652 --sealevel 16 --maxdepth 8|
|LakeTahoe||--ymax 39.282 --ymin 38.895 --xmin -120.190 --xmax -119.869 --scale 8 --vscale 8 --trim 1416 --sealevel 2 --maxdepth 1|
|BlockIsland||--ymax 41.2378 --ymin 41.1415 --xmin -71.6202 --xmax -71.5332|
|Arecibo||--ymax 18.3495 --ymin 18.3391 --xmin -66.7578 --xmax -66.7462 --trim 136|
|PearlHarbor||--ymax 21.3951 --ymin 21.2977 --xmin -158.0337 --xmax -157.923|
|PointBarrow||--ymax 71.3983 --ymin 71.2801 --xmin -156.85 --xmax -156.425|
Here's how to do it yourself, using Provincetown as an example:
- Import the pymclevel submodule. Must be done once!
git submodule init
git submodule update
- Retrieve the region from the USGS.
./GetRegion.py --name Provincetown --ymax 42.0901 --xmin -70.2611 --ymin 42.0091 --xmax -70.1100
- Prepare the region for building.
./PrepRegion.py --name Provincetown
- Build the region!
./BuildRegion.py --name Provincetown
Different users have different goals. Whether you want a Minecraft world you can actually play in, or whether you want to re-create a real-world area as accurately as feasible, there are ways to improve your results.
The GetRegion.py command has a number of optional arguments which can be used to improve the quality of results.
- Tile size can be changed.
- The default tile size is 256x256, but it can be changed. The only requirement is that it be a multiple of 16 (the chunk size). An example would be "--tilesize 64".
- Horizontal and vertical scaling can be changed.
- The horizontal and vertical scale, both of which default to 6, can be changed independently. The minimum horizontal scale is 1 with a practical maximum of 30. The minimum vertical scale is more complex, and essentially depends on the elevation change between the highest point in the region and sea level. An example scale would be "--scale 1 --vscale 1". Should the requested scale exceed valid parameters, the software will adjust the scale after informing the user.
- Sealevel and maximum depth can be changed.
- Sometimes the minimum vertical scale is too high. One way to improve this situation is to lower the sealevel from its default of 64 to something lower such as 16 or 8. The maximum depth should also be lowered as well. Keep in mind that this may have unexpected effects on ore distribution! An example sealevel and maximum depth would be "--sealevel 16 --maxdepth 8".
- Elevation can be trimmed!
- When lowering the sealevel isn't enough to reach your desired vertical scale, excess elevation can be trimmed. Elevation is considered excess if it is between sea level and the lowest point on the region. For example, if a region were selected such that its surface was between 200 and 300 meters above sea level, the 200 meters between sea level and the lowest point on the region could be trimmed. An example trim would be "--trim 200". If the trim value requested exceeds the valid limits, the software will adjust the trim value to the maximum allowed after informing the user.
TopoMC is open source under the MIT license and the source can be found at https://github.com/mathuin/TopoMC.
Jack Twilley <mathuin at gmail dot com>