Skip to content

GDD: Rival Interactions — encounters as a choice (attack · ignore · cooperate)

Overview

Companion to the action pivot (../action-pivot/concept.md, ../action-pivot/gdd.md). Today a rival encounter has no ignore state: rivals perceive the player through the same gradual cone/LOS detection as mobs (with a reaction delay before firing), and on sight they choose fight or flee by bravery and HP — but never "notice you and go about their business." Once perceived, every meeting resolves as combat or flight, so all the social behavior the bots already have — looting, fleeing, key-racing, extracting with a real haul — is invisible at the encounter level. The pivot makes this acute: under aggro-only perception with the mutual-sight fire gate removed, encounters would collapse into instant automatic fights — which is why Tier 0 is a hard dependency of "rivals from floor 1," not an optional flavor layer.

This feature makes every rival encounter a player decision: attack, ignore, or cooperate. The key insight that makes this compatible with auto-fire and one-button controls: auto-fire automates the execution of combat (aiming, firing, stance), not target legitimacy. Who counts as a valid target is a separate rule — and that rule is where the choice lives. No attack button, no aiming input is added; the entire added input surface is one deliberate tap.

The reference is MISFITZ's alliance-and-betrayal core (see the research summary in the action-pivot concept) — but faked with AI bots instead of real players and networking, which stays out of scope. What bots can credibly fake is the part that matters for a solo casual game: the choice the player faces and the readable intent of the other raider.

Rollout is tiered and gated on data: Tier 0 ships with the pivot (it is a dependency of "rivals from floor 1"), Tier 1 is a fast-follow after the pivot's retention is validated, Tier 2 is built only if telemetry shows rival encounters drive retention.

Mechanics

The relationship state (Tier 0 — ships with the pivot)

Every rival carries one state toward the player: neutral or hostile.

  • Mobs are always valid auto-fire targets. Unchanged.
  • Neutral rivals are excluded from auto-fire targeting — in both directions. The player and a neutral rival can pass, loot, and fight mobs side by side; nobody shoots. Peace is the default outcome of an encounter, which is exactly what makes breaking it a decision.
  • Hostile rivals are normal targets: symmetric fight, as today.

The three choices, expressed through this one rule:

  • Ignore = do nothing. Costs zero input; the encounter resolves as two raiders going about their business.
  • Attack = tap the rival — a one-time declaration, not an attack button. The tap flips the rival hostile, the player's auto-fire opens up, the rival responds in kind. Analogous to flagging for PvP in an MMO: the moment of choice is explicit and deliberate; everything after it is automatic. (Implementation-wise this revives a sliver of the parked tap-target path as "tap = declare" — none of the old homing/pathing returns.)
  • Cooperate (minimal form) = ignore + proximity. Because mobs are always valid targets for both sides, a player and a neutral rival in the same monster pocket auto-fight the same mobs — side-by-side co-op emerges from the targeting rule with no new mechanics. Tier 1's emote merely acknowledges what the system already produces.

What flips the flag (escalation triggers)

The player's tap is not the only trigger — rivals use the same flag, which keeps encounters tense rather than perfectly safe:

  • Player declaration: the tap, as above. Arms only within a sensible range of the rival (mis-tap safeguard) and confirms loudly (see UX).
  • Retaliation: any damage flips neutral → hostile, both ways. If a rival opens on the player, the player's auto-fire returns fire automatically — defense needs no input, so a casual player is never punished for failing to react.
  • Contested objectives: both parties closing on the same prize (the vault door, the boss chest, the last extraction pad late in the raid) triggers a warning state — a visible beat of mutual wariness — then hostility if neither backs off. Greed zones are where truces die; this single rule carries the extraction-genre fantasy.
  • Archetype aggression (Tier 1, below): some rivals decide to flip on their own — always after a telegraphed wind-up, never as an unreadable instant attack.

De-escalation: hostility does not decay to neutral within an encounter (a fight started is a fight); it does reset if the two lose each other for long enough (the existing chase-lost / give-up behavior). Whether a fled rival "remembers" the player is a tunable.

Tier 1 — archetypes and social texture (fast-follow)

Rolled per rival at spawn; distinct behavior over the same state machine:

  • Hunter — seeks players; flips hostile on sight after a clearly telegraphed wind-up (glyph change → beat of warning → fire). The floor-gating knob keeps Hunters out of early floors.
  • Rat — avoids everyone, loots corners, flees on sight, never flips first. Killing one is pure profit and pure choice — the game's "was the loot worth being that person?" mirror.
  • Opportunist — neutral until the player is worth it: wounded, or carrying a fat haul near an extraction. The archetype that makes late-raid greed dangerous.

Social texture, same tier:

  • Human-sounding names + varied cosmetics — the classic .io trick. A rival with a player-style name that loots a chest, ignores you, and extracts reads as a real person to a casual audience. Zero new AI; the biggest perceived-multiplayer win per unit of work.
  • One signal verb: near a neutral rival, a contextual emote (wave / "truce?") appears — the rival responds by archetype (wave back = de-facto truce; ignore; or a warning glare from a Hunter). One button, reusing the contextual-button pattern of the Action Button.

Tier 2 — deep social (only if telemetry earns it)

Built only if Tier-0/1 telemetry shows raids with meaningful rival encounters retain better than raids without: temporary alliances (co-clear a boss with an explicit truce, betrayal window at the loot), follow-me behavior, rival-vs-rival fights the player can watch or exploit, and async ghosts — rivals wearing real players' names and loadouts pulled from backend data (Clash-style "fake real people", still no real-time networking). Real client-server PvP remains out of scope indefinitely.

What stays from the current bot AI

Everything. Goal-driven looting, fleeing, key-racing, vault-cracking, extraction with a carried haul, and the kill-jackpot (a dead rival drops everything it carried) are unchanged — this feature only changes when combat is allowed to begin, not what rivals do or drop.

Progression / economy

No new currencies or progression tracks. The economics of the choice itself:

  • Attacking is a risk-priced jackpot, unchanged: a rival's carried haul is the raid's biggest single prize, and declaring war prices it — a fair fight against a peer, started on purpose. The Opportunist archetype makes the player feel the same calculus from the other side.
  • Ignoring is loss-avoidance: letting a fat rival extract means watching its haul leave the map — the existing rule, now felt as a declined bet rather than a lost fight.
  • Cooperation pays in shared safety, not shared loot: a neutral rival soaking mob aggression in the same pocket is a real combat subsidy. No loot-splitting mechanics at this tier — drops go to whoever grabs them (the magnet radius keeps this honest and personal).
  • Encounter telemetry (see tech spec) is the gate for Tier 2 investment.

UX

  • Intent glyph over every rival's head — the single highest-value element: 💰 looting · ⚔ hostile · 🏃 fleeing · 🔑 key-hunting · a neutral idle mark. One glyph converts "a bot spawned" into "another person is here, doing their own thing."
  • Declaration tap: forgiving hit area; arms only in range; unmistakable confirm — red flash on the rival, glyph snaps to ⚔, a war-declaration sting. No accidental wars from fat-thumbing the ground.
  • Warning state (contested objectives, Hunter wind-up): a visible mutual-wariness beat — amber glyph pulse on the rival — long enough to read and back off.
  • Retaliation needs no UX: the player sees their own auto-fire answer an attack; the existing hurt flash + threat arrow already explain who started it.
  • Emote button (Tier 1): contextual, appears near neutral rivals, one tap, response is visible on the rival (return-wave animation or a glare).
  • Death/result screen: "Slain by " with the rival's portrait/cosmetics — makes the fake population personal; pairs with the "Raid again" fast path.

Visual identity

Reuses the existing rival art wholesale; adds only state dressing: the intent glyph set, the amber warning pulse, the red hostility flash + sting, a wave/glare emote animation pair, and name plates rendered in the same style as player-facing labels. The wind-up telegraph on archetype aggression uses the same visual language as mob attack telegraphs — one grammar for "danger incoming" everywhere.

Scope

Tier 0 — in the action pivot (a dependency of rivals-from-floor-1): neutral/hostile state · targeting filter both ways · tap-to-declare with confirm · retaliation symmetry · contested-objective escalation · intent glyphs · encounter telemetry events.

Tier 1 — fast-follow after pivot retention validates: Hunter/Rat/Opportunist archetypes · human-style names + cosmetic variance · the emote signal verb · "slain by" result screen (verified 2026-07-23: the attribution chain and a "Slain by X" result line already ship in Unity — Health.LastAttackerKillerName → result screen; Tier 1 only adds the name pool/portrait dressing).

Tier 2 — gated on encounter telemetry: alliances/betrayal · rival-vs-rival fights · async ghosts.

Out (explicitly): real-time client-server multiplayer and matchmaking; proximity voice or chat; loot-splitting/trading mechanics; rival interactions with the FTUE (tutorial stages remain rival-free). Ships Unity-only; Tier-0 rules may be cheap-tested on the web prototype during the pivot's Phase-0 validation sprint (see ../action-pivot/implementation-plan.md) — the web build has the fullest rival AI, making it the best test bench for the encounter model.

ТЗ / tech spec

Unity project (unity/raiders); follows the GameConfig group/key conventions.

  • Tunables (GameConfig), new rival group:
  • Hostility: declaration arm range, warning-state duration, contested-objective radius, hostility-reset (lost-contact) time, remember-attacker toggle.
  • Archetypes (Tier 1): spawn weights per floor/biome, Hunter aggression wind-up time, Opportunist triggers (player HP fraction, haul-size threshold, near-extraction radius), Rat flee bias.
  • Floor gating: rivals-neutral-from-floor / archetype-availability-from-floor (composes with the pivot's per-floor pressure gating).
  • Game systems:
  • Rival AI (bot controller): the neutral/hostile state and its triggers layered over the existing goal system (loot/flee/key/extract goals unchanged); warning state; archetype profile read at spawn.
  • Targeting filter: player auto-fire/auto-melee target acquisition excludes neutral rivals; rival fire logic gains the mirrored exclusion. Damage events flip the flag both ways (retaliation).
  • Declaration input: tap-on-rival raycast (forgiving pad, range-armed) routed as a hostility flip — reusing the parked tap-target hit-test, not its movement/homing.
  • Telemetry (TinySauce): encounter-started (proximity), player-declared, rival-declared, encounter-avoided, rival-killed-by-player, player-killed-by-rival — the Tier-2 gate depends on these existing from Tier 0.
  • UI / art:
  • Intent glyph widget on the rival health-bar anchor; amber warning pulse; red declaration flash + sting sound.
  • Emote contextual button (Tier 1) + wave/glare response animations.
  • Name-plate rendering + a name pool asset; cosmetic tint/accessory variance on the existing rival sprites.
  • Result-screen "slain by" block with rival name/portrait.