There is more than one algorithm that gives you the best solution for your problem. The approaches you tried are all reasonable. However, having tried A * search does not mean much, since A * search depends on a heuristic that evaluates a specific configuration (that is, it assigns a value to a combination of the amount of time passed, the number and choice of buildings built, available resources, etc.). Thanks to good heuristics, searching for A * can quickly lead you to a very good solution. The search for this heuristic requires a good knowledge of the parameters (building costs, benefits of upgrades, etc.).
However, I feel that your problem is structured in such a way that a number of build decisions can clearly outperform another series of solutions after a few steps. Let's say you build buildings A, B, and C in that order. You build each as soon as the necessary resources are available. Then you try ordering C, A, B. You will probably find that one alternative dominates the other, since you have the same buildings, but in one alternative you have more resources than in the other. Of course, this is less likely if you have many different resources. You may have more X resources but less Y, making it difficult to compare situations. If possible, itβs good that you do not need heuristics, but you clearly see which path you should follow and which to cut off.
In any case, I would study how many steps are required until you find ways that you can reject based on this consideration. If you find them fast, it makes sense to follow the first line strategy as soon as possible and prune the branches. The first search for depth carries the risk that you will spend a lot of time exploring the lower paths.
lex82 source share