Skip to content

Core API request: game data registry and runtime override helpers #11

Description

@tajemniktv

Player request context: create a Tweaker feature that can change game-changing literal float/integer values, such as base price, price multiplier, requirements, and similar balance values. The player specifically suggested intercepting JSON reading if most values are loaded from JSON.

This belongs partly in Core because reusable safe access to game data, override storage, validation, and reset/diagnostics should not be duplicated by every cheat/debug mod.

Current codebase check:

  • Core has settings, diagnostics, runtime services, icon/color UI helpers, economy helpers, node limit helpers, and registries.
  • I did not find a generic game-data override registry or safe runtime tweak API.
  • Cheats currently changes currencies/attributes directly, which is useful but too narrow for arbitrary balance values.

MVP Core scope:

  • Add a game data registry/override helper that can discover and expose editable numeric values from selected game dictionaries/resources.
  • Support read, preview, set override, clear override, and reset-to-original operations.
  • Store original values before modification.
  • Persist overrides only under explicit mod/settings keys.
  • Provide validation: numeric-only for MVP, min/max optional, reject unsupported paths.
  • Provide diagnostics/export of active overrides.

Implementation plan:

  1. Audit where game data is loaded/stored, especially JSON-derived dictionaries and autoloaded data structures.
  2. Define a stable path format for editable entries, e.g. Data.upgrades.<id>.cost or similar.
  3. Implement a Core helper service with:
    • list editable numeric entries,
    • get current/original value,
    • set override,
    • clear override,
    • clear all overrides.
  4. Add validation and safety checks so the UI cannot corrupt unsupported objects.
  5. Emit events when overrides change so consumers can refresh.
  6. Include active overrides in diagnostics/support dumps.

Acceptance criteria:

  • Core exposes a safe API for numeric data overrides.
  • Original values can be restored without restarting when possible.
  • Invalid paths/types are rejected with clear logs.
  • Active overrides can be inspected for debugging.
  • A cheat/debug UI can build on this without implementing its own unsafe reflection mess.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions