Pokémon Lua tables thing

From Test Track 4 Wiki
Revision as of 07:19, 31 October 2010 by STUART (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

I'm writing a bunch of Lua tables containing data from the Pokémon games. My goal is to keep a sort of Platonic ideal of data from the games in a format that is as simple as possible while keeping the data clean of any original terms or concepts.

Contents

Dilemmas

Structuring data for Pokémon with alternate forms: Gen IV index number or sub-table?

For instance (413 is Wormadam):

basestats.attack[413]={59,79,69}; forms[413]={"Grass Cloak","Sandy Cloak","Trash Cloak"}
--vs.--
basestats.attack[413]=59; basestats.attack[499]=69; basestats.attack[500]=79;
forms[413]={
  ["Grass Cloak"]=413,
  ["Sandy Cloak"]=499,
  ["Trash Cloak"]=500}
  • Sub-tables:
    • Pros:
      • Keeps the table length at 493 with no holes
      • Pokemon with forms instantly detectable by type checking
      • Forms data is a simple list
      • Alternate forms are always under the base number
    • Cons:
      • Requires code to handle table/form cases
  • Gen IV index numbers:
    • Pros:
      • 1-493 still work normally
      • All values are numbers
      • Expresses more data (index number mappings)
      • Closer to games (other way relies on external forme order)
    • Cons:
      • maxn is five hundred some with holes (eggs)
      • First forme is at normal index, which might not be a proper default (Wormadam)
      • Alternate form indices are even more arbitrary than sub-table indices

Originally, I used the former (no pun intended), but I've since switched to the flat index approach. In the end, it's the simpler one.

Possible snafus going into Gen V

Gen V upsets assumptions from the first 4 versions with these firsts:

  • A Pokémon with a Regional Pokédex number of 0 coming before the three starter families.
  • Current gen Pokémon can have 3 possible abilities due to the way transferring works.

I plan to implement Gen V data (except for names) once the index numbers are published (assuming they keep the layout of Gen IV).

Needed data

Data I can't cull from the source for a page on Bulbapedia:

Also

Uses

Something not unlike http://veekun.com/dex/gadgets/pokeballs

Similar projects

http://bugs.veekun.com/projects/pokedex

Hey you know what would be cool

What would be cool is if Nintendo were to re-architect The Pokémon Company like 343 Industries and the new version of The Pokémon Company set up something like ISO. It would have to go up that high because LOL POKEMON COMMUNITY

Personal tools