Toronto elevation model in Minecraft

Minecraft is a fascinating video game that remains popular with the pre-teen, teen, and post-teen crowds. You build and/or exploit a 3D world by manipulating blocks of various materials such as “stone”, “dirt”, or “sand”. In the footsteps of my colleague Pamela Robinson in the School of Urban and Regional Planning, and her student Lisa Ward Mather, I became interested in ‘serious’ applications of Minecraft. Lisa studied the use of the game as a civic engagement tool. Apparently, the blocky 3D nature of Minecraft worlds can be useful in planning to give viewers an idea of planned building volumes while making it clear that preliminary display are not architectural plans.

Taking a geographic perspective, I am interested in the potential of Minecraft to educate kids about larger areas, say the City of Toronto. In this post, I outline the conversion of a digital elevation model (DEM) into a Minecraft terrain. I imagine the output as a novel way for ‘gamers’ to explore and interact with the city’s topography. Some pointers to related, but not Toronto-specific work include:

  • GIS StackExchange discussion on “Bringing GIS data into Minecraft“, including links to the UK and Denmark modeled in Minecraft
  • A video conversation about “Professional Minecraft GIS“, where Ulf Mansson combined OpenStreetMap and open government data
  • Workflow instructions for converting “Historical Maps into Minecraft” using WorldPainter, which automatically converts DEMs into Minecraft terrain (if I had seen this before I started implementing the Python script outlined below…)
  • An extensive webinar on “Geospatial and Minecraft” by FME vendor Safe Software, touching on creating Minecraft worlds from DEMs, GPS, LiDAR, building information management, and the rule-based CityEngine software

The source data for my modest pilot project came from the Canadian Digital Elevation Model (CDEM) by Natural Resources Canada, accessed using the GeoGratis Geospatial Data Extraction tool at http://geogratis.gc.ca/site/eng/extraction. In QGIS, I converted the GeoTIFF file to ASCII Grid format, which has the advantage of being human-readable. I also experimented with clipping parts from the full DEM and/or reducing the raster resolution, since the first attempts at processing would have taken several hours. The QGIS 2.2 raster translate or clip operations ran a GDAL function along the following lines (see http://www.gdal.org/gdal_translate.html and http://www.gdal.org/formats_list.html for details):

gdal_translate -projwin [xmin ymin xmax ymax] -outsize 25% 25% -of AAIGrid [input_file.tif] [output_file.asc]

On the Minecraft side, you need an account (for a small cost), a working copy of the game, and an installation of MCEdit. Player accounts are sold and managed by the game’s developer company, Mojang, see https://minecraft.net/store/minecraft. The Minecraft software itself is launched from the Web – don’t ask about the details but note that I am using version 1.8.7 at the time of writing. MCEdit is a free tool for editing saved Minecraft worlds. It has an option to add functionality through so-called ‘filters’.

The MCEdit filter I wrote is “dem_gen.py”, a Python script that collects a few input parameters from the user and then reads an ASCII GRID file (currently hard-coded to the above-mentioned Toronto area DEM), iterates through its rows (x direction) and columns (y direction in GIS, z in Minecraft), and recreates the DEM in Minecraft as a collection of ‘columns’ (z direction in GIS, y in Minecraft). Each terrain column is made of stone at the base and dirt as the top-most layer(s), or of other user-defined materials.

I have freshly uploaded the very first version 0.1 to GitHub, see https://github.com/crinner/mc_dem_gen. (This also serves as my first developer experience with GitHub!) The general framework for an MCEdit filter and the loop creating the new blocks were modified from the “mountain_gen.py” (Mountain Generator) filter found at http://www.mediafire.com/download.php?asfkqo3hk0lkv1f. The filter is ‘installed’ by placing it in the filter subfolder in the MCEdit installation. The process then simply involves creating an empty world (I used a superflat world with only a bedrock layer) and running the DEM Generator filter. To run any filter in MCEdit, select an area of the world, press ‘5’, and select the filter from the list.

QGIS-screenshot_minecraft-DEM-project

Converting the 2,400 by 1,600 pixel CDEM dataset shown in the above screenshot of my QGIS project took about half a day on a middle-aged Dell Latitude E6410 laptop.  The screenshot below shows that many data “chunks” are missing from this preliminary result, perhaps an issue when saving the terrain in MCEdit.

toronto-dem1_chunky

With a coarser DEM resolution of 600 by 400 pixels and using a newer Dell XPS 12 tablet (!), the processing time was reduced to 10 or so minutes and the result is promising. In the following screenshots, we are – I believe – looking at the outlets of the Humber River and Don River into Lake Ontario. Note the large vertical exaggeration that results from the horizontal dimensions being shrunk from around 1 block = 20m to 1 block = 80m, while vertically 1 block corresponds to 5m.

2015-06-08_21.24.32

2015-06-08_21.25.35

There remain a number of challenges, including a problem translating the geographic x/y/z coordinate system into the game’s x/-z/y coordinate system – the terrain currently is not oriented properly. More thought also has to be put into the scaling of the horizontal dimensions vis-a-vis the vertical dimension, adding the Lake Ontario water level, and creating signs with geographic names or other means of orientation. Therefore, your contributions to the GitHub project are more than welcome!

Update, 10 June 2015: I was made aware of the #MinecraftNiagara project, which Geospatial Niagara commissioned to students in the Niagara College GIS program. They aim to create “a 1:1 scale representation of Niagara’s elevation, roads, hydrology and wooded areas” to engage students at local schools with the area’s geography. It looks like they used ArcGIS and the FME converter, as described in a section of this blog post: http://geospatialniagara.com/backlog-of-updates/. Two screenshots of the Lower Balls Falls near St. Catharines were provided by @geoniagara’s Darren Platakis (before and after conversion):

minecraftNiagara-screenshot1    minecraftNiagara-screenshot2

 

The @RyersonGeo Team at CAG 2015

Blog post by K.W.Forsythe and C.Rinner

The Canadian Association of Geographers (CAG) 2015 Annual Meeting is held at Simon Fraser University (Vancouver Campus) from June 1-5. A good number of faculty and students from Ryerson’s Department of Geography and Environmental Studies are taking part. The papers and sessions (in chronological order) are as follows, with the first one already running at the time of posting this list:

1) Tuesday June 2, 8:30 – Soil and Sediment Analysis (Harbour Centre 2050, Alan and Margaret Eyre Boardroom) Chair: Terence Day

Christine J. Valancius, K. Wayne Forsythe, Ryerson University; Chris H. Marvin, Environment Canada; James P. Watt*, CH2M
Using Geovisualization and Bathymetry to Assess Lead Sediment Contamination in Lake St. Clair

2) Tuesday June 2, 1:30 (Until 5.00 pm) – Poster Session 1 – The Arctic, Tourism, Conservation (Wosk Centre for Dialogue 320 Strategy Room)

Alexis Robinson, David Atkinson, Ryerson University
Spatially explicit hydrological model evaluation for a High Arctic watershed

3) Wednesday June 3, 8:30 – Vegetation Monitoring (Harbour Centre 2050, Alan and Margaret Eyre Board Room) Chair: Zhaoqin Li

Vadim Sabetski, Andrew A. Millward, Ryerson University
Virtual Daylighting: Enhancing Arboriculture Consulting Practices Through Tree Root Location with Ground‐Penetrating Radar

4) Friday June 5, 10:30 – Geographies of Crime 2 (Wosk Centre for Dialogue 420, Strategy Room) Special Session Organizers: Martin Andresen and Katherine Wuschke, Simon Fraser University, Chair: Martin Andresen

Shuguang Wang, Jarrett Moore*, Ryerson University
A GIS‐assisted analysis of journey‐to‐crime and activity space of offenders

Shannon Strelioff, Lu Wang, Ryerson University
Assessing the Predictive Power of Risk Terrain Modeling with respect to Street Level Robbery in the Regional Municipality of Durham, Ontario

5) Friday June 5. 10:30 – Sustainability and Land Classification Issues (Wosk Centre for Dialogue 470, Hamber Foundation Board Room) Chair: Scott Slocombe

Kaylin Chin, Richard R. Shaker, Ryerson University
Evaluating patterns of sustainability across the contiguous United States: Application of the United Nation’s Indicators of Sustainable Development Report

6) Friday June 5, 10:30 – Volunteered Geographical Information and the City: Sensing urban wellness with user‐generated data (Harbour Centre 2200, RBC Dominion Securities Meeting Room) Organizers: Colin Robertson, Wilfrid Laurier University, Rob Feick, University of Waterloo, Chairs: Colin Robertson and Rob Feick

Victoria Fast, Claus Rinner, Ryerson University
Putting place back into food: Durham’s local food VGI system

7) Friday June 5, 1:30 – “Bringing Housing Back In”: Immigrant Housing and Settlement Experiences in Canadian Cities (Wosk Centre for Dialogue 470, Hamber Foundation Board Room) Sponsorship: Diversity, Migration, Ethnicity and Race Study Group, Organizers of Special Session: Sutama Ghosh, Ryerson University; Carlos Texeira, University of British Columbia Okanagan, Chair: Sutama Ghosh

Sutama Ghosh, Ryerson University
Home as a Paradoxical Space: Experiences of Professional South Asian Mothers in Toronto

__________________________________
* denotes alumni co-authors

These presentations represent ongoing research in Geography, Environmental Studies, and GIScience, and involve students and alumni from our Geographic Analysis and Master of Spatial Analysis (MSA) programs in addition to a student in the PhD in Environmental Applied Science and Management. See you all in Vancouver!