5 ms·
Hacking Calculords part 2: Who needs fingers?
- Agustus 10y agoThe title of this article should be Hacking Calculors, part 2: Who needs fingers? The emotional roller coaster I just went on of: "Did I miss the release of Calculords 2?" "No... I am not that out of it." <click> "Awww... Punctuation got me again."
- pavel_lishin 10y agoHah! I was just playing that game on my break. If I had a genie lamp, I would absolutely spend one wish asking for a multiplayer version; at this point, the only challenging AI opponent is the very last one, Hate Bit, and I win against it about 50% - and that number is slowly increasing as I improve my deck. I actually thought about trying to make a web-based multi-player version, but I don't want to rip off Seanbaby's hard work. (I also don't want to make a 'skinned' version that I could argue isn't a complete copy, because I don't want to have to come up with the hundreds of units that would require.)
- RKoutnik 10y agoYou're in luck, Calculords 2 will have PvP: https://twitter.com/Calculords/status/692528566794330112 https://twitter.com/Calculords/status/692528566794330112
- pavel_lishin 10y agoOh thank god, I don't have to do any of the hard work myself :p
- pavel_lishin 10y agoI 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.)
- fhood 10y ago"This drove the running time of the solver algorithm from an upper bound of 90 seconds to an average time of Out of Memory." This, I almost peed I laughed so hard. And I had to pretend that my python code was hilarious to convince my coworkers I was actually working (not hard, it is hilarious).
- RKoutnik 10y agoFantastic! Glad you liked it. (and nice cover-up with the Python, smart to use a language named after the greatest comedy group of all time).
- jerf 10y agoRKoutnik, regarding the neural net, if you're not specifically looking to play with neural nets but you just want to identify numbers, you don't need neural nets. Especially if you have a digitally-accurate dump of the screen, you just need one pixel that uniquely identifies the given number. Looking at the screen shots, while the numbers are different colors, they all have black outlines. It should be fairly easy to find simple combinations of pixels that uniquely identify numbers. If you want to play with neural nets, by all means be my guest. But if you're just looking to do the job, this is probably a much easier way.
- RKoutnik 10y agoThanks for the advice - and if this weren't a completely bananas project, I'd be doing that instead. However, part 3 is a thinly veiled excuse to play with neural nets and I learned a ton (code is done, post is about 1/3 written). The opener to part 3 is an elaborate excuse as to why I didn't do the simple thing (as you've mentioned). One quirk of using NN for that task is that since I've already got all of the possible outcomes, I need to deliberately overfit to my data (and it's a rare case where 100% accuracy is to be expected). Of course that's a good sign I shouldn't be using NN anyways, but we've beaten that drum...
- jerf 10y agoRighty-o. More power to you and I look forward to your post. :)
- qwertyuiop924 10y agoThis is fascinating. Although your AI algorithm might be faster if you could somehow sort inputs, starting with the most promising, and discarding the least promising, once an effectiveness threshold has been reached. Not knowing Calculords that well, I don't know if this is possible or not. Also the line >At this point, it was clear I had two options: >Armed with a trivial example and an inept grasp of the tools available to me, I could write a snarky Medium post about how terrible JavaScript is >WebWorkers Having been on both the receiving, and a few times sending, end of such posts (although not on medium, and not about js, for sending) I understand, empathise, and cannot help but laugh. Steve Yegge at his best couldn't have phrased that better.