Sat 01 Apr 2006 10:50:17 PM UTC, comment #1:
I'm not sure whether this is needed.
Since walking diagonal is as fast as horizontal or vertical,
I'd expect that idle globs would be eluded without increasing
the distance in most cases.
In the other cases the idle glob must be on an direct diagonal line
between the worker and a resource or an obstacle which it must pass.
(Well, and then, there are a few pathological cases which depend on
opening or closing of paths.)
If the movements of the idle glob (when inside a forbidden-area) would
be deterministic, we might get a funny situation. The idle glob might
be pushed by the worker's forbidden-area in the same direction as the
worker is heading - all the way. Might look funny, if we see globs
running around in pairs.
If the glob is pushed into a bottleneck it will block the path.
If idle globs have a bad effect on pathfinding, I would propose
another idea to deal with it. It's not better than yours - in
fact, it is worse when it comes to warriors, but it leads to
meassure the usefulness:
Before a worker makes its move, we check if on the neighbouring
fields is an idle glob. If there is one, we check if it is nearer
than the worker itself. If it is, the worker passes its job and (if
present) the resource it carries.
Might look good, but as I said - this won't help warriors.
(There would be a theoretical possibilty of a resource being transfered
a long distance in an instant.)
I have omited that different globs have different speed, because I
think this would average out.
The same idea provides a way to messure, if it would be beneficial at
all. Each time the worker (before its move) is adjacent to at least
one idle glob which is at least two fields nearer than the worker, we
increase a counter. At the end of the game we look at the counter, the
number of overall movements and their ratio.
This is a way to test the need to change the code at all. So it would
fit both ideas.
|