• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Pokémon TCG mod

Status
Not open for further replies.

TheDarkShark

Metal Headed Hacker
56
Posts
13
Years
*blows away dust*
Sorry for reviving this thread (I'll assume these rules apply in this subforum, too, because no limit to thread revival is mentioned in the specific rules), just found it again.
Since you already said, you'd finish this definetly, I'll gladly state that I still have interest in this project. In fact, I think I might be able to help you with the AI, though I still haven't looked into Ruby. I'm probably the only one who recently read the entire thread, so I'm going to quote the particular part I'm talking about:

I really don't think such strategies need to be separated. It all boils down to "use the best cards", and what constitutes a "best card" depends on the environment (i.e. what other cards are in play, etc.). This can certainly become convoluted very quickly as the AI develops, as there'll be all sorts of checks and evaluations. This is especially true when you start thinking of combos.

Of course, the AI is going to cheat. That is, it'll make its choices while knowing about cards it shouldn't be able to know about (e.g. cards in the player's hand, which prize card is best to take, whether it'll draw something good because of Professor Oak). However, it won't influence the outcomes of coin flips or whatever, so it'll be fair that way. I think making the AI omniscient is the only way it can be made to stand a chance against players.

As for how the AI will actually work, I have a vague idea. At the start of its turn, it looks around the duel and lists everything it is able to do (play a card from the hand, use an in-play effect such as a Pokémon Power, retreat, etc.), and then assign a desirability value to it. Calculating this value for each action depends a lot on the environment, and is the convoluted part. Once all the values are calculated, it will do the most desirable action and repeat (recalculating the values for what's left). Once there's nothing left to do, it will attack if possible and desirable - the good thing is that an attack is always the last thing in a turn (and there's always just 1 attack per turn), which makes it a bit simpler.

It sounds simple when I write it in just one paragraph, and some actions will always be desirable (e.g. play Bill) and some will never be worth using (e.g. Mankey's Pokémon Power, as the AI will know all those cards via cheating anyway). However, when is the best time to play Energy Removal, and which Pokémon/energy should be hit by it? How about Super Energy Removal, which involves a cost to the user and may not be worth it (and if so, which card should the AI pay)? There's a huge amount of thought that needs to go into the AI for even a single effect, and I think that such thought needs to be done in order to make the AI worthwhile.

Tuning can come much later, e.g. deciding the threshold desirability value below which an action shouldn't be done, and how much randomness to involve in the choices.

As you can see, any emergent "strategy" will depend entirely on the make-up of the deck. It can only depend on the cards you've got available ("work with what you've got"), and it's up to the AI calculations for each card to decide how useful (and therefore desirable) it is. The overall behaviour of the AI will simply look like what it does the most, which depends on what it's got (e.g. an energy-controlling strategy will appear if there are a lot of energy-controlling effects in the deck). I don't think there's any need to include deck-specific AI profiles (particularly as it would tend to rail-road and hurt decks which could sometimes benefit from profiles they don't have), and instead throw every situational calculation into the one AI used for everything.

This reminds me a lot of Dragon Age's threat system, which basically makes each individual enemy attack the character that poses the greatest threat to them. If you're interested in it, as some kind of reference, a better explanation can be found here.
Why do I think this is relevant? Well, depending on the game's difficulty settings, the equipped armor and weapons increase the threat, making enemies on lower difficulties more likely to attack your tank. Let's think this idea through a little bit:

Let's say there's a number of variables that scale the desirability of each action. This could be used to individualize the playstyle of characters and adjust the AI to the deck. Assume, for instance, the previously discussed evolution-/base-decks, where evolving pokémon and getting energy on base-pokémon should have different priorities. If there's two floats named evolution and baseEnergy, respectively, these could be set in the PBS-entries. In the evolution themed deck, you'd set evolution=1.1 and baseEnergy=0.8. The desire to play an energy on a base pokémon would be multiplied by 0.8, and the desire to evolve a pokémon by 1.1.
Of course, you'd need more variables (and better names), but I'm pretty sure this would pay off, since you'd have to do a lot less fine tuning (except for standard values, when the user doesn't set them for the deck).

To simplify the decision on what trainer card to play, you could also categorize them and apply values. Let's say both Bill and Professor Oak are in the category deckspeed (that's what this kind of cards are used for in YGO, anyways), Bill would have the value 20 and Professor Oak would have the value 40 (arbitrary example, don't count on me for the exact balancing). If you assume a float deckspeedPriority, similar to the previous evolution and baseEnergy variables, the cards would get assigned the proper desire. If deckspeedPriority=1.5, playing Bill would stand at 30 desire, and Professor Oak would stand at 60.
I'll admit though, that this is not optimal, since Professor Oak makes you toss all cards in your hand, so the desire should be decreased depending on what cards the CPU player currently has. Applying multiple properties to a card might help. To keep the example going, assume Professor Oak had the properties deckspeed 70 and toss 0, where 0 basically means all. The desire to play Professor Oak would then be 70 * 1.5 = 105, reduced by an appropriate amount of desire, depending on the number of cards.

If you want actual strategy, as in playing combos of cards that work well together, consider having the user specify them for the deck. If none are specified you're fine. However, if the AI's supposed to wait for this card in the deck before playing that card, the desire to play that card would be drastically reduced, maybe by the priority of the combo.

All of these are ideas I came up with while brainstorming, haven't really done much more thinking, though. I know, they look like a lot of extra work, but please consider them at least.
 

Maruno

Lead Dev of Pokémon Essentials
5,285
Posts
16
Years
This section's description says the thread revival limit doesn't apply in here, so don't worry about that.

Your first suggestion, defining a deck with one or more keywords that are used to alter AI calculations of how/when cards should be used (including as parts of combos), is reasonable enough. It'll be fiddly to insert those alterations into the scripts to actually produce the desired style, of course, but that's a matter of balancing and tweaking. Any rail-roading (forcing one style when another would be more preferable) would probably not be too blatant, because if another style really is more preferable, the effect of the defined style won't be enough to override it. Again, that's a balancing issue.

Your second suggestion, categorising cards by their effects, doesn't seem that useful. Every unique card effect has its own function code, and the calculations for how/when to use it can depend on that. Basically, the effect function codes already serve as a kind of categorising, albeit a very fine one. Similar effects will have similar desirability calculations; it's not hard to copy-paste. While this does make the AI for using a card hardcoded, I really don't think that's a problem. In the end, the code's going to be the same as using card keywords, and in fact function code-based calculations can allow greater customisation of a card's AI since you can easily edit the AI for just a single unique effect. So no, this idea doesn't convince me.

There's currently no AI at all. I'd prefer to get something simple in first and then possibly modify it later, than worry about loads of different subtleties from the beginning. The AI style keywords are definitely one of the "ignore for now" things, but I've written it down.
 

TheDarkShark

Metal Headed Hacker
56
Posts
13
Years
Well, the mechanisms I suggested are only tweaks to the original idea, so implementing the simpler version first is only reasonable.

Hardcoding AI for every single card seems really tedious to me, though, even if it's only copy/paste. Other than using keywords, I can only think of reflection to calculate their desirability, which would give you a really tedious, hard to understand AI code (depending on how well reflection is implemented in Ruby, if it is in at all). I won't judge you for refusing to do this, especially since this is a kit for other game developers. Maybe hard code really is the best option, though I usually don't like to think that way.

If currently no AI is implemented, what are you currently working on and what have you achieved in the 2 months since your last post here? Have you progressed at all, seeing as people's interest in this has decreased recently? Not trying to be rude, just curious.
 

Maruno

Lead Dev of Pokémon Essentials
5,285
Posts
16
Years
I know that hardcoding is frowned upon and harder to change. However, it's simpler to do, will be pretty straightforward to edit anyway in this case, and this is only a small little project of mine which was never intended to be massively customisable, so I don't need to worry about it.

I never learnt the names of things like reflection (which Ruby has); all I know is how to use them. I use reflection to check whether a particular attack or trainer effect exists, and if so, to call it. However, I might as well just make one huge method to do all the desirability calculations for a particular kind of action (play trainer, play energy, retreat, use Power are all different things), like Essentials does for using moves - it'd be practically the same thing as using reflection anyway, and good enough for this project.

I've done very little since whenever my last update was; I've drifted back to working on Essentials a bit since then. I don't keep a change log for this, so I couldn't list what I've done. I've looked through the rulings posted above and clarified exactly how the various card effects should work, and I've done a little background work for them (e.g. making an array which remembers what an attack's result was, for the purpose of Mirror Move and Leech Life, etc.). I've fiddled with prize cards. I've generally been tweaking things to work smoother or better, and been planning out what else needs doing. A lot of what I've been doing is incomplete, and there's not much to show off.

This project was only ever a "because I felt like it" thing. Because I like sharing, it'll (probably) be available for anyone to use, but that's not specifically a guideline for the project, nor is making it easy to customise. I'm just doing what I want to do, and if it happens to be user-friendly, that's just a bonus.
 
80
Posts
13
Years
Hi Maruno. I've read this entire thread and i can't wait untill you finish it:) I must say i agree with how you want to do it. It understand it's just a side project and you don't want to spend too much time messing with stuff you don't have to. I'm sure people can change the things they want once the groundworks there. Unfortunately i have next to no experience with scripting so i can't help with any of that but i have played both GB games (a lot) and if there's any questions you have i'm more then happy to help if i can. As for thoughts and suggestions, i think its looking good. It's just an alpha and it doesn't have to look pretty. The layout is great and the cards look good. I am currently researching and learning everything i can about scripting and pokemon essentials in the hope i might be able to do small things and i must say i have heaps of respect for what you've done. It looks like a lot of work. Anyway, keep up the good work and i'm sure this will be awesome when you finish:)
 

Maruno

Lead Dev of Pokémon Essentials
5,285
Posts
16
Years
I've not done anything for a while, as I've been working on Essentials instead. Once v12 is out (very soon), I'll want to get back to this.

I forget where I'm up to. I need to make a more generalised "choose a card(s) on the field" method which will require some kind of graphic indicating which cards have been selected, and there's some other small technical things (like changing how attached energy cards are recorded to more easily allow for Electrode's Pokémon Power to work). After that, it's just adding the rest of the card effects, making things look pretty and making the AI. That'll be the battle system finished, then, as far as I know.
 

Keromatsu

Froakie is Awesome!
422
Posts
11
Years
  • Seen Jan 28, 2021
will this be with a newer tileset and new graphics for cards because the old ones are weird......
 

Maruno

Lead Dev of Pokémon Essentials
5,285
Posts
16
Years
What do you mean by "weird"? They're images of the cards.

I have no need to change the tileset for this add-on.
 

Maruno

Lead Dev of Pokémon Essentials
5,285
Posts
16
Years
Ah, right.

A quick read through this thread would come up with screenshots and a playable alpha which shows that this add-on is using better graphics than the GBC games.

This add-on is going to include the cards from Base Set, Jungle and Fossil. The graphics for these cards are scans of the actual cards.

Spoiler:
 

the__end

Pixel Artist
141
Posts
13
Years
  • Seen Jun 9, 2016
is there a way to add our own cards?

If you can script i think it will be possible. But maybe Maruno will add a way where you can create cards with effects already included in the add-on. For example a card with an effect that makes you flip a coin or something simple like this. This way you could be able to add simple cards without scripting. ;)
 

Maruno

Lead Dev of Pokémon Essentials
5,285
Posts
16
Years
If you have the demo, check the PBS folder. Each card set has its own txt file, in which all their cards are defined. New card effects require scripting.
 
423
Posts
13
Years
  • Age 37
  • Seen Aug 31, 2023
hows the progress going looking forward to being able to play few tcg matches
 

Maruno

Lead Dev of Pokémon Essentials
5,285
Posts
16
Years
I haven't worked on this mod since the last time I posted about it. It's still on my To Do list; I just don't know when I'll come back to it.
 

Maruno

Lead Dev of Pokémon Essentials
5,285
Posts
16
Years
No, of course not. This mod doesn't exist yet. All I've got so far is a handful of half-complete scripts, and there's no way I'm going to provide support for them.
 
Status
Not open for further replies.
Back
Top