BurnySc2 / sc2-planner

MIT License
48 stars 13 forks source link

Feature request: Trivial restructures #11

Open Volker-Weissmann opened 4 years ago

Volker-Weissmann commented 4 years ago

It would be nice if the program could automatically rearange this to this. There is nothing that is better in the first link. than in the second link.

BurnySc2 commented 4 years ago

Similar auto-improvements are suggested in https://github.com/BurnySc2/sc2-planner/issues/5 but in my opinion very hard to implement. It would need some 'autofiller' or 'autoimprove' button, but adding such a feature seems like a difficult task. How would you do that? Permutate the whole build order and take the one where the sum of start time of the build order elements is minimal?

Volker-Weissmann commented 4 years ago

Good question. I will see if I can find a good solution and tell you if I succeeded.

Volker-Weissmann commented 3 years ago

I just looked at #5 and it is not exactly the same as my feature request: Implementing my feature request can work without any permutations or trial and error: Consider the newest zergling in this There is a rather simple solution to when to start the zergling:

  1. Check what the zergling costs (1 larva, 50 Minerals)
  2. Check what the latest start of something else that costs larva or minerals is (in this case: 1:05)
  3. Start the zergling at the earliest time after 1:05 where there is 1 larva and 50 minerals (in this case: 1:16)

Similar auto-improvements are suggested in #5 but in my opinion very hard to implement. It would need some 'autofiller' or 'autoimprove' button, but adding such a feature seems like a difficult task. How would you do that? Permute the whole build order and take the one where the sum of start time of the build order elements is minimal?

Permuting it and checking if it gets better seems like a good idea to start. The obvious Problem with trying permutations is that a list of n objects has n! permutations which might result in very large calculation times. But the number of permutations is greatly reduced by the fact that all drones and all OL's are identic. If there are still to many combinations I would suggest the following: Start of by making each Overlord as late as possible. Then build the Overlord one drone earlier and check if it gets better. Repeat until you find (probably) the best permutation.

Note that the Idea above is just the simplest possible idea. In a few weeks when I have time, I will try to find a good way to do it.