Agent Architecture
Overview
The core differentiation of SynCity lies in the individual intelligence of its citizens. Each agent is not merely a sprite on a screen but a persistent data object with an internal state machine. The Agent Architecture defines how these entities process information from their environment and execute actions.
The Decision Loop
Every agent operates on a cyclic logic loop known as a "Tick." During each simulation tick, the agent performs three distinct phases.
1. Perception (Input) The agent scans its immediate surroundings and internal status.
Internal Data: Current energy, hunger, bank balance, and employment status.
External Data: Distance to workplace, price of nearby goods, and available housing.
2. Evaluation (Logic) The agent uses a Utility-Based Scoring System to rank potential actions. The system assigns a score to every possible action based on the agent's current needs.
Example: If "Hunger" is high, the action "Buy Food" receives a score of 90/100. If "Energy" is high, the action "Sleep" receives a score of 10/100.
3. Execution (Output) The agent selects the action with the highest score and executes it. This might involve pathfinding to a location, transferring credits, or updating a database record.
Priority Ranking System
To prevent chaotic behavior, the AI follows a strict hierarchy of priorities, similar to a simplified version of human psychology.
Critical Survival: Actions required to prevent agent "death" or removal from the city (e.g., eating, sleeping).
Economic Security: Actions required to maintain solvency (e.g., going to work, paying rent).
Self-Improvement: Actions that increase long-term value (e.g., studying, learning a new skill).
Leisure: Actions that increase happiness (e.g., visiting a park, shopping).
State Persistence
Agents retain memory of their actions. If an agent applies for a job and is rejected, they will "remember" this cooldown period and will not apply to the same company immediately. This reduces computational load and mimics realistic human hesitation.
Last updated
