Skip to content

Entity References, Entity Void, and Polymorph Bugfixes#433

Open
Zetaplx wants to merge 2 commits into
michaelchessall:persistence_testingfrom
Zetaplx:persistent-entity-id
Open

Entity References, Entity Void, and Polymorph Bugfixes#433
Zetaplx wants to merge 2 commits into
michaelchessall:persistence_testingfrom
Zetaplx:persistent-entity-id

Conversation

@Zetaplx

@Zetaplx Zetaplx commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

About the PR

Oh goodness... a lot actually. First and foremost this PR fixes a major bug with how polymorph works. The existing code will cause saves to fail to load as it relies on shunting an entity to a new empty and paused map. To resolve this, I created what I call the EntityVoidSystem which serializes entities and stores them in files that can be called back at a later date. Files are saved in a safe place and labeled with an entity's PersistentIdentifier so they are persistent safe.

As a side note (and as was my original goal before getting sucked down the polymorph rabbit hole), added a PersistentEntityReference data type to naturally hold onto PIDs in the future. Integrated into the PersistentIdentifierSystem and is the easiest way to modify existing systems to use PIDs.

Finally, since this has a lot to do with polymorphing, added a verb for admins to manually de-polymorph someone if they want to.

Note

I tested this as best as I could, but I am ultimately one person with one person's worth of time. There should be no game breaking bugs in this.

Why / Balance

  1. Bugfixes are important
  2. Expanding the capabilities of the PID to make it easier for people to use.

Technical details

Theres... there's a lot. Read the diffs or ask me if you have big questions. Comments are there to hopefully help too.

Requirements

Breaking changes

This may break existing code relying on the inner workings of the polymorph system. It should be plug and play and works with existing implementations but the #429 may need some tweaking, not sure.

Changelog

🆑

  • fix: Being polymorphed will no longer break the save!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant