Skip to main content

The Generative Design Python Client (GDPC) is a Python-based interface for the Minecraft GDMC HTTP Interface mod.\nIt was created for use in the Generative Design in Minecraft Competition (GDMC).

Project description

GDPC

GDPC (Generative Design Python Client) is a Python framework for use in conjunction with the GDMC-HTTP mod for Minecraft Java edition. It is designed for the Generative Design in Minecraft Competition (GDMC).

You need to be playing in a Minecraft world with the mod installed to use the framework.

The latest version of GDPC is compatible with GDMC-HTTP versions >=1.0.0, <2.0.0 and Minecraft 1.20.2 (see note).

Quick example

from gdpc import Editor, Block, geometry

editor = Editor(buffering=True)

# Get a block
block = editor.getBlock((0,48,0))

# Place a block
editor.placeBlock((0,80,0), Block("stone"))

# Build a cube
geometry.placeCuboid(editor, (0,80,2), (2,82,4), Block("oak_planks"))

What's the difference between GDMC, GDMC-HTTP and GDPC?

These abbreviations are all very similar, but refer to different things.

GDMC: Short for the Generative Design in Minecraft Competition, a yearly competition for generative AI systems in Minecraft. The challenge is to write an algorithm that creates a settlement while adapting to the pre-existing terrain. The competition also has a Discord server.

GDMC-HTTP: A Minecraft Forge mod that provides a HTTP interface to edit the world. It allows you to modify the world live, while you're playing in it. This makes it possible to iterate quickly on generator algorithms. The mod is an official submission method for the competition.

GDPC: This repository (notice the "P"). A Python framework for interacting with the GDMC-HTTP interface. It provides many high-level tools that make working with the interface much simpler.

Installation

GDPC requires Python 3.7 or above. It is available on PyPI; to install, run:

python3 -m pip install gdpc

To update, run:

python3 -m pip install --upgrade gdpc

On Windows, you may need to replace python3 with py.

If you would like to install the latest cutting-edge development version directly from GitHub, replace gdpc with
git+https://github.com/avdstaaij/gdpc
For more information on installing from GitHub (such as getting old versions), see the pip documentation.

Tutorials and examples

There are various tutorial scripts that will help to get you started:

Tutorial Description
Hello block Place and retrieve a single block in the world.
Vectors Use vector math and some of GDPC's various vector utilities.
Build area Get the specified build area and use it to place a block inside the bounds.
World slice Load and use a world slice for faster read access.
Geometry Use the geometry module to place geometrical regions of blocks.
Advanced blocks Place blocks with block states and block entity data, and use block palettes.
Editor performance Use the Editor class's various optional performance features.
Transformation Use GDPC's powerful transformation system.

Some practical examples are also available, though they're slightly older and may not reflect the latest features:

Example Description
Visualize map Displays a map of the Minecraft world using OpenCV.
Emerald city Demonstrates basic GDPC functionality by building a simple model of the Emerald City.

Note: the links above always point to tutorials/examples for the latest release of GDPC. To view the examples for an older version, switch to the tag for that version (using the dropdown box at the top left of the file list, where it probably says "master"), and manually navigate to the examples.

Note on supported Minecraft version

We list a specific compatible version of Minecraft, but most of GDPC actually supports a wide range of Minecraft versions. In particular, basic block getting and setting should work with any Minecraft version for which there is a compatible version of GDMC-HTTP. The parts of GDPC that may not be compatible with Minecraft versions other than the listed one are those that interact with "Minecraft data". These include:

  • Rotation and flipping of individual blocks.
  • Utility functions from the minecraft_tools and editor_tools modules that generate Minecraft data, such as bookData and placeSign.
  • The WorldSlice class and associated functions like Editor.loadWorldSlice().

We are working on fully supporting multiple versions of Minecraft simultaneously (#99), but this probably won't be done soon.

Contributing

See CONTRIBUTING.md for information about how to contribute.

Acknowledgements

GDPC was progressively developed with the help of various members of the GDMC community. Of special note are Niki Gawlik, who started both GDMC-HTTP and GDPC, and Blinkenlights, who previously maintained the project.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gdpc-7.0.0.tar.gz (64.9 kB view details)

Uploaded Source

Built Distribution

gdpc-7.0.0-py3-none-any.whl (66.0 kB view details)

Uploaded Python 3

File details

Details for the file gdpc-7.0.0.tar.gz.

File metadata

  • Download URL: gdpc-7.0.0.tar.gz
  • Upload date:
  • Size: 64.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.8.10

File hashes

Hashes for gdpc-7.0.0.tar.gz
Algorithm Hash digest
SHA256 af547f6209df6b24eb0e1f0587893136a7679ed762eb5e2b2658f85ed02a6bd7
MD5 75b03a2ef8c29a4ed05935ba8139e1ff
BLAKE2b-256 3acd0c15c5bfdc1ed3bc86389caa274765454b93ffa4b58a2262dbce7905135d

See more details on using hashes here.

File details

Details for the file gdpc-7.0.0-py3-none-any.whl.

File metadata

  • Download URL: gdpc-7.0.0-py3-none-any.whl
  • Upload date:
  • Size: 66.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.8.10

File hashes

Hashes for gdpc-7.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ebd65fcd12707fd33a7a7e6c16eac4f91b49bcda590bde300d1333bf7eb4c258
MD5 e0517d76c388a762cc9818875842592a
BLAKE2b-256 ffcb0d1105d3f4a7f8a1b5ae3a6d446fe71b37885c14538f2c8010a6f6490b09

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page