Whats the deal with saving item/move/etc info in a .txt file?

Discussion in 'Development General' started by dgs3, Jun 29, 2012.

  1. dgs3

    dgs3 New Member

    Joined:
    Dec 31, 2010
    Messages:
    11
    Likes Received:
    0
    Hey devs,
    So I'm lookin around the packaged contents of PO.app, and it looks like descriptors and attributes of all the items, pkmn, moves and stuff like that is being saved as a .txt file (in Contents/Resources/db/ on my mac)? Is there a reason its being saved that way?
     
  2. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    It was the simplest way? =)

    For info, loading from text files is as fast as loading a db (as a db does have to load from a file too), and it's faster to have stuff stored in arrays directly than query a sql engine every time.

    Maybe some optimization could be done, like loading some files on a need basis (like some old gen stuff).

    If there's a better system, why not, but it's fine and efficient as it is.
     
  3. dgs3

    dgs3 New Member

    Joined:
    Dec 31, 2010
    Messages:
    11
    Likes Received:
    0
    So a refactor to read from some format like .json or .xml would be welcome then?
     
  4. Lamperi

    Lamperi I see what you did there

    Joined:
    Apr 25, 2010
    Messages:
    2,647
    Likes Received:
    11
    Whole src/PokemonInfo is build on top of indexing. I think the refactoring would be too big. Unless you opt to not change the API, in which case other forums do not make sense.
     
  5. Kalashnikov

    Kalashnikov Despite the code quality

    Joined:
    Apr 4, 2011
    Messages:
    434
    Likes Received:
    0
    If you plan to refactor, then why not SQL?