Skip to content

Add environmental observations (terrain, cues, weather, stamina) #66

@justinmadison

Description

@justinmadison

Summary

Enrich the observation payload with environmental information that requires the LLM to interpret ambiguous signals and make inferences.

Motivation

Current observations are purely factual: exact positions of visible resources and hazards. Real-world foraging requires interpreting partial information. Adding environmental observations tests the LLM's ability to reason under uncertainty.

Implementation Details

Terrain Types

  • Mud zones: Slow agent movement to 50% speed. Visible in observations as terrain type.
  • Hills: Block line-of-sight but allow movement. Agent on a hill gets extended perception range.
  • Water: Impassable. Forces routing decisions.
  • Implementation: Add terrain layer to the scene (could use Area3D zones or a grid-based terrain map)

Sensory Cues (Directional Hints)

  • "You hear running water to the north" — hints at water boundary (impassable)
  • "You see smoke rising to the east" — could be fire hazard OR a useful campfire
  • "You smell something sweet to the south" — hints at apple cluster
  • Implementation: Add sensory_cues array to observation payload. Generate cues based on distance/direction to off-screen objects.

Weather System

  • Rain: Extinguishes fire hazards but creates mud zones. Reduces perception radius slightly.
  • Night cycle: Reduces perception radius by 50%. Makes exploration tools even more critical.
  • Wind: Affects fire spread direction
  • Implementation: Weather state machine in scene controller, affects perception_radius and hazard behavior per tick.

Stamina System

  • Agent has stamina that depletes with movement (proportional to distance traveled)
  • Running out of stamina forces the agent to rest (idle for N ticks)
  • Moving through mud costs double stamina
  • Forces the agent to plan efficient routes instead of wandering randomly
  • Implementation: Add stamina and max_stamina to agent state, stamina_cost_per_meter constant

Observation Payload Additions

{
  "terrain_at_position": "grass|mud|hill",
  "sensory_cues": ["You smell something sweet to the south"],
  "weather": "clear|rain|night",
  "stamina": 75,
  "max_stamina": 100
}

Impact on RAG Memory

  • "Mud zone between (3,0,2) and (7,0,5) — costs double stamina, avoid unless necessary"
  • "When it rains, fire at (1,0,1) goes out — safe window to cross"
  • "Sweet smell from south usually means apples near (-5,0,8)"
  • Interpreting and remembering sensory cues across episodes is a compelling use of semantic memory

Acceptance Criteria

  • At least 2 terrain types implemented and placed in scene
  • Sensory cues generated based on nearby off-screen objects
  • Weather system with at least 2 states that affect gameplay
  • Stamina system limits unlimited wandering
  • Observation payload includes all new fields
  • Decision prompt updated to explain environmental signals to the LLM

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestgodotGodot/C++ codebasescenesGodot benchmark scenestoolsAgent tools

    Type

    No type

    Projects

    Status

    No status

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions