A downloadable asset pack

Get this asset pack and 8 more for $35.91 USD
View bundle
Buy Now
On Sale!
80% Off
$19.99 $3.99 USD or more

Quarry2D: Destructible 2D terrain for Godot 4


  • Dig and build with circles, rectangles, polygons or images, at runtime
  • Materials with hardness (rock takes four hits, bedrock cannot be dug) and anchoring
  • Looks out of the box: grass, cave rock, pixel art, with edge strips and decorations
  • Collision that is made for you and kept up to date
  • Falling pieces: you get a signal when a dig cuts something loose
  • Thirteen demos, side view and top-down, including a complete little digging game you can read and reuse


Dig in three lines

@onready var terrain: Quarry2D = $Quarry2D

func _ready():
    terrain.add_rect(Rect2(-600, 200, 1200, 400))   # some ground

func _unhandled_input(event):
    if event is InputEventMouseButton and event.pressed:
        var p = terrain.get_local_mouse_position()
        if event.button_index == MOUSE_BUTTON_LEFT:
            terrain.carve_circle(p, 40)    # dig
        else:
            terrain.add_circle(p, 40)      # build
is_solid(), get_material_at() and raycast() are right immediately after an edit. The drawing and collision catch up at the end of the frame.

Install

Copy the addons/quarry2d folder from the zip into your project's addons folder. That is all: it is a GDExtension, so there is no plugin to enable. The Quarry2D node and its helper classes appear in Godot, and pressing F1 and searching for "Quarry" opens their documentation. To see it work first, open addons/quarry2d/demos/demo_selector.tscn and run it.


Your first terrain

Start the ground three ways, and mix them freely:

  • Paint it. Set Initial Image on the node: one pixel is one cell, alpha is how solid it is, and a palette maps colours to materials. Edit the image in any editor and the level changes, in the 2D view too.
  • Build it from shapes. add_rect, add_circle, add_polygon and add_image to build, and carve_* to dig. All of them are one line, with an optional material.
  • Generate it. set_cells() takes whole arrays at once, so a noise or cave generator fills a big area in one call.

Make it fit your game

Every material has its own look, and every part of it can be replaced. The presets are a starting point.

  • Fill and edge: your own textures and tint, with separate edge strips for ground, walls and ceilings, and a width and offset to set how far the strip overhangs.
  • Decorations: as many as you like per material (grass, pebbles, stalactites), each with its own density, slope range, size, tilt and pixel snapping.
  • Pixel art: blocky cells, pixel-exact strips and nearest-neighbour filtering.
  • Shaders: a ShaderMaterial on any material for animation, glow or normal maps.
  • Side view or top-down: one property, view, and every look follows.

What you get

  • Smooth or blocky. Marching squares for rounded ground, or square cells with the pixel-art looks. Switching never loses terrain.

  • Side view or top-down. One property, view, and every look is drawn for the way you see the terrain.

  • Islands. island_detached fires when a dig cuts a piece loose; detach() turns it into a RigidBody2D with convex shapes. The search only runs while you listen.

  • Level images. Paint a map in any image editor, one pixel per cell. It shows in the editor too.
  • Save and netcode. serialize() and deserialize() the whole map. get_hash() is identical on Windows and Linux for the same edits, so a networked game can send only the edit commands and catch a desync.
  • Everything documented in the editor's help, plus a README.

The digger example

A finished little game built on Quarry2D: dig down, haul ore up, sell it, buy upgrades, dig deeper. Plain GDScript you can read, copy and change, or delete if you do not want it.


Works with other add-ons!!

Quarry2D 1.1 can be followed by other libraries while the terrain changes, with nothing to connect. They are separate products, each also at version 1.1:

  • Aqua2D: liquid that flows into what you dig
  • Glance2D: vision cones that rock blocks
  • Beckon: pathfinding through the tunnels you dig
  • Hail: bullets that collide with the terrain

You need 1.1 of both products for a pair to work together. Quarry2D works fine on its own.



Fast

Its C++ multithreaded nature makes it a blazing fast system that wont slow your game down.

In the zip

The compiled add-on for Windows and Linux (no C++ source), the demos and the digger example, a README and the license. Godot 4.7 or newer, 64-bit.

License

One license per developer. Use it in any number of your own projects, commercial or not, and ship it inside your games. You may not resell, share or redistribute Quarry2D itself.

Support

Questions and bug reports: in the comments!. Updates for the same major version are free.

Purchase

Get this asset pack and 8 more for $35.91 USD
View bundle
Buy Now
On Sale!
80% Off
$19.99 $3.99 USD or more

In order to download this asset pack you must purchase it at or above the minimum price of $3.99 USD. You will get access to the following files:

quarry2d-1.1.0.zip 1.9 MB

Comments

Log in with itch.io to leave a comment.

Hi, this has been added to the Godot Dev Libs bundle which I already purchased. Can you add the ability to download this for those who have already bought the bundle? Thanks!

Yes! I'm just doing that, I still don't know how to operate itch's bundles, but as soon as I'm able to create a key or something like that i will share it! Also update 1.1 of the other libs is coming soon too!

All righty, thank you :) No problem. 

Hi, I sent you an email with the key to claim it! Thanks again for the support.