Game AI Labs
Five exercises covering a patrolling guard, A* pathfinding, steering behaviours, behaviour trees and goal-oriented action planning.
Resource-gathering Agent AI · Case study
A Unity Behavior coursework project with an authored C# task selector that combines resource distance, global scarcity, worker counts, and the agent’s inventory.
An agent should choose a resource task based on the wider simulation, not merely walk to the closest node. Inventory capacity can also make gathering the wrong action entirely.
I added a custom Select Task action that reads typed blackboard inputs. For each resource it adds the resource’s share of global supply to distance and assigned-worker count, each scaled to a fixed reference. A lower score favours scarcer resources, a shorter trip and less crowding. When the inventory is full, storing takes priority. The action writes its selected task back to the behavior graph.
The linked C# source and commit history show the task-scoring decision and the branch that handles a full inventory. The repo demonstrates the behavior, not a measured improvement in efficiency.
References
Task scoring combines global supply share with distance and worker count scaled to fixed references.
Commit records the agent graph refactor and variable mapping.