Interaction feedback

Makes interactions visible without deciding any of them: the designated object lights up, nearby interactive objects get a discreet hint, and an attached prompt shows the action and the key of the active device.

Source: module-kits:kits/interaction_feedback/usage/en.mdView Markdown source

Also read offline — CLI: grip-forge docs interaction-feedbackMCP tool: gripforge_docs { "topic": "interaction-feedback" }

Interaction feedback (interaction.feedback) #

What it is for #

Makes interactions visible without deciding any of them: the designated object lights up, nearby interactive objects get a discreet hint, and an attached prompt shows the action and the key of the active device.

It needs game.engine; installing it brings them in.

Turn it on #

Install the kit in a project, then change a setting (the values shown are its defaults):

gripforge_gamekit_install   { project_id: "gkp_…", id: "interaction.feedback" }
gripforge_gamekit_configure { project_id: "gkp_…", id: "interaction.feedback",
                              config: { "style": "default", "highlight": false } }

First example #

<!-- test: kits/game_engine/host/tests/interaction_feedback.rs::nothing_is_shown_by_default --> This is the body of the passing test nothing_is_shown_by_default; the helper functions it calls are defined at the top of the same test file.

#[test]
fn nothing_is_shown_by_default() {
    // 1.4.0: no key on screen by default — the prompt on the object and at the wheel only when the game turns them on.
    // 1.5.0: no element at all — nothing is drawn, lit or played until the game turns one on.
    let mut s = session(json!({}));
    yard(&mut s);
    op(&mut s, json!({ "op": "step", "ticks": 1 }));
    press(&mut s, "KeyE");
    assert!(
        !s.host
            .recorded
            .iter()
            .any(|e| e.topic == "interaction.feedback.pulse"),
        "no pulse the game did not ask for"
    );
    assert_eq!(
        call(&mut s, "interaction.feedback", "drawsPrompt", json!([])),
        json!(false)
    );
    let view = call(&mut s, "interaction.feedback", "view", json!(["en"]));
    assert_eq!(view["elements"]["worldPrompt"], json!(false));
    assert_eq!(view["elements"]["vehicleExit"], json!(false));
    assert_eq!(view["elements"]["highlight"], json!(false));
    assert_eq!(view["visible"], json!(false));
    assert_eq!(view["pulses"], json!([]));
    // Turned on by the game: shown.
    let mut on = session(json!({ "highlight": true }));
    let view = call(&mut on, "interaction.feedback", "view", json!(["en"]));
    assert_eq!(view["visible"], json!(true));
    assert_eq!(view["elements"]["highlight"], json!(true));
}

Settings and defaults #

Descriptions come from the kit manifest and stay in English.

SettingTypeDefaultRange or valuesMeaning
stylestring"default"Id of a feedback_styles document: default, subtle, bold, retro, or the game's own.
highlightbooleanfalseLight up the designated interactive.
nearbyHintbooleanfalseA discreet hint over the interactives near the player.
worldPromptbooleanfalseThe prompt attached to the designated interactive, with its key (ui.prompts then leaves its context row to it).
cursorbooleanfalseThe cursor of the kind under the pointer (click games).
holdGaugebooleanfalseA gauge while the action is held.
confirmbooleanfalseA pulse when a use happens.
failbooleanfalseA pulse and the reason when a use is refused (too far, locked).
soundbooleanfalseThe sounds of the kinds (audio.core).
moveMarkerbooleanfalseA marker on the ground for a move order (when ui.cursor does not mark it).
orderMarkerbooleanfalseA marker on the target of an order.
vehicleExitbooleanfalseOff by default (1.4.0, it shows a key).
vehicleSchemestring"vehicle"1.1.0: the input.scheme scheme of a player at the wheel.
hintRadiusnumber61–30Metres around the player where interactives get a hint.
maxHintsinteger60–16At most this many hints, nearest first.
intensitynumber10–1Strength of every effect (the player may lower it further).
confirmSecondsnumber0.450.1–3
failSecondsnumber1.40.2–5
markerSecondsnumber0.60.15–3

Services, events, variables #

  • Service interaction.feedback: view(lang) — what every renderer draws (focus with its role, nearby, cursor, pulses, markers, style, elements); drawsPrompt(); attached(); kinds(); styles(); kindOf(entity); pulse(entity, type, reason).
  • Service interaction.feedback.settings: The player's settings (keys, get, set): intensity 0..1 and each element 1 on / 0 off; saved.
  • Events emitted:
    • interaction.feedback.pulse (entity, type, reason) — A use (confirm) or a refusal (fail, with its reason) was shown on an entity.
    • fx.ground_marker (position, color, seconds, size, style) — moveMarker: a move order marked on the ground (the renderers draw it).
  • Events listened to: interaction.completed, interaction.requested, interaction.refused, access.blocked, vehicle.entered, vehicle.exited, pointer.command, input.intent.issued, engine.data.changed, engine.config.changed
  • Variables:
    • interaction.feedback.focus (string) — Interaction feedback target
    • interaction.feedback.cursor (string) — Interaction cursor

Hooks and modding #

  • Moddable settings: style, highlight, nearbyHint, worldPrompt, cursor, holdGauge, confirm, fail, sound, moveMarker, orderMarker, vehicleExit, hintRadius, maxHints, intensity, confirmSeconds, failSeconds, markerSeconds, vehicleScheme
  • Moddable collections: interaction_kinds, feedback_styles
  • Components: interaction_feedback

Engines #

Declared targets: web, rust. gripforge kit api interaction.feedback lists the exact settings and services of your version.

Nothing shown unless the game asks (1.5.0) #

Every element is off by default (highlight, holdGauge, confirm, fail and sound were on before). While none is on, view().visible is false: no highlight, no ring, no prompt, no pulse, no sound, and the presentation module reads nothing. Turn on the elements your game wants, for example { "highlight": true, "holdGauge": true }. A game that already wrote an element keeps its value.

Versions #

Kit version 1.5.0.

<!-- kit-services:begin -->

Services this kit uses (and that you can provide) #

CapabilityRequiredMethods
audio.coreoptionalplay
character.controloptionalplayer
engine.contentoptionalregisterComponent
i18n.textoptionalhas, language, t, text
input.actionsoptionaldevice, promptFor
input.schemeoptionalscheme, target
interaction.promptoptionalaction, label, locked, progress, target
interaction.useoptionalkindOf, labelOf
ui.cursoroptional—

Any brick can serve them: a kit, or your engine (Godot provide_service, Unity Provide, Unreal ProvideService, Bevy provide_kit_service, C gfk_provide) — see the guide. <!-- kit-services:end -->