Skip to content

Replace XML format for data by a more convenient format #102

@Grimmys

Description

@Grimmys

Currently, data for all entities of the game are stored in XML format.

Example for an item (located in data/items.xml):

<items>
    <bones>
        <name>
            Bones
        </name>
        <sprite>
            food/bone.png
        </sprite>
        <info>
            <en> The remains of a skeleton... Maybe there is a way to bring it back to life </en>
            <zh_cn> 骷髅残骸……也许有办法让它复活 </zh_cn>
        </info>
        <price>
            200
        </price>
        <category>
            None
        </category>
    </bones>
[... other items]
</items>

The issue is this language is not lean enough for such project and for beginners ; it's too heavy for something that deserves to be light.
Some other formats could convey the same amount of information in a simpler way, such as YAML.

Example for the same item in YAML:

items:
    - name: Bones
      sprite: food/bone.png
      info:
        en: The remains of a skeleton... Maybe there is a way to bring it back to life
        zh_cn: 骷髅残骸……也许有办法让它复活
      price: 200

It's much shorter!

Other possibility is JSON.

[{
      "name": "Bones",
      "sprite": "food/bone.png",
      "info": {
          "en": "The remains of a skeleton... Maybe there is a way to bring it back to life",
          "zh_cn": "骷髅残骸……也许有办法让它复活"
      },
      "price": 200
}]

Similar length as YAML.

Metadata

Metadata

Assignees

No one assigned

    Labels

    refactorRelates to code refactoring

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions