Arnis: Generate any location from the real world in Minecraft Java Edition

This open source project written in Rust generates any chosen location from the real world in Minecraft Java Edition with a high level of detail.

By leveraging geospatial data from OpenStreetMap and utilizing the powerful capabilities of Rust, Arnis provides an efficient and robust solution for creating complex and accurate Minecraft worlds that reflect real-world geography and architecture.

Arnis is designed to handle large-scale data and generate rich, immersive environments that bring real-world cities, landmarks, and natural features into the Minecraft universe. Whether you're looking to replicate your hometown, explore urban environments, or simply build something unique and realistic, Arnis generates your vision.

Usage

Download the latest release or compile the project on your own.

Choose your area in Arnis using the rectangle tool and select your Minecraft world - then simply click on 'Start Generation'! The world will always be generated starting from the Minecraft coordinates 0 0 0 (/tp 0 0 0).

If you choose to select an own world, make sure to generate a new flat world in advance in Minecraft.

Minecraft version 1.16.5 and below is currently not supported, but we are working on it! For the best results, use Minecraft version 1.21.4.

How it works

The raw data obtained from the API (see FAQ) includes each element (buildings, walls, fountains, farmlands, etc.) with its respective corner coordinates (nodes) and descriptive tags. When you run Arnis, the following steps are performed automatically to generate a Minecraft world:

Processing Pipeline

  1. Fetching Data from the Overpass API: The script retrieves geospatial data for the desired bounding box from the Overpass API.
  2. Parsing Raw Data: The raw data is parsed to extract essential information like nodes, ways, and relations. Nodes are converted into Minecraft coordinates, and relations are handled similarly to ways, ensuring all relevant elements are processed correctly. Relations and ways cluster several nodes into one specific object.
  3. Prioritizing and Sorting Elements: The elements (nodes, ways, relations) are sorted by priority to establish a layering system, which ensures that certain types of elements (e.g., entrances and buildings) are generated in the correct order to avoid conflicts and overlapping structures.
  4. Generating Minecraft World: The Minecraft world is generated using a series of element processors (generate_buildings, generate_highways, generate_landuse, etc.) that interpret the tags and nodes of each element to place the appropriate blocks in the Minecraft world. These processors handle the logic for creating 3D structures, roads, natural formations, and more, as specified by the processed data.
  5. Generating Ground Layer: A ground layer is generated based on the provided scale factors to provide a base for the entire Minecraft world. This step ensures all areas have an appropriate foundation (e.g., grass and dirt layers).
  6. Saving the Minecraft World: All the modified chunks are saved back to the Minecraft region files.

FAQ

Wasn't this written in Python before?

  • Yes! Arnis was initially developed in Python, which benefited from Python's open-source friendliness and ease of readability. This is why we strive for clear, well-documented code in the Rust port of this project to find the right balance. I decided to port the project to Rust to learn more about the language and push the algorithm's performance further. We were nearing the limits of optimization in Python, and Rust's capabilities allow for even better performance and efficiency. The old Python implementation is still available in the python-legacy branch.

Where does the data come from?

  • The geographic data is sourced from OpenStreetMap (OSM)1, a free, collaborative mapping project that serves as an open-source alternative to commercial mapping services. The data is accessed via the Overpass API, which queries OSM's database.

How does the Minecraft world generation work?

  • The script uses the fastnbt cargo package to interact with Minecraft's world format. This library allows Arnis to manipulate Minecraft region files, enabling the generation of real-world locations. The section 'Processing Pipeline' goes a bit further into the details and steps of the generation process itself.

Where does the name come from?

  • The project is named after the smallest city in Germany, Arnis2. The city's small size made it an ideal test case for developing and debugging the algorithm efficiently.

I don't have Minecraft installed but want to generate a world for my kids. How?

  • When selecting a world, click on 'Select existing world' and choose a directory. The world will be generated there.

Arnis instantly closes again or the window is empty!

What Minecraft version should I use?

  • Please use Minecraft version 1.21.4 for the best results. Minecraft version 1.16.5 and below is currently not supported, but we are working on it!

The generation did finish, but there's nothing in the world!

  • Make sure to teleport to the generation starting point (/tp 0 0 0). If there is still nothing, you might need to travel a bit further into the positive X and positive Z direction.