All work

Open source

Bringing features back to PGM, the open-source PvP Game Manager

My merged contributions to PGM, the open-source Minecraft PvP match plugin, including filtered respawns, score filters, flag drop filters and silent scoreboxes.

Open source · PGMDev · 2019 – 2020

The problem

PGM runs PvP matches from XML map files, and a lot of maps were written for features that got dropped when it was open-sourced and refactored. Those maps either broke or played differently.

What I built

In late 2020 I brought a set of them back, all merged:

Earlier in 2020 I added a setting so the map vote book only opens for players who want it, and made a left click on the team picker join you.

  1. Map XMLfilter, drop-filter, score
  2. FilterParserbuilds a Filter
  3. Modulestores it on the definition
  4. Queryplayer or party
  5. Resultallow, deny or abstain

How a filtered respawn is picked

A sketch of the idea, not the production code.

# parse
for el in map.children("respawns/respawn") + legacy_respawn_or_empty:
    options.add(RespawnOptions(delay, auto, blackout, spectate,
                filter = parse_filter_property(el, "filter", default = ALLOW)))

# at runtime
fn respawn_options(player):
    for o in options:
        if o.filter.query(player.query()).is_allowed():
            return o
    throw IllegalState("no respawn option matched")

# score filter
fn query(party):
    module = match.module(Score) or return ABSTAIN
    return party is Competitor and range.contains(module.score(party))

Why it matters

Old maps that people still loved could run again without being rewritten, and map makers got a few more tools for new ones.

Stack

Links