Skip to main content

A General-Purpose Geometry Dash framework for safe and easy level editing and scripting

Project description

Python Badge Framework License Level Editor

gmdbuilder

A type-safe general-purpose Python framework for Geometry Dash level editing and scripting.

gmdbuilder lets you:

  • Read & write GD levels
  • Autoscan to protect against bugs (property types/ranges, spawn limit, no empty triggers, etc.)
  • Work directly with triggers, groups, and objects - and choose your own abstractions
  • Use pre-built systems and templates to accelerate development
  • Know exactly what's happening in your scripts

gmdbuilder is developed in collaboration with HDanke, the creator of gmdkit (a dependency of this framework) and his unofficial GD Editor Docs.

Documentation (WIP)

(No overengineered language was made in the making of this project)

Why Python?

Python fits surprisingly well as a language for GD scripting:

  • Exceptionally good at building/verifying dictionaries (which all GD objects are)
  • Operator overloading for counters and other special logic
  • Any programming paradigm that you want is well supported
  • Reliable type system with good debugger/type-checker tooling
  • Huge package ecosystem

Installation

Install the latest release from PyPI:

pip install gmdbuilder

Install the latest development version from GitHub:

pip install git+https://github.com/LXtreme/gmdbuilder.git

Getting Started

from gmdbuilder import level

# From .gmd file, supports full object editing/deleting
level.from_file("example.gmd")

# From WSLiveEditor, only supports adidng objects
level.from_live_editor()

obj_list = level.objects # mutations are validated

# Object properties are in the form { "a<key number>": value }
repr(obj_list[1])

from gmdbuilder import obj_prop   # property key str Literals
from gmdbuilder import enum       # enum values for object properties
from gmdbuilder import obj_id     # object ID int Literals

# Similar to 'next' button in the editor.
a = level.new.group()

from gmdbuilder import is_obj_type, is_obj_id, from_object_string, new_obj
import gmdbuilder.object_types as td # TypedDict dictionaries

ppt = obj_prop.Trigger

for obj in obj_list:
    # is_obj_id and is_obj_type are both TypeGuards. 
    # Allows editing generic object lists to be done fully type-safe
    if is_obj_id(obj, obj_id.Trigger.MOVE):
        obj[obj_prop.GROUPS] = { a }
        obj[ppt.Move.EASING] = obj_enum.Easing.NONE
    if is_obj_type(obj, td.MoveType):
        obj[ppt.Move.USE_SMALL_STEP] = True


filter = {
    obj_prop.ID: obj_id.Trigger.COUNT
    obj_prop.GROUPS: { 15 }
}
obj_list.delete_where(filter)
obj_list.delete_where(lambda obj: obj[ObjProp.ID] == 1)


# CountType is a typed_dict, allowing per-field static type checking
# Translates to { a1: 1611, a2: 50, a3: 45 }
object = from_object_string("1,1611,2,50,3,45;", obj_type=td.CountType)
object[ppt.Count.ACTIVATE_GROUP] = True
object[ppt.Count.TARGET_ID] = a
object["a2"] = 50 # also validated and provides type info

move = new_obj(obj_id.Trigger.MOVE)   # casts to MoveType typed_dict automatically
instant_count = new_obj(1611)         # casts to InstantCountType typed_dict

obj_list.append(object)
obj_list.extend([move, instant_count])

# Export object edits, deletions and additions
# Added objects recieve the tag_group
level.export_to_file(file_path="example_updated.gmd")
level.export_to_live_editor()

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

gmdbuilder-0.2.1.tar.gz (48.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gmdbuilder-0.2.1-py3-none-any.whl (49.8 kB view details)

Uploaded Python 3

File details

Details for the file gmdbuilder-0.2.1.tar.gz.

File metadata

  • Download URL: gmdbuilder-0.2.1.tar.gz
  • Upload date:
  • Size: 48.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for gmdbuilder-0.2.1.tar.gz
Algorithm Hash digest
SHA256 d055e958a9ae294cd6d9b82feb3be26a39b11c945c0ac363dd11fe16756328cb
MD5 9908e0122b69757ed4eb6901ac2fab95
BLAKE2b-256 1b4ebb957d1a19523e4818e87fd9f96b962dd80595f0545d1345f1cff22dbb6c

See more details on using hashes here.

Provenance

The following attestation bundles were made for gmdbuilder-0.2.1.tar.gz:

Publisher: release.yml on LXtreme/gmdbuilder

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gmdbuilder-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: gmdbuilder-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 49.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for gmdbuilder-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4691f1dbacc9ebf35365165a5b9cc5eaf8c1bf5278c604d640749bba0d1e71ad
MD5 feec02d7ff940e2dd893c7b3256252fe
BLAKE2b-256 2786e765d650da5c21a513f38e4cca29731faadf116be064c8f78ff2fcd1fae7

See more details on using hashes here.

Provenance

The following attestation bundles were made for gmdbuilder-0.2.1-py3-none-any.whl:

Publisher: release.yml on LXtreme/gmdbuilder

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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