New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
battle_tag is wrong for invite-only battles #88
Comments
Hey @Jay2645, Thanks for opening this issue. I don't think the recent commits have changed anything in the way battle tags are parsed, since the battle tag extraction logic has not changed in the last yearr. It might be a showdown update though. Regardless, I'll try to push a patch to fix this by tomorrow :) On the error management: it's the first time I see an error sent by PM; I've never tested invite-only battles - how do I start one, and what's the fastest way to experiment with them? |
I've never done an invite-only battle myself, but looking at the Showdown UI there's a new "Don't allow spectators" box under the "Search for battles" button. I'd assume that's what's causing this, and that's why I've seen an uptick in this sort of thing recently. I've just been sending a bot out into the ladder; it happens every half-hour or so. I agree that it's a little strange to get errors over PM -- my guess is that since Showdown doesn't know what room you're trying to send a message in, it defaults to sending you a PM instead. |
Well, thanks for crash testing this :) This is super valuable feedback; I'll fix the private-battle thing asap and take a deeper look at the PM errors. Out of curiosity, what kind of performance are you getting with your bots? |
I've been using your Showdown fork to train using a very heavily modified version of the OpenAI Gym example. I've updated the neural net a bit (not sure if these settings are optimal -- it's my first time using ML outside of basic "hello world" stuff):
The input has also been expanded from 10 inputs to about 1500 or so. It stores as much information as I can get about every known Pokemon, known move, and field condition (and I probably missed a few). I made a fork of this to turn the enums you used into
(Yes, the code is terrible -- this is mostly for my own playing around more than anything else!) I've done similar things for weather, status, and pretty much any other enum -- just so I could get them within that magical 0-1 range. I'm also doing it for items/abilities (I added an Itemdex script to match the others):
Against the random player agent, I can get about a 95% winrate. Against the example max damage agent (modified to take into account STAB, type resistances, etc.), I can get about a 60% winrate. I have a third "hybrid" agent, which is basically the max damage agent but has a percentage chance of doing something random instead. If the hybrid agent loses, that "random move" chance is decreased; if it wins, the "random move" chance is increased. There's also a setting to add a floor in order to make sure it doesn't just devolve into the random agent over time. Training against the hybrid seems to help learning somewhat, since otherwise the Deep Q agent was just getting absolutely flattened and never seemed to learn anything. This is its first real field test against humans -- I left it to train overnight and came back to find out it kept getting booted out of battles because of this ID mismatch. I did a hack on my end to just pass the entire Showdown-reported |
I guess while we're on the topic of errors -- and this is more of a feature request (I can put it in another ticket if needed) -- would it be possible to throw an exception when we're being rate limited? This is the Showdown code:
IIRC, right now that |
Great work on the DQN! You might be interested in using this agent during training, if you're looking for something stronger than the max damage player. I can a look at the rate limiting issue too. |
I haven't been able to reproduce the issue you encountered with invite only battles; there has been two commits to showdown which involve them since my local showdown fork was updated though, so it might come from there. Let me know if it persists! Regarding the other issues you mentioned (eg. pm errors and rate limiting), would you mind opening separate issues? |
Tried latest out and it seemed to work!
Closing this ticket. 🥇 |
My AI kept randomly not doing anything in some battles, so I did some investigating.
Turns out these errors were being put into the log:
The root cause:
As you can see, the battle's "real" ID is
battle-gen8randombattle-1220084985-pgoxls8251t2qkotmilabhfhov3uhlepw
, but because of the way that thebattle_tag
is being split, thebattle_tag
isbattle-gen8randombattle-1220084985
.Would it be possible to throw an exception when
/error
is received in a PM (to identify when this happens) and also to fix how thebattle_tag
is generated for invite-only battles? I think this is a recent change, since I wasn't seeing it a couple days ago.The text was updated successfully, but these errors were encountered: