OK Leonix i have some spare time, i will try to answer you.
Starcraft Broodwar was build in 1998, and RTS back then used specific “Best first search” search algorithms. For example the first popular RTS was arguably Dune from Westwood, the way that “distances between objects” where calculated worked by scanning the canvas rendered in the screen and then using “Thre algorithms” to chose which route was the better.
Old RTS used Beam algorithms, or simply “greed algorithms” as they are called. Latter Command and Conquer, Red Alert etc used a better version of this same algorithms but they assumed that you could send units to the whole map, so the canvas was bigger and the said Three Algorithm was buld in such a way that it was more efficient.
You have to understand that computers back then where changing from a 16 bit architecture to a 32 bit architecture. and run on DOS which was an OS that on previous version had no particular way of running parralell threads and process, which is a complicated conversation to have in here. Just know that early RTS algorithms had to work ON EACH FRAME, you could indeed make calculations on other threads, but they could not be managed in Real Time.
Broodwar on the other hand was a game created for 32 bits computers and Well, Windows 95 and 98 and ME latter, which where a more modern approach to parallel process and threads loading, and processor where good enough now to be able to load things both faster and at the same time.
At the same time Broodwar was created in a time where people still had early versions of Intel processor and Pentium processors, which didn’t handle Multi-thread alogorithms.
SO THIS IS WHY BROODWAR ALSO USES BEST-FIRST SEARCH ALGORITHMS AS THOSE OLD RTS BUT THEY DO IN THE BEST POSSIBLE WAY THEY COULD FOR THE TIME, EVEN IF THOSE 1996-1998 PROGRAMMER WOULD HAVE WISHED TO USE PATCHING ALGORITHMS THAT WHERE MORE ADVANCED-.
And here is a key word you have to understand, this whole talk is about Pathing which is a Computer Science and Game Design problem that is used to solve this things.
So to the point, the algorithm used in Starcraft Broodwar is called A* which is a Best-first search algorithm that is actually a veru advanced implementation of such thing. You have to understand that Best-first search algorithms where start being used with roboics as back as in the late 1950`s.
So how does A* works?^, i see no point of explaining this here, as i said before on each frame the “canvas” is scanned, which in Broodwar is the whole map, actually in Broodwar you could theoretically send a unite by code to somewhere else in the map without scrolling the mouse over that location, and this is because processor where capeable of loading a whole canvas of objectas AKA a map.
Also the logic Three algorithms calculated the “best path” or well “first path” to a particular place between 2 objects.
And here you have to udnerstand that games like SC2 they dont just calculate “the first path” they calculate “the best path” and also run some very complicated calculations of wathever is on the way. In boordwar if you send a unit to a mineral that is on the other side of the map and for some reason aunit BLOCKS the path, it will have to calculate the way again. or well… very smart programmers added a small solution to this.
THE MOVING UNIT INSTEAD OF CALCULATING EVERYTHING AGAIN IT WOULD TRY TO MOVE AROUND THE OBJECT WHILE THE NEW CALCULATION IS DONE
you understand?, so if you send a units it will always pick the straight line, if the map has a static object like a three it will include that static object in the calculation, but it wont for dynamic objects, which it will try to resolve while its moving.
In sc2 the story is different, objects are not just “dynamics” or “static” they are moving at different speeds, and have intersection vectors and things like that, which makes SC2 arguably dull, because in Broodwar you have to click to say to the Real Time Engine “CALCULATE THIS FOR ME AGAIN” making Actions Per Minute useful and the game more demanding and fun.
So about your question on autominning, what the unit is doing is just “trying to complete the request for mining” and because the PATH IS BLOCKED is trying to solve it by moving right or left depending ont he situation.
What is the situation depended on?.
On old RTS pathing algorithms (like DUNE) the canvas was loaded right before each frame was buffered, so objects (mountains, buildings etc) where loaded on each canvas render. and the way this was done was defined by the Video Card rendering system !!! which worked either clockwise or counterclockwise, curiously enough Dune used both clock and counter clockwise at the same time in very smart iterations, giving you some freaky epileptic colors if you used old monitors that didn’t liked this.
Broodwar does something similar… but instead of just waiting for the video card to sold all the loading of the screen objects in either clock or counterclockwise manner, it LOADED EVERYTHING IN THE SCREEN aka the map again, and now added “volumetric sense” to objects, so an Ultralisk has lets say 45 pixels and the scv only 22 (just saying numbers), that means that an scv is more prone to move to the right when trying to solve the pathing problem !!. This is because how the objects are programmed… and how each object “size” or “volume” is understood by the engine.
In old RTS engines everything worked with the same volume regardless of the size, because ALL OBJECTS where static on each frame render, but in Broodwar you have “static” and “dynamic” objects, which means that dynamic objects have volumes.
Some volumes are well… on a straight shape… and some are weird… like donut shaped, or even Boomerang shaped, and they change each time the dynamic objects move and render !!!.
So pathing calculates static objects, and dynamic object are solved by moving either left or right, adn the volume of the object gives the moving unit an idea of it should move left or right !
DEPENDING ON A BEAM FROM THE CENTER OF EACH PIXEL VOLUME SHAPE!!
so mining… all mines are static, so depending on the position the worker is approaching to the mineral it will draw a line when it HITS (actually 2 or 4 blocks before it hits) and start thinking where to move, left or right, (are there any other static objects to the right? if yes move LEFT !!).
Long story short that is how it works. The curious thing about “volumes” is that if you have a very fast unit like a vulture or if you click and move the unit fast enough, its “volume” MIGHT CHANGE SO FAST that it might request a calculation that it was prior to whatever the computer processor was meant to calculate, this is why you can “glitch” walk over minerals and this is why you can by clicking force a unit to do crazy things, like shoot faster calling the shoot stack again instead of a pathing solution… (dragons with patrol), arguably making a MUCH better game than SC2 which everything in the map is calculated on each real time iteration.
I hope this helps understanding better.