|
Post by lilith on Nov 29, 2012 0:56:09 GMT -8
hi all! here i totally thought nobody cared about RBY anymore. i remember going on NBS a few years ago and not being able to find games... i recently decided to learn gen5 and started playing on PO, and made an RBY team to see what would happen... and apparently there are people there! woah. ummm, let's see, about me. i like to stall. my favorite pokemon is Lapras, and my favorite set is Confuse Ray / Double Team / Body Slam / Rest. i love sets that are missing "mandatory" moves in general, especially when my opponents play around moves that aren't there. i like reading threads like this. it really made my day that other people are looking at nash equilibria in RBY after all these years on that note, sometimes i come up with really silly ideas like writing an AI to play RBY using monte carlo methods. if anyone else wants to do this and doesn't think it's a huge waste of time, let me know... anyway i'm not a very good player... i've always been more daydreamy than practical. hopefully i can learn from everyone else! also am i the only one who sees rby2k10 and thinks of /r9k/?
|
|
|
Post by WaterWizard on Nov 29, 2012 16:33:29 GMT -8
Hey lilith! Shame that you didn't find us a couple years ago; we've been a rather successful forum! the community is still good, although we are MUCH less active now.
I like that you use irregular sets; I do the same thing! Also Zilch and Isa may be interested in your AI writing. Get up with them!
Glad you found us. Be sure to check out RBYPlus!
WW
|
|
|
Post by Agent Syrup on Nov 29, 2012 16:58:33 GMT -8
Hope to see you on the feild of battle myself!
|
|
|
Post by lilith on Nov 29, 2012 22:07:13 GMT -8
Also Zilch and Isa may be interested in your AI writing. Get up with them! RBY+ looks pretty cool, but also intimidating... (so many options!) are there people familiar with the meta who could help me start out?
|
|
|
Post by t3h Icy on Nov 30, 2012 19:16:08 GMT -8
Hi! PO's the way to go for RBY nowadays, though NBS is still working and around. A lot of the community is still active on the boards, but there aren't too many around actually playing due to school/work/etc. Visit Lutra's server if you want to play with the folks here (at least that's where I think they play, lol). If you like data, analysis, and the like, browse around for threads started by me in RBY Discussion. I've written up quite a lot from a mathematical perspective over the years. You can also check out my RBY guide on GameFAQs here. It's a bit outdated and there are some mistakes, but it's still a solid resource if you're interested in improving. If you want to read more details about specific Pokemon that aren't necessarily OU, check out this sub-board. And if you want to see any quirky movesets and gameplay in action, check through the logs section and any thread started by WaterWizard or Brookman, lol. There's also quite a bit of stuff that might be interesting to you in our archives, but mind you, a lot of it is old opinions, outdated or just battle logs from 2010/11. If you have any questions, or interested in breaking down some aspects mathematically, feel free to post! I'll try to add some insight and do some probability work in them when I can. Welcome!
|
|
|
Post by Raish on Dec 2, 2012 21:42:04 GMT -8
Welcome! I made a battle simulator for Discrete Math, but it just had strategies that I implemented for each Pokemon in each given situation, which would be far too complex to code when playing against humans rather than against another AI with similar coding. I also left out statuses, so it was just healing and damage moves. I did manage to make the games play out somewhat similarly to real games though, with games tending to end on Tauros dittos or something like Persian vs. Starmie, and the teams ended up being far more balanced than I'd expected based off them always playing off the same code, with the team with the slight advantage winning only about 70% of the time. I'd be really excited to see a far more functional version of this!
|
|
|
Post by lilith on Dec 3, 2012 4:09:36 GMT -8
thanks icy! do people play stadium / tradebacks much these days (and if so, where)? also, is there a working link to RBY+? the one here is broken for me. Welcome! I made a battle simulator for Discrete Math, but it just had strategies that I implemented for each Pokemon in each given situation, which would be far too complex to code when playing against humans rather than against another AI with similar coding. I also left out statuses, so it was just healing and damage moves. I did manage to make the games play out somewhat similarly to real games though, with games tending to end on Tauros dittos or something like Persian vs. Starmie, and the teams ended up being far more balanced than I'd expected based off them always playing off the same code, with the team with the slight advantage winning only about 70% of the time. I'd be really excited to see a far more functional version of this! cool! i also found this: doublewise.net/pokemon/
|
|
|
Post by t3h Icy on Dec 3, 2012 14:50:09 GMT -8
Yeah, AI would be an interesting take for RBY. A lot of it would not only be just figuring out what to use and when, but making the best of prediction. The best way to do that would to analyze a scenario and calculate the probabilities of a certain choice being better than others. This gets complicated when considering the entire length of a battle though. Of course, if a player is aware of them, they can use slightly less viable options or mix-ups to beat such a bot. To further improve it, it would need the ability to adapt to how the opponent plays, which could be done by analyzing offensive/defensive choices, risk/reward choices, etc, but it would require a lot of data to be effective. Not to mention the coding to accurately model that data to give a useful output.
An idea I've had is to create a simulator that has 2 teams go against each other, with each turn having a 4/X chance of selecting a random move, and a Y/X chance of switching to a random Pokemon, where X is (9 - fainted Pokemon), and Y is (6 - remaining Pokemon). Then based on say one million battles, adjust the probabilities slightly to see if that improves the chances of winning. Then repeat it with slight tweaks, whether complicated or simple (switching at certain times, predicting things, etc). It would be a good mathematical way to figure out what the best choices at any given turn are. Of course though, playing against each player is different and the actual task is disgustingly complex. Even Chess is only weakly solved.
|
|
|
Post by jorgen on Dec 3, 2012 17:52:45 GMT -8
What are you talking about clearly the optimal solution is to have Dragonair spam Agility against Zubats.
Anyhoo welcome to the forums. Your project sounds cool, I'd like to know how it turns out! Good tests might be to look at some scenarios with simple, solvable equilibria and verifying that your simulator approaches that equilibrium.
|
|
|
Post by t3h Icy on Dec 3, 2012 22:17:53 GMT -8
Mind you, I don't really plan to actually do it, but I'm just toying with the idea of it and some of the interesting things that could come out of such a simulator.
If someone were to actually make it though, I'd definitely help out with some probability and stats work with it.
|
|
Zilch
Member
What's in the box?
Posts: 561
|
Post by Zilch on Dec 3, 2012 22:43:55 GMT -8
I could potentially program something in C language to simulate a "random" battle, though I'd probably start off with two hard-coded teams with specific moves. If a move runs out of PP and that move gets selected again, the RNG simply rolls again.
|
|
|
Post by t3h Icy on Dec 3, 2012 23:03:47 GMT -8
Could even start simple with 1v1 match-ups using random moves, and then maybe throw in some intelligence afterwards.
|
|
Zilch
Member
What's in the box?
Posts: 561
|
Post by Zilch on Dec 3, 2012 23:19:31 GMT -8
Yep, gonna program your famous Alakazam vs. Tauros situation first Psychic/TWave/Recover/Reflect Body Slam/Hyper Beam/Earthquake/Blizzard If I go full random at first, Tauros will win nearly every time since all his moves are offensive. I'd have to give Alakazam some sort of intelligence for him to have any real shot.
|
|
|
Post by lilith on Dec 6, 2012 18:18:13 GMT -8
Yeah, AI would be an interesting take for RBY. A lot of it would not only be just figuring out what to use and when, but making the best of prediction. The best way to do that would to analyze a scenario and calculate the probabilities of a certain choice being better than others. This gets complicated when considering the entire length of a battle though. Of course, if a player is aware of them, they can use slightly less viable options or mix-ups to beat such a bot. To further improve it, it would need the ability to adapt to how the opponent plays, which could be done by analyzing offensive/defensive choices, risk/reward choices, etc, but it would require a lot of data to be effective. Not to mention the coding to accurately model that data to give a useful output. An idea I've had is to create a simulator that has 2 teams go against each other, with each turn having a 4/X chance of selecting a random move, and a Y/X chance of switching to a random Pokemon, where X is (9 - fainted Pokemon), and Y is (6 - remaining Pokemon). Then based on say one million battles, adjust the probabilities slightly to see if that improves the chances of winning. Then repeat it with slight tweaks, whether complicated or simple (switching at certain times, predicting things, etc). It would be a good mathematical way to figure out what the best choices at any given turn are. Of course though, playing against each player is different and the actual task is disgustingly complex. Even Chess is only weakly solved. i like the monte carlo approach. i think it's hard to learn that much in advance about an in-game situation though, because the nash equilibrium probabilities could vary wildly with a bunch of persistent state (such as hp of remaining pokemon) to the point where any sort of meaningful lookup table of what the ai has learned about certain situations would have to have far too many entries. i guess this should makes things easier? i really don't actually want to muck around with trying to do some sort of ML algorithm to classify game situations based on past games, so i'm ok with it being not worth it to do so... my half-baked idea at the moment is to do something like: def estimate_nash(state): >>for product(p1choices, p2choices): >>>># mumble mumble do this multiple times and average out the expectation values because of in-game RNG? >>>>if maxdepth: >>>>>>do some computationally light metric to estimate the winrate of the situation after the choices (monte carlo? some magic formula involving hp, pp, and status of each pokemon?) >>>>else: >>>>>>use estimate_nash(state after choices) to compute our expected winrate after the choices
>>>>save winrate
>>find nash equilibrium strategies based on saved winrates; return
if the max depth was something like 3 full turns (at most 81^3 branches for four moves and five switches, so if a position can be evaluated in 100us it'd take around a minute (i have no idea if 100us is realistic)), as long as it's doable to estimate which situations are good to be in 3 turns from now, it should also be doable to play in a way that gets there. i feel like most strategic decisions in rby have clearly positive or negative effects after 3 turns except for, like, PP waste, amnesia, or sacrifices to get rid of something that walls a late game sweper? i'm curious if i'm leaving things out here... ok that paragraph was a mess, moving on... as Zilch pointed out, the monte carlo method has a problem where some moves (psychic) are better to use randomly than others (reflect). the magic formula method feels kind of gross to me, but maybe it'd be more effective with a carefully tuned formula? i think the biggest issue with the magic formula would be something silly like 1hp slowbro with +6 special against 4 paralyzed things, where monte carlo would probably find an obvious 90% winning strategy. am i making any sense? i haven't really thought this out too well. also, totally still reserving the right to abandon this plan because it's hard and stuff.
|
|
|
Post by t3h Icy on Dec 6, 2012 21:23:17 GMT -8
There's a ridiculous amount of factors and data that needs to be analyzed every turn, which is why it's really difficult to even plan out, and any ideas that are simpler lead to a poor AI. Your idea of only looking 3 turns ahead already takes an incredible amount of time to calculate (with precision anyway) since the possibilities grows exponentially. You also have to consider more than the 9 decisions per turn because each choice changes based what happens in the previous turn (moves getting Critical Hits, Paralysis, etc). Of course the 81^n choices can consider all that, but that means each turn takes a lot more time to decide, which may not be fun to play against.
Looking 3 turns ahead itself also isn't a superb strategy, just with how the game plays out, and would be easy to handle. Usually when I played, I'd have a good idea on how I would plan out the remainder or at least the majority of the match. A lot of it becomes subconscious after playing enough.
The other problem is that you're deciding choices based on moves and Pokemon the opponent doesn't have, but that would mean the AI knows what's supposed to be hidden, or just has to guess what the opponent has. One of which is a sort of soft cheating on the AI's part, while the other just makes predicting significantly harder. Make the AI play without cheating against WaterWizard, and it will get bodied.
I don't mean to shoot down your idea, but it really just isn't realistic, and for an AI that is designed extremely well and doesn't cheat in any way, while also working fast, would require a team of PhDs to create. That's why I suggest either focus on 1v1s where the attacks are known to both players, or create a much, much simpler AI like with the idea I posted.
|
|
Zilch
Member
What's in the box?
Posts: 561
|
Post by Zilch on Dec 7, 2012 0:22:46 GMT -8
For Alakazam, essentially there would be these factors in determining which moves he should use: 1) Am I guaranteed to KO Tauros with my next attack? 2) Is Tauros paralyzed? 3) Am I paralyzed? 4) Is Reflect up? 5) Can Tauros KO me with Hyper Beam? 6) Can Tauros KO me with Body Slam? The same for Tauros: 1) Am I guaranteed to KO Alakazam with my next Body Slam? 2) Am I guaranteed to KO Alakazam with my next Hyper Beam? 3) Is Alakazam paralyzed? 4) Am I paralyzed? 5) Can Alakazam KO me? 6) Am I desperate and hoping for a critical Hyper Beam? 7) Am I hoping for a Blizzard freeze? 8) Is Body Slam out of PP? Realistically, Tauros should never use Earthquake as he is not facing Counter, unless by some freak occurrence Body Slam runs out of PP. Some of these might be redundant or maybe I'm missing something, but that's pretty much the logic I'd follow for making some sort of AI for the two. Also, yes, I realize that Psychic might get 255'd so often as to drain its PP. Tauros would automatically win in that case. I really don't want to have to have this thing calculate a PP war... Incidentally, the chance of Psychic 255'ing 14 times is about 0.000000000000000000000000000000000019%, so yeah, probably not going to happen
|
|
|
Post by lilith on Dec 7, 2012 6:59:33 GMT -8
There's a ridiculous amount of factors and data that needs to be analyzed every turn, which is why it's really difficult to even plan out, and any ideas that are simpler lead to a poor AI. Your idea of only looking 3 turns ahead already takes an incredible amount of time to calculate (with precision anyway) since the possibilities grows exponentially. You also have to consider more than the 9 decisions per turn because each choice changes based what happens in the previous turn (moves getting Critical Hits, Paralysis, etc). Of course the 81^n choices can consider all that, but that means each turn takes a lot more time to decide, which may not be fun to play against. Looking 3 turns ahead itself also isn't a superb strategy, just with how the game plays out, and would be easy to handle. Usually when I played, I'd have a good idea on how I would plan out the remainder or at least the majority of the match. A lot of it becomes subconscious after playing enough. mm, seems that's a point in favor of using monte carlo rather than lol_sum_monster_hp_and_divide_by_2_if_paralyzed_and_not_chansey to evaluate positions at the max depth. do you have any specific examples of game situations where you think lol_sum would fail miserably? i could only come up with contrived situations like the slowbro one that i don't usually see happen in real games. with some good examples, maybe we could notice a heuristic approach that works well for dealing with them? wishful thinking, i know lolol that's what makes it fun i don't really expect good results, but if i can get 1 out of 3 of: can play against unknown teams, can move quickly enough to play on PO, can play well enough to show strategically interesting play, then i think it's already a success of sorts - i definitely don't expect 3 of 3. i'm also interested in just having the part that computes nash equilibria for an n-turn game written in case i want to try it with other, simpler games as well. i think 1v1 would be mostly exactly solvable? i guess not for matchups where both pokemon have recovery moves... for the other cases, i'd think the hardest part would be handling randomness in the damage formula. specifically for 1v1, i guess i could store "has taken 3 ice beams" instead of running multiple simulations of 3 ice beams, and then it's easy to compute P(is KO'd) (and P(rest/recover fail)) symbolically whenever it's needed since the decision tree doesn't bifurcate after a KO happens like it does in a real game... hmm... btw, sorry if this has been answered somewhere else, but does anyone know specifically where integer rounding occurs in the damage formula? i can't seem to find consistent information on google.
|
|
|
Post by magic9mushroom on Feb 18, 2013 5:18:20 GMT -8
Even Chess is only weakly solved. Chess isn't weakly solved. Top computers beat top humans - that's not the same thing as the game being solved.
|
|