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
Summary
Disable auto-collection, require explicit
pickup_item/collecttool calls, and add inventory capacity limits to make tool selection a real decision for the LLM.Motivation
Currently
_check_resource_collection()inscripts/foraging.gdauto-collects resources when the agent is withinCOLLECTION_RADIUS(2.0 units). The agent never needs to explicitly decide to pick something up. The existingpickup_item,drop_item, anduse_itemtools are registered but never needed.Requiring explicit tool use means the agent must:
Implementation Details
Disable Auto-Collection
_check_resource_collection()inscripts/foraging.gdpickup_itemorcollectCOLLECTION_RADIUSto pick up (same proximity check, just not automatic)Inventory Limits
MAX_INVENTORY_SLOTS = 5to foraging scene constantspickup_itemfails if inventory is full (return error in tool result)drop_itemto make room"inventory_slots_used": 3, "inventory_capacity": 5Item Weight (Optional)
current_weightandmax_weightin observationsItem 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)Starter Agent Updates
pickup_item,drop_item,use_itemto VALID_TOOLSImpact on RAG Memory
Acceptance Criteria
pickup_item/collectrequiredpickup_itemreturns error when fulldrop_itemfunctional — agent can free inventory spaceuse_itemfunctional for at least apples (health restore)