Quote from: ShadowDragon8685 on February 19, 2014, 07:16:18 PM
This is why I advocate fighting fire with hand grenades and manually-controlled drafted colonists, instead of using the firefighting job at all.
Fighting fire with fire eh? Works in the real world with oil wells. (Except they use something a 'little' bit bigger than grenades...)
How I've tackled similar problems in past projects is to create a 'job zone' which calls out that it has work. Similar jobs within a set distance to an existing job zone would attach themselves to it.
Job Zones would track who is working them, and send out a request ping if a 'finish efficiency' function returns too low of a value. (This can account for things like distance from heart of colony, a job priority value that the player can set, number of workers and their estimated completed work, etc)
Workers would then pick up on the ping and evaluated whether or not they are a viable option for the job. That function would consider what they are currently assigned to, how far away they are, and how many work actions they expect they can complete before they need a break.
The 'best' worker for the job then picks up that Job Zone, and the zone re-evaluates itself. If it detects it is still below an acceptable point it can ping again and ask all other workers.
The goal of the system is to limit excessive walking of the agents so they aren't hopping back and forth between different parts of the map. Ideally you will never get two people spending 10 time units to walk across the map to handle two different 'jobs', which each take 1 time unit to complete. The first worker will make the trip, complete both jobs, and then head home.
In the case of a large number of jobs, or high risk jobs such as fire fighting (where the fire can spread and spawn even more jobs), workers merely lock on for a job zone and make their way toward it. Only once within a job zone will they actually pick their target job and start on it.
It could also help if things like mining or fire fighting could be hastened by having more than one colonist on each 'job'.
Not to mention that as new jobs within the zone spawn they will trigger a check. Colonist on fire become the highest priority, followed by burning structures, then everything else on fire. (or some variant of that) Then when someone catches fire they can interrupt the current jobs of other colonists (who are already right there) so someone puts them out quickly and they can rejoin the fight.