Friday, March 29, 2019

Feature Spotlight: Raid Trains

Well, boys and girls, it's time to unveil a super-secret brand-new feature for Meowth 3.0! I'm really excited about this one but hoo boy did it take some doing. I'm pretty tired and it's about time to leave my day job for the weekend so I'm gonna try to get through this one really quickly.

Raid Trains

When I first thought about making Meowth almost two years ago, when raids had been in the game for mere weeks, I noticed that a lot of players tended to jump from raid to raid in sequence, picking up new players here and there as they went. I've heard a few different names for this phenomenon but the one that always stuck with me was "raid train." My first thought when writing Meowth was to have a channel for each of these groups as they went from place to place. But at the time I couldn't figure out how to make that work because I barely knew how to do anything back then. I was and still am really happy with what I ended up with in having a temporary channel for each reported raid. But it nagged at me that it forced users to hop from channel to channel. The massive reorganization that I did for 3.0 allowed the "raid train" channel idea to come back, and I think this has the potential to streamline raid coordination in a really significant way. So let's dive in and talk about how a raid train works in Meowth 3.0.

Let's say you are wanting to do a few raids in a row and have plenty reported raids to choose from. When you type !train, Meowth will show you a list of all the raids that have been reported, and ask you to use a reaction to choose your starting raid. Meowth will create a channel for the raid train and allow people to join your train officially via reactions or a !join command in the train channel. While a raid is selected, the train channel behaves exactly like a temporary raid channel for the current raid, with some additions. First, Meowth will send the list of reported raids for users to vote on while the current raid is in progress. Second, newly reported raids get their own message sent to the train channel, and users can vote to go to new raids next from those as well. When you are finished with the current raid (whether you actually do the raid or decide to go to a different one instead) you can type !next and Meowth will determine which raid is next by counting the reaction votes for each raid. Whichever raid has the most votes will be next, and Meowth will clean up its messages relating to the old raid and set up the train channel for the next one.

One thing to note here is that every Discord user still handles their own RSVPs for each raid during the train. Also, if there are any other channels dedicated to the same raid (whether a raid channel or a train channel) all RSVPs will be sent to all the channels so that everyone knows who's coming to the raid. So joining the train does not free you from updating your status. I imagine the typical use case will be one Discord user per car updating RSVPs for whoever is in that car, but you could also designate one person to handle RSVPs for everyone by including the whole train in that user's total.

The last thing I'll mention is that every time a user leaves a train either by sending !leave to the train channel or by using the reaction in the report channel, Meowth checks to see if there is anyone left in the train. If there is no one left in the train, Meowth will automatically end the train and delete the channel. I will probably add some sort of check for inactivity soon just in case people forget to leave their trains.

There is also some really cool quality of life features in this that I'm really happy about. If your server utilizes the gym database, Meowth will include the travel times between gyms that it knows about when asking you to select the next raid. This only works if the current raid is at a known gym. So this should help you figure out which raid you want to do based on which gym is closest and when the raids are expiring (all of which is information Meowth helpfully includes when asking you to vote on the next raid).

There's still quite a bit of refining that needs to be done on this one, but it's Friday and I managed to get it functional so I wanted to let you guys know about it! Go test it out on our support server!

Monday, March 4, 2019

Feature Spotlight: Trading

It's time for another somewhat-polished feature of Meowth 3.0 to be given the spotlight, and this time it's all about the revamped trade feature. This one was quite easy for the most part for a number of reasons. It was the last major thing I wrote for Meowth 2.0, and so it needed quite a bit less work to fit it into 3.0, as it's really the only 2.0 feature sort of written in the 3.0 style so to speak. Even in 2.0 it was its own module, it had a data class with methods... you know, the way people who actually know how to write Python do! So a straight port to 3.0 would have been very easy. But I didn't want to do just a straight port, so I added a few bells and whistles based on the feedback I've gotten for trading in 2.0.

What's Old

This is all going to feel very familiar if you've used the trade command at all in 2.0. The premise is basically the same. You use the trade command, and tell Meowth what Pokemon you are offering to trade. Meowth asks you what you will accept in exchange. You give it a list. Meowth creates a pretty message summarizing. Other people use reactions to make you an offer. You get a DM for each offer, and you can either accept or reject. If you accept an offer, the reactions on the original message are cleared and the message is edited to reflect the accepted offer.

What's New

The first big thing is you are now able to offer multiple Pokemon in one trade. If you do this, Meowth won't attach a sprite thumbnail to the trade message. Whenever someone makes an offer on your trade, Meowth asks which of the Pokemon you are offering they are wanting to trade for. Hopefully this streamlines the trading channels a lot since users don't have to make a whole bunch of trades if they have a whole lot to offer.

The next thing is the addition of a lot more detail. You can use the same strings to specify things like moveset and level that you would when reporting a wild Pokemon. So for instance if you are trading a Gengar with Shadow Claw, you can type:

!trade "Gengar @shadowclaw"

As with the wild command, for multiple words in the command to be treated as one argument - in this case, a Pokemon, you need to enclose each group of words in quotes. IVs cannot be specified for trade offers since those attributes are re-rolled.

When telling Meowth what Pokemon you will accept in exchange, you still separate Pokemon with a comma. This does mean you have two different ways of specifying a list of Pokemon in the same command, but it was the easiest way to code things, since in the first case the Discord library is parsing arguments in a command, whereas in the second the whole message content has to be handled as one string, and then split into multiple arguments.

There's also two new special arguments you can give when specifying Pokemon you will accept in exchange for your trade offer(s). If you are wanting to selflessly give away some rare Pokemon, you can type 'any' to let people know you will accept anything. If you are wanting something good in exchange but don't want to tie people down, you can type 'obo' to let people make you an offer that is not on your list. Other users can specify the Pokemon they're offering you in the same format that you specify your Pokemon. Attributes like shininess, gender, level, and movesets can all be specified.

In 2.0 there was a step for confirming a trade once it had taken place. This wasn't very useful in the first place and it often didn't work in the second. Additionally, in 2.0 trade offers would stop responding after a while. That issue shouldn't be present in this version. Also, in 2.0 Meowth enforced a "clean" trade channel and deleted all messages from other users. This will be an option in 3.0 but not enforced.

The new and improved trade feature is available to test on our support server. Go break it!

Roadmap Update

Finally, I wanted to give an update on the timetable for 3.0. Things are progressing pretty well at this point. I am getting to a busy time of year at work but I was able to get this feature done in about a week or so. Here's what's left to do, along with my estimates on how long each thing should take:
  • Research (1 week)
  • EX Raids (1-2 days)
  • Clean mode option (1-2 days)
  • Super secret feature (1 week)
  • Configure (1 week?)
  • Error handling, documentation, polish (1 week?)
So with all that, I'm hoping everything will be finished by the end of March. I realize I said the same thing at the beginning of February, but ¯\_(ツ)_/¯

That's all I have for now! Thanks as always for the support.

Changes to Research

More details on today's changes to the research command are below. A new optional argument has been added to the research command. Thi...