puzzlepaint / freeage

An open-source reimplementation of the game engine of Age of Empires 2: Definitive Edition.
59 stars 4 forks source link

Villager behavior: Villagers should try to start resource gathering after finishing construction of a drop-off building #5

Open puzzlepaint opened 4 years ago

puzzlepaint commented 4 years ago

After villagers finished constructing a resource drop-off building, they should attempt to start gathering the corresponding type of resource, if any of it is nearby.

Game::SimulateBuildingConstruction() might be a place to start. Some functionality will need to be added to find all villagers that are targeting a given building while it gets finished (regardless of whether they are currently next to it or not). Then they can be re-targeted to nearby resources.