Irrational-Agents / Agents-Sandbox

MIT License
0 stars 0 forks source link

Implement Path Finder for NPC #20

Open kgoel59 opened 3 weeks ago

kgoel59 commented 3 weeks ago

Environment Representation: The sandbox environment, including areas and objects, is structured as a tree data structure. In this tree, each node represents an area or object, and the edges represent containment relationships (e.g., a stove being part of a kitchen).

Natural Language Conversion: This tree structure is converted into natural language descriptions to communicate with the generative agents. For instance, the tree representation of "stove" as a child of "kitchen" would be expressed in natural language as "there is a stove in the kitchen."

Agents’ Environment Awareness: Each generative agent maintains its own subgraph (a smaller, individual tree) of the overall environment tree. These subgraphs represent the areas and objects the agent is aware of, such as their home, workplace, or frequently visited locations. As agents move through the world, they update their subgraphs to reflect newly perceived areas, but these representations can become outdated when they leave an area.

Action Location Determination: When an agent needs to perform an action, the system traverses the agent’s environment tree to find the most suitable location. This process starts at the root of the agent’s tree and moves through the tree, prompting the language model to select the most appropriate area based on the current situation. For example, if an agent decides to take a walk, the system determines the best location within its known environment for this action.

Action Execution and State Changes: Once a location is determined, traditional game pathfinding algorithms are used to animate the agent’s movement to that location. When the agent performs an action involving an object (e.g., making coffee), the language model is queried to update the state of that object in the environment (e.g., changing the coffee machine's state from "off" to "brewing coffee").

Image

kgoel59 commented 1 week ago

Blocked by #23, need that to be completed first