Skip to content

Metadata

NebSeniah edited this page Jul 24, 2026 · 3 revisions

System Summary

When exporting a level, the ImportExportManager generates Metadata from


Connected Systems

Connecting Systems:

Subsystems:

  • None

Related Controls

Key(s): (None)


Bugs

  • Metadata corruption could cause crashing.

Feature List / Breakdown of Features

Feature Name:

  • Metadata exports with the rest of the level, getting saved in Settings.JSON
    • Author
    • Date Created
    • Time Created
    • Date Modified
    • Time Modified
    • Dimensions
    • Objects
    • Version
    • Favorited
    • Validated
    • Playable
  • Metadata gets loaded from levels whenever they get clicked on in the main menu.

Important Variables

Name the most important variables, their type, and what their purpose is

  • author : Type = Description of this variable.
  • dateCreated : String = What date the level was first created, never gets overwritten.
  • timeCreated : String = What time the level was first created, never gets overwritten.
  • dateModified : String = What date the level was last modified and saved by exporting.
  • timeModified : String = What time the level was last modified and saved by exporting.
  • dimensions : Vector2 = The dimension of the level that was set upon first creating it, never gets overwritten.
  • objects : int = The number of tiles and entities that are present in the level, 0 means it is an empty level.
  • version : float = The version of the project that the level was last modified on, pulled from the global variable.
  • favorited : bool = True if the level is favourited, also shows up when importing a favourited level
  • validated : bool = True if the level was beaten before exporting, placing a new object after beating makes this false.
  • playable : bool = True if the level was playable when exported, meaning it has a player and at least one goal.

Important Functions

  • func make_new_level(newLevelName : String, levelAuthor : String, levelSize : Vector2i) -> void: Initially creates the level along with a default set of metadata.

  • func export_level(tileMap : TileMapLayer, playerData : Panel, worldSize : Vector2i, settings : Panel, isValidated : bool = false, isPlayable : bool = false) -> void: Exports a level, updates metadata for dataModified, timeModified, objects, version, validated, and playable.

  • func sort_levels_by_favorite(levelPaths: Array) -> Array: Sorts levels by their favorited value first, so if they are favourited they'll be first up.

  • func update_level_item(item: Node, folderName : String, levelPath : String) -> void: Updates a level when it is focused in the menu, loading all of the metadata to display to the user.


Future Work / Risks

Future Work:

  1. Favorited should be specific to the machine, possibly done by saving level names / IDs in settings.cfg as opposed to the level's metadata itself.

Risks:

  • Metadata corruption with improper typing might cause crashing.

Miscellaneous Notes

  • None

Clone this wiki locally