11 ms·
I already tweeted this at you, and you already responded, but this is probably a better venue: does your code deal with cards like Mutate Stargod that spawn ano
by pavel_lishin 10y ago
I already tweeted this at you, and you already responded, but this is probably a better venue: does your code deal with cards like Mutate Stargod that spawn another number card to your hand?
Your tweet answer was: "Not intentionally, but since we're deploying everything in the same row, it should be able to take advantage of that."
But that doesn't make sense to me - if you optimize for your 9 cards to spawn all 6 available units/cards, but the best solution is still only 5, at the end you might be left with that remaining soldier and a [5] card in your deck - whereas the best solution for the ten cards, including the newly-spawned five, might let you deploy all six units.
(There are other weird edge cases as well, such as the $2 card that lets you discard all of your units and draw 4 new ones.)
- RKoutnik 10y agoYeah, most of my work in this series is ever-better interactions with the game itself via code. If Calculords had a comprehensive API, I'd be able to build a smarter AI than what I currently have instead of working through things like `adb` and image detection (coming in part 3!). I'd love to dig further into strategy and ML but this side project has already occupied WAY too much of my time. I may revisit it in the future after completing part 3 but I've already got too many other ideas to make. Unfortunately I don't recall exactly how Mutate Stargod works, from your response it seems like I've misremembered how it works, mind posting the card text here? (I thought it absorbed already-deployed mutates).
- pavel_lishin 10y agoAh, no - you're thinking of "Form Mutatro", which is a $15 utility card: "Your mutates in the target lane merge into Mutatro, the Goliath Mutate God!" Mutate Stargod is an $85 "Tactician 5" card: Generates a 5 in your calculator when deployed, and gives all allied mutates in lane +1HP. I think that even without machine learning, you could build a pretty decent AI just with the "spam maximum units" tactic; that's why my favorite deck is all mutates, preferring things that deploy multiple units. I think hardcoding exceptions and edge-cases like Tactician cards would vastly increase the number of calculations you'd have to make - because now the order in which you deploy units matters, and calculations have to be re-considered from every possible deploy-point on - although it may be enough to get to a solution in which you empty out your calculator, and hope that the second calculator deal lets you empty the rest of your units. (This naive approach may not work for the harder bosses, though - spamming a single row against Hate Bit is a good way to roll out the red carpet for him to your base, since it's likely he'll get there before you do unless you get an incredibly lucky deal.)
- RKoutnik 10y ago> I think hardcoding exceptions and edge-cases like Tactician cards would vastly increase the number of calculations you'd have to make The current algorithm is exhaustive, so one run will generate all of the possible solutions to the given deal. Once all the solutions have been computed, the AI could run through the top n solutions and pick the best. This way the number of calculations is additive, not multiplicative. That's still thinking per-round though (not at the game level). It should be possible to determine if there are enemy units within striking distance of the base and deploy counterunits (so your eggs aren't all in the same basket of the top lane). I haven't encountered any tactician cards yet (confession: I haven't even reached Hate Bit, I've been so focused on the coding/blogging and it's easier to debug against Fancybot).
- pavel_lishin 10y ago> I haven't encountered any tactician cards yet (confession: I haven't even reached Hate Bit, I've been so focused on the coding/blogging and it's easier to debug against Fancybot). Ooh, you're in for... uh... well, not a treat. But a challenge!