RaphaelRoyerRivard / MicroMachine

Starcraft 2 Bot
MIT License
12 stars 0 forks source link

Optimize mining (no bunker) #766

Open Unusual229 opened 4 years ago

Unusual229 commented 4 years ago

Instead of having very complex code that tries to handle the movement of all the workers and optimize all of it, it could be possible to just properly split the workers (in bases without bunkers) :

-First split workers so there is at least 1 per close patch. -If we still have extra workers, assign a second one to the close patch (if they alternate, it should be faster than mining the furthest patches with no workers on them) -If we still have some workers, assign a first worker to all far patches -If we still have some workers, assign a second worker to all far patches -If we still have some workers, assign a third worker to all far patches, more efficient per worker than on the close patches because of the distance. (will have to test and see the income different, might be small and not worth it) -If we still have some workers, dispatch to another base. -If all bases are full, send to long distance mining

Unusual229 commented 4 years ago

Drawback: Might involve a lot of actions, since workers try to go to another mineral field when it is already being mined. Could reduce the number of actions by knowning frame perfectly when a mineral field is or isn't being mined.

Unusual229 commented 4 years ago

Might want to readjust the maximum number of workers to fit the new amount of workers per base, which should be slightly lower. Maybe could allow for an extra mining base?

Unusual229 commented 4 years ago

Would need to detect minerals patches that are destroyed so we can rebalance the workers accordingly.

Unusual229 commented 3 years ago

"A worker occupies a mineral field for 1.99 seconds. It then pauses for approximately 0.3571 seconds before returning at full speed." This means we might be able to save the 0.3571 seconds by giving it the order to return the mineral immediately. It has the potential, if it works, to increase the harvest rate and maybe allow for a 10th trip on the mules.

Unusual229 commented 3 years ago

image

Unusual229 commented 3 years ago

Also doing long distance mining with idle workers.