stargate-rewritten / Stargate-Interfaces

An interaction addon for features that break StarGate's user-immersion principle (commands and GUIs that exist outside of gameplay)
https://sgrewritten.org/infosgi
GNU Lesser General Public License v3.0
0 stars 0 forks source link

sgc fix #12

Open EpicKnarvik97 opened 2 years ago

EpicKnarvik97 commented 2 years ago

As an alternative to Stargate validation for removing Stargates, it could make sense to be able to fix Stargates. This could be accomplished through a /sgc fix command.

This change requires gate designs to be available through the API, and is therefore postponed.

The basic idea: Use a Stargate's gate design to find which blocks should be placed where, and replace any invalid blocks. If a material tag is used instead of a material there should be some ways to handle this:

  1. Choose some random material. This should be the fallback if other methods fail.
  2. Optionally store the used material when a new Stargate is created (in a database, or just as YML). This would make it possible to perfectly restore the Stargate, but would take some additional storage space, and might be inefficient for huge Servers.
  3. Do a pattern analysis to figure out what's been removed. This requires looking for symmetry and antisymmetry (and possibly other types of patterns) and filling out the missing blocks.

Number 3 can be seen as an additional feature and is not required. The config should allow switching between 1, 2 and 3.