FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Built-in Codes: Cheats, Passwords & Console Commands Integration · Issue #1372 · RetroDECK/RetroDECK · GitHub

Built-in Codes: Cheats, Passwords & Console Commands Integration #1372

Description

Overview

This feature proposes adding support for built-in game codes:

  • Cheats
  • Passwords
  • Debug commands

It tracks cheats and console commands via the component_manifest.json or external <system>/<gamename>_codes.json files tied to specific game/system pairs that is stored in retrodeck/codes/<system>/<gamename>_codes.json.

Unlike Action Replay or Game Genie codes, this implementation targets traditional cheat codes, passwords and developer console commands that is inside the game itself.

Primary Goal: Enable dynamic button triggers, in game documentation and accessible menus for activating in-game cheats / console commands in a standardized, extensible manner.


The Problem

The system needs to identify the active controller and determine whether Steam Input is managing input translation, as this affects how simulated inputs are delivered to the game.

  • Query the Steamworks API to detect if Steam Input is active for the current game session? https://partner.steamgames.com/doc/features/steam_controller
  • Fall back to platform-native controller APIs like evdev when Steam Input is not detected? But how-to detect what input order is correct? Or check InputPlumber as it has been added to most gaming distros including SteamOS?
  • Keyboard commands how-to send them?

Supported Code Types

Type Description Example
Console Commands Engine-level debug commands or developer console inputs Quake commands
In-Game Console Codes Traditional sequence-based codes entered via in-game menus Konami Code, password systems
In-Game Keyboard Codes Keyboard input sequences recognized by the game engine idkfa, iddqd in Doom

JSON Schema

Global Fields

Applies to all code entries regardless of input type.

Field Type Description
id string Unique identifier for the code
name string Human-readable display name
requirement string Where to enter the code (e.g., password menu, pause menu, start screen, in-game)
description string Description of what the code does

Code Types (code_type)

Classifies what type of code it is.

Value Description
cheat Cheat code
password Password
debug Debug command

Input Types (input_type)

Defines the mechanism used to deliver inputs to the game.

Value Description Example Payload
keyboard Simulated keypresses sent via keyboard input iddqd, idkfa for DOOM
controller Simulated gamepad button sequences Konami Code on NES controller
console Text piped directly to a built-in debug console god, noclip in Quake-style engines

Input Methods (input_method)

Defines how inputs are delivered to the game.

Value Description
sequence Inputs sent in order with a configurable delay between each press
simultaneous All inputs pressed and released simultaneously
hold Inputs held for a specified duration
text Raw string sent to console or stdin (no key simulation)

Payload (payload)

Defines the actual data sent to the game engine.

Field Applicable With Type Description
command All input_type values string or string[] The command to send — buttons, text, or keyboard presses depending on input_type
time_ms input_method: sequence, hold number Delay between button presses (for sequence) or hold duration (for hold), in milliseconds
controller_port input_type: controller number Which controller port should send the command (some games accept cheat codes on Player 2's controller)

Example Manifest

Example

UZDoom

https://www.doomwiki.org/wiki/Doom_cheat_codes

{
    "codes": [
      {
        "id": "god-mode",
        "name": "God Mode",
        "requirement": "In game",
        "description": "Toggles invulnerability.",
        "input_type": "keyboard",
        "code_type": "cheat",
        "input_method": "sequence",
        "payload": {
          "command": ["i", "d", "d", "q", "d"],
          "time_ms": "50"
        }
      },
      {
        "id": "full-arsenal",
        "name": "Full Arsenal",
        "requirement": "In game",
        "description": "Grants all weapons, ammo, and keys.",
        "input_type": "keyboard",
        "code_type": "cheat",
        "input_method": "sequence",
        "payload": {
          "command": ["i", "d", "k", "f", "a"],
          "time_ms": "50"
        }
      }

Quake

In the central manifest we add how-to open the console

"console_trigger": "~",

 "codes": [
      {
        "id": "god-mode",
        "name": "God Mode",
        "requirement": "In game",
        "description": "Enables invulnerability.",
        "code_type": "cheat",
        "input_type": "console",
        "input_method": "text",
        "payload": {
          "command": "god"
        }
      },
      {
        "id": "noclip",
        "name": "Noclip",
        "requirement": "In game",
        "description": "The player can move through solid objects, such as walls.",
        "code_type": "cheat",
        "input_type": "console",
        "input_method": "text",
        "payload": {
          "command": "noclip"
        }
      },      
       {
        "id": "r_drawentities",
        "name": "r_drawentities 0 - Hide all",
        "requirement": "In game",
        "description": "Sets r_drawentities to 0 and hides any entity models in the game (weapons, enemies, doors etc...)",
        "code_type": "debug",
        "input_type": "console",
        "input_method": "text",
        "payload": {
          "command": "r_drawentities 0"
        }
      }


VCMI - Heroes of Might and Magic III

In the central manifest we add how-to open the console

"console_trigger": "tab",

 "codes": [
      {
        "id": "all-spells",
        "name": "All spells",
        "requirement": "In game",
        "description": "Give a spell book, all spells and 999 mana.",
        "input_type": "console",
        "input_method": "text",
        "payload": {
          "command": "nwcthereisnospoon"
        }
      },

NES - Contra

The Contra is sourced from external json file stored in retrodeck/codes/nes/contra.nes_codes.json

 "codes": [
      {
        "id": "konami-code-30-lives-player-1",
        "name": "Konami Code (30 Lives) for Player 1",
        "requirement": "Enter at the title screen.",
        "description": "Classic Konami Code to grant 30 extra lives.",
        "input_type": "controller",
        "input_method": "sequence",
        "payload": {
          "command": ["up", "up", "down", "down", "left", "right", "left", "right", "b", "a", "start"],
          "time_ms": "50",
          "controller_port": "1"
        }
      },
      {
        "id": "konami-code-30-lives-player-2",
        "name": "Konami Code (30 Lives) for Player 2",
        "requirement": "Enter at the title screen.",
        "description": "Classic Konami Code to grant 30 extra lives.",
        "input_type": "controller",
        "input_method": "sequence",
        "payload": {
          "command": ["up", "up", "down", "down", "left", "right", "left", "right", "b", "a", "start"],
          "time_ms": "50",
          "controller_port": "2"
        }
      }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status
    Backlog: Categorise

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


    Back | FazBrowse Home | New Git URL