sharpy-sc2 icon indicating copy to clipboard operation
sharpy-sc2 copied to clipboard

Planetary Fortress: Work distribution

Open lladdy opened this issue 4 years ago • 5 comments

See this game: https://aiarena.net/matches/153533/ For some reason after the planetary fortress is built worker distribution sends workers back to the main base instead of having them mine at the PF.

Is this intended?

lladdy avatar Mar 19 '20 08:03 lladdy

Sending workers away from a base with a Planetary Fortress is definitely not intended. 😄

Worker distribution probably does not consider PF as a proper base. The bug might also be part of Zone class.

I can take a look into this perhaps later today, unless someone else finds the cause before that.

merfolk avatar Mar 19 '20 11:03 merfolk

Zone.our_townhall looks like it should take PFs into account.

Can you debug PlanDistributeWorkers class and its get_worker_to_reassign() method? That's my primary suspect.

merfolk avatar Mar 19 '20 18:03 merfolk

I did some brief tests. I'm not convinced this is actually to do with the Planetary Fortress anymore. I think it might possibly be something to do with the main base being prioritized for worker distribution? It seems to send the PF workers to mine gas commonly in the main base. Unsure why.

lladdy avatar Mar 20 '20 06:03 lladdy

Okay, so it might just be that the PlanDistributeWorkers is not optimized for cases when the bases are far apart.

When I was originally implementing PlanDistributeWorkers, I thought about taking into account the distance a worker needs to travel but it's not considered ATM.

merfolk avatar Mar 20 '20 14:03 merfolk

My guess here is that the system takes workers out of gas to build new buildings, which results in distribute workers pulling workers from mineral mining without considering distance. The same happens with just mining happening in natural.

DrInfy avatar Mar 20 '20 18:03 DrInfy