Skip to content

Require explicit tool use and add inventory limits #67

Description

@justinmadison

Summary

Disable auto-collection, require explicit pickup_item/collect tool calls, and add inventory capacity limits to make tool selection a real decision for the LLM.

Motivation

Currently _check_resource_collection() in scripts/foraging.gd auto-collects resources when the agent is within COLLECTION_RADIUS (2.0 units). The agent never needs to explicitly decide to pick something up. The existing pickup_item, drop_item, and use_item tools are registered but never needed.

Requiring explicit tool use means the agent must:

  • Choose when to collect — maybe it should scout first before committing
  • Manage inventory — with limited slots, it must decide what to carry
  • Use items strategically — eating an apple to restore health, using a torch to see further

Implementation Details

Disable Auto-Collection

  • Remove or gate the auto-collection in _check_resource_collection() in scripts/foraging.gd
  • Resources stay in the world until the agent explicitly calls pickup_item or collect
  • Agent must be within COLLECTION_RADIUS to pick up (same proximity check, just not automatic)

Inventory Limits

  • Add MAX_INVENTORY_SLOTS = 5 to foraging scene constants
  • pickup_item fails if inventory is full (return error in tool result)
  • Agent must call drop_item to make room
  • Add inventory count to observation: "inventory_slots_used": 3, "inventory_capacity": 5

Item Weight (Optional)

  • Heavier items (stone=3, wood=2, apple=1) reduce movement speed proportionally
  • Adds another trade-off dimension: carry fewer heavy items or more light ones
  • current_weight and max_weight in observations

Item Use

  • use_item("apple") — restores 20 health (currently no way to regain health)
  • use_item("torch") — temporarily increases perception radius by 5 units (ties into #perception-radius issue)
  • Crafted items have uses too (shelter provides a safe zone, etc.)

Starter Agent Updates

  • Add pickup_item, drop_item, use_item to VALID_TOOLS
  • Update decision prompt to explain inventory management
  • Update system prompt with new tool definitions

Impact on RAG Memory

  • "Inventory fills up fast — should drop stone to pick up apple when health is low"
  • "Using torch before exploring east quadrant reveals more resources"
  • Strategy learning across episodes about optimal inventory management

Acceptance Criteria

  • Auto-collection disabled; explicit pickup_item/collect required
  • Inventory capped at 5 slots; pickup_item returns error when full
  • drop_item functional — agent can free inventory space
  • use_item functional for at least apples (health restore)
  • Observation payload includes inventory capacity info
  • Starter agent VALID_TOOLS and prompts updated

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions