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.

No comments:

Post a Comment

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...