Skip to content

Instantly share code, notes, and snippets.

@Sanqui
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Sanqui/640e36d8f6b5fb6d4357 to your computer and use it in GitHub Desktop.
Save Sanqui/640e36d8f6b5fb6d4357 to your computer and use it in GitHub Desktop.
pokedex game data table extravaganza
map
"A game-specific physical instance of a location_area"
* location_area
* version_collection (?)
* width
* height
map_connection
"A physical connection between two maps"
* map0
* map1
* side = enum(ns, ew, dive)
* order
map_entity
"A sprite, trigger, sign, or warp somewhere on an overworld map"
* map
* x
* y
* solid (bool)
* activation (enum: walk, action)
* sprite (NULL=no sprite)
map_entity_item
"An item obtainable from a map entity"
* map_entity
* item
* amount
* method = enum(found, obtained, ?)
map_entity_battle
"A battle with a trainer, linked to a map entity"
* map_entity
* trainer_battle
map_entity_pokemon
"A Pokémon linked to a map entity, either directly fought, received, or being an in-game trade."
* map_entity
* individual_pokemon
* event_type = enum(battle, receive, trade)
* traded_pokemon_species (nullable)
map_entity_shop
"A shop linked to a map entity. Does not include item trades. Everything in a shop can be bought repeatedly."
* map_entity
map_entity_shop_slot
"A single item/tutored move/Pokémon which can be bought in a shop."
* map_entity_shop
* item (nullable)
* individual_pokemon (nullable)
* move (nullable)
* cost
* slot
* currency
map_entity_move_tutor
"An overworld move tutor"
* map_entity
* move
map_entity_special
"A special-purpose map entity, such as the name rater, or the move deleter."
* map_entity
* purpose = enum(name_rater, move_deleter, move_reminder)
trainer_class
"An in-game trainer class. This also determines the trainers' battle sprite"
* name (multilang)
* identifier
trainer
"A trainer found in the game"
* trainer_class
* name (multilang)
* trainer_id
trainer_battle
"A particular battle with a trainer"
* trainer
* battle_style = enum(single, double, triple, rotation, sky, inverse)
* payout
trainer_battle_item
"A trainer's usable item in a particular battle"
* trainer_battle
* item
* amount
trainer_battle_pokemon
"A trainer's Pokémon in a particular battle"
* trainer_battle
* individual_pokemon
* slot
individual_pokemon
"An individual Pokémon inside a game, e.g. from a trainer or given to the player"
* pokemon_species
* level (nullable for e.g. trades)
* item
* is_egg
* ivs
* ability
* gender (nullable)
* enhanced_contest_stat (gen 3 trades)
* nickname (multilang)
* original_trainer
individual_pokemon_move
"An individual Pokémon's move. If a Pokémon has no move row, they are
supposed to simply know level-up moves at their level"
* individual_pokemon
* move
* slot
currency ; e.g. money, coins, ash, berrypowder, bp, pokemiles
* name (multilang)
* introduced_in? probably pointless
pokedex_media would gain:
- all static maps
- gen 4 and 5 maps rendered orthogonally
- all front-facing overworld sprites
- all trainer class sprites
@magical
Copy link

magical commented Jun 14, 2014

Suggestions/comments:

  • rename map_entity to point and drop entity_ from map_entity_item, map_entity_trainer, map_entity_pokemon, map_entity_move_tutor
  • make shops first-class: shop and shop_item (or mart and mart_item)
  • maybe tutors too idk
  • give trainer and shop a version column
  • give trainer and shop a location column
  • trainers should have a payout
  • i'm not sure about lumping trainer pokemon and event pokemon together
  • i don't like the name individual_pokemon but i don't have any better ideas
  • map_connections is confusing
  • map_entity_item.obtained should be an enum or have a better name or be two separate tables
  • map_entity_move_tutor: some tutors teach multiple moves
  • do we really need trainer_class.pair?

@Sanqui
Copy link
Author

Sanqui commented Jun 14, 2014

  • give trainer and shop a version column

Yeah, this is an issue, I'd prefer to give it to entity. As is, the map's version_collection would apply to all descendant things, including trainers and shops.

  • trainers should have a payout

I think in some games (gen 1?) payout is based off the last pokémon you defeat...

  • map_entity_move_tutor: some tutors teach multiple moves

Then there's multiple map_entity_move_tutor columns pointing to the same map_entity, much like how one map_entity can give out multiple items, or have multiple trainer battles (or have a trainer battle and give an item, etc.)

  • do we really need trainer_class.pair?

I was thinking it could be a grammar thing somewhere maybe.. The data is there, so why not include it.

Mostly agree with the rest.

@magical
Copy link

magical commented Jun 14, 2014

Yeah, this is an issue, I'd prefer to give it to entity. As is, the map's version_collection would apply to all descendant things, including trainers and shops.

I'd like to be able to select "trainers on route 2" or "shops in lilycove" without having to go through the map table

I think in some games (gen 1?) payout is based off the last pokémon you defeat...

Yes. iirc it's level of last pokemon * base payout in all the games. We should have the base payout. (Oh I guess it's actually a property of the trainer class, not the trainer.)

@Sanqui
Copy link
Author

Sanqui commented Jun 14, 2014

I'd like to be able to select "trainers on route 2" or "shops in lilycove" without having to go through the map table

If you're looking up route 2 trainers, I don't think it's so outrageous to have to go through the route 2 map.

@magical
Copy link

magical commented Jun 14, 2014

From IRC:

>map_entity_move_tutor: some tutors teach multiple moves
then there's multiple map_entity_move_tutor columns pointing to the same map_entity
much like how one map_entity can give out multiple items, or have multiple trainer battles

Oh, huh. That wasn't obvious.

@magical
Copy link

magical commented Jun 14, 2014

If you're looking up route 2 trainers, I don't think it's so outrageous to have to go through the route 2 map.

It's a relational database; there doesn't have to be a strict hierarchy. We should keep the database as modular as possible: if i don't care about the detailed map data i should be able to ignore it.

@Sanqui
Copy link
Author

Sanqui commented Jun 15, 2014

Oh, huh. That wasn't obvious.

I can't really think of a better way.. Basically, _tutor, _trainer, _item, _shop etc. for entities are like events which the entity can emit.

If you're looking up route 2 trainers, I don't think it's so outrageous to have to go through the route 2 map.

It's a relational database; there doesn't have to be a strict hierarchy. We should keep the database as modular as possible: if i don't care about the detailed map data i should be able to ignore it.

For one, it's simply redundant. Are there other instances of redundancy like this in pokedex right now? Besides version stuff.

Also, In Red/Blue, there are different trainers on different routes, but pointing to identical parties. That's why you can't simply slap location on a trainer, because it can be pointed to from both route 24 and 25 entities.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment