1-17-25 Update - PRE, AI and Rule Sets
Got a meaty update today! First, Prismatic Evolutions is in. Nothing too exciting there since half the set is just reprints anyways.
The better part is the AI is (almost) done and I even got the Custom Rule Sets (mostly) done! I say almost done for the AI as there's still a few parts that need the logic done, but the main logic function is done, and I'll briefly explain how it works at the end of this post, the tl;dr being the AI takes the parsed card description, gives it a numerical value, then chooses the highest value card to play, and that's the part that took months to complete. I still need to tweak some number values, as I was testing this build a bit this morning , and the AI was refusing to use Marnie at all, but I'll get that done very soon.
And for entirely new content, Custom Rule Sets are now (mostly) implemented. I started this about a week ago after I finally got over being sick for 2 weeks, and I wanted to do anything but touch the AI again for a bit. There's a Help button that will go into more detail than I will here, but you can now make and play with a rule set that you define. There's 3 main categories, Deck, First Turn, and Misc Rules. Deck Rules have the Deck Size, Max Card Copies, and Exclusions that define how the decks can be built. First Turn Rules all define what actions/cards the player going first can do on their first turn. There's even a few that haven't been enforced before, like Pokemon and Draw, so mix and match as you see fit. Misc Rules is everything else, and there's some good options in there. You can choose between Prize Cards and Prize Points, how many prizes you have, which Win Conditions are active, using the Pokemon Pocket Energy Zone, having a Hand Size Cap, if pokemon can immediately evolve, or if they can evolve from pokemon they shouldn't be able to, and even how many of each card type you can play during a turn, there's a lot of good options to really change the flow of the game. Currently a few rules don't work though, since I got this all done in about a week as I said before. The ones that don't work are the Deck Rules (Size, Max Copies, and Exclusions), Prize Points, the Energy Zone, and Prize Count of more than 8 (I never expanded this to be more dynamic, as 8 was the most prizes you could have with any official cards). The Rules are kept in a separate folder like Decks, so be sure to keep that folder in there.
And that's pretty well it for now. I'll get the last of the Rules implemented and put out a new update hopefully in 2 or 3 weeks rather than waiting until the end of March when the next set comes out. I'll also keep testing the AI's intelligence, as I've seen a few issues this morning, and fixed a few crashes too, and I severely doubt I got them all. So enjoy the improved AI and Custom Rule Sets!
This section I'll talk about the evaluateAIScoreLogic() here, or the deep logic of the AI. There's an entire senior college level class you could take for this, which I did, so there's no way I can explain everything in just a few paragraphs. Basically put, the AI needs to know how to identify what action is better than another, and that's the programmer's job to teach the AI. My professor mentioned a few times "The AI is only as smart as the programmer makes it", and that's where the evaluateAIScoreLogic() function comes in. The main step the AI takes is starting with evaluate(), which then has a few helper functions like gatherValidTurnActions() that returns a list of every possible action the AI could take. Then it calls evaluateActions() which loops over every action to evaluate how good it is, which then calls evaluateAIScore() to set up a base AIScore (an integer value that the AI can then use to determine how good an action is), and then finally evaluateAIScoreLogic() that processes the description and adjusts the AIScore depending on how good that action would be. Following so far? No? Good, I wouldn't expect you to pick it up with my messy explanation. The function names don't exactly matter, but it's more the process. In the evaluateAIScore() function, a card is assign a value based on the Role and Rank of that card. I've given every card one of these, knowing I'd eventually use it for this. So for example, a card with a Meta Rank would be assign 70 as its AIScore, but a Theme Rank card would be 40, this way the AI has a baseline for what cards are better. And the values are completely arbitrary, I just like using a 0 to 100 scale. Then, when the evaluateAIScoreLogic() is called, the actions of the card may raise or lower the AIScore. As an example, Professor's Research would start at a 70 because of the Meta Rank it has, but the final score may be 30-40 if the AI has a lot of cards in hand, as the evaluateAIScoreLogic() would subtract 10 points per card discarded, but add 5 for each drawn. Then as one last bit of logic, if the card's final AIScore is under a certain threshold, I currently have it as 30, it would remove that card from consideration, that way the AI won't use every card that it can simply because the card can be used. Some actions would result in a -1000 for the AIScore, just to really enforce that the card shouldn't be used as the effect would be completely wasted, hence the -1000. I currently have almost 2000 lines of code exclusively for the evaluateAIScoreLogic() function, since there's a lot of card effects and outcomes that need to be handled. And all of this is to help determine a numerical value to describe how effective a card or action would be so that the AI can just grab the top option to use. I'll stop here, as this is already a pretty lengthy overview, and any more explanations would require double of what I've already written. So now you too can pretend to know how an AI works.
Get Pokemon Deck Tester
Pokemon Deck Tester
Test your decks without having to worry about other players.
Status | Released |
Author | ProfShepard |
Genre | Card Game |
Tags | pokemon, Singleplayer, tcg |
More posts
- 11-7-24 Update - SSP85 days ago
- 9-17-24 Update - SCRSep 17, 2024
- 8-3-24 Update - SFAAug 03, 2024
- 6-15-24 Update - The AI UpdateJun 16, 2024
- 5-27-24 Update - TWMMay 28, 2024
- 3-23-24 Update - TEFMar 24, 2024
- 1-25-24 Update - PAFJan 26, 2024
- 11-4-23 Update - Expanded Done and PARNov 04, 2023
- 9-25-23 Update - All Gen 7Sep 25, 2023
Leave a comment
Log in with itch.io to leave a comment.