In an RTS where workers are tasked e.g. build wall, how do the workers decide which walls to build?
The player decides which walls are to be built where, but they don't assign individual workers to individual wall squares. In many RTS games, workers simply do tasks that are near them, but in my RTS I want to use the strategic doing of explicit tasks on specific squares as the main strategy, so I don't want dumb workers clustering somewhere and leaving tasks further away not-done.
I use the example building wall; it could be mining stone, making a road, collecting wood or whatever. The key thing is the user picks where, but not who.
Workers can only work on squares that are adjacent to accessible squares; the squares they work on themselves may be impassable until work is complete.
Workers 1 and 2 are told to mine squares A,B,C and D.
They can move one square per game-tick, and mining a square takes 10 ticks.
How do you decide which worker mines which square?
It seems self-evident that 1 should mine A and 2 should mine C.
1 is 4 squares away from A, so will have finished mining it in 14 ticks. Where should 1 go next, and why?
And what if there was another square - E - to be mined directly above B?
What is the logic that a worker uses to decide where to proceed next?