Want a new Microformat type you never asked for? About Pokemon?
Well, okay, I’ll make a deal. I get to ramble about my niche nerd hobby, and you get to see an example of how Microformats can be extended to do whatever you want!
Anyway, ever since Pokemon Sword and Shield came out, I’ve been kinda obsessed with the game. This is really impressive, given that I haven’t played a game in the franchise longer than a few hours since Red and Blue. To the extent that I’ve decided to get into competitive battling after one player described it as a combination of poker and chess. Now, in addition to the moment to moment strategy during a battle, one of the most important aspects of competitive battling is team building.
Since I’m an IndieWeb nerd, and I want to Own My Data, I decided to store my teams on my blog. A note or an article is sufficient to handle this, but I eventually want to write analysis programs and making my teams machine-readable, in addition to human-readable is crucial to this goal.
First, we need data to mark up. I used Pokemon Showdown, which is the most widely used tool for team building and competitive play, to generate my team. It’s pretty elaborate and allowed me to export my team to a text-based format. Perfect. Here is an example of one of my team members, mah boy Gallade:
Gallade (M) @ Life Orb
EVs: 252 Atk / 4 SpD
IVs: 0 Spe
- Drain Punch
- Psycho Cut
- Swords Dance
Now, we just need a way to mark up this plaintext into something machine-readable.
I love Microformats. It’s one of the building blocks of the IndieWeb and lets us turn plain HTML into something that can be easily analyzed and parsed by machines. Sadly, certain important values don’t currently exist. As in all of them aside from the name. What follows is the marked-up entry.
<span class="p-name">Gallade</span> (M) @ <span class="p-item">Life Orb</span>
Ability: <span class="p-ability">Steadfast</span>
Level: <span class="p-level">50</span>
EVs: <span class="p-ev">252 Atk / 4 SpD</span>
<span class="p-nature">Brave</span> Nature
IVs: <span class="p-iv">0 Spe</span>
- <span class="p-move">Drain Punch</span>
- <span class="p-move">Psycho Cut</span>
- <span class="p-move">Swords Dance</span>
- <span class="p-move">Protect</span>
Here is an explanation of each root class.
- h-pokemon-team: The outer container. This defines the team that is being built. Each team should contain elements with the class h-pokemon. It may also contain children with standardized properties, such as “p-name” for naming the team, or “p-note” for making notes about the team, such as inspiration or if you are going for a more offensive or defensive team. The possibilities are endless!
- h-pokemon: The inner container for an individual pokemon. It needs to be a root element, rather than a property so that the parsed pokemon’s properties will be children of the pokemon itself, rather than properties of the team as a whole.
For each pokemon child, there are several properties. All properties are optional, though the name is strongly encouraged.
- p-name: A standard property. Defines the name of the pokemon. While technically optional, the entry isn’t going to make much sense without it.
- p-item: The held item of the pokemon.
- p-ability: The pokemon’s ability.
- p-level: The pokemon’s level. Not really required, as more battles will standardize all pokemon to level 50 in the competitive scene.
- p-ev: The EV spread of the pokemon. At the moment, I’ve got the entire thing wrapped in this property, but it may be better to wrap each individual EV in its own property, rather than the slash-separated format it is in. I’m going to be playing around with this.
- p-iv: The exceptional IV of a pokemon. Typically, IV’s are only notated when they are NOT 31. They are assumed to be 31 if left out.
- p-nature: The nature of the pokemon.
- p-move: Each move should be wrapped in this property. There should be no more than 4 moves listed.
If any property aside from p-iv or p-item is missing, the Pokemon should be interpreted as a WIP and incomplete, and not ready for battle.
The parsed JSON of this example is as follows:
"252 Atk / 4 SpD"
So, there are some other properties that I’m contemplating. For instance, a “u-battle-format” or “u-ruleset” property for the h-pokemon-team, which could be a link to the ruleset or battle format for verification purposes. This presents exciting possibilities for validation, though marking up the ruleset would be its own challenge.
A “p-nickname” would be neat on the Pokemon so we can give custom names to our team would also be nice, as well as adding some way to specify if it is a shiny or not. Gender is also sometimes important, as there are moves that can change effects depending on the gender of the pokemon.
I also want to extend Post Kinds to handle this markup without needing to go in and mark up everything by hand.
Why. Just… Why
Well, mostly because I’m a nerd who wants to keep a record of everything for easy reference. A lot of people treat their IndieWeb blogs as a sort of Commonplace Book, and having all this information would be handy for retrospectives and further development in whatever field you are interested in, and I don’t see why gaming would be an exception to that.
The other reason is that I feel there is a LOT of potential with IndieWeb protocols beyond just messaging. One cool proposal I’ve seen is a format for playing chess via a play by post, sending moves to each other with web mentions, and structuring everything with Microformats. What if we could set up a server to do the same with competitive Pokemon? What if we made an ARG built on the same stuff? Really, the building blocks are there to create whatever we wish. So, I wanted to give an example of how we can take these building blocks and take it beyond simple blogging. 🙂
Anyway, here is my first team. If you play, let me know what you think. If you don’t play, well, I’m sure it’s a data point in your hacking.