Looking for a data mapping format with inheritance

dempereztnick

New Member
Right now, I have many XML's describing all game objects, with its properties set. For example:\[code\]<gameObject id="commonEnemy"> ... <data> <life>100</life> <speed>12</speed> </data> <tags> <tag>KILLABLE</tag> <tag>COLLIDABLE</tag> </tags> ...</gameObject>\[/code\]All files have different "components" (like data and tags in the example above). There are nearly a thousands of these files, consuming much disk-space. But since some gameObject "share" some properties with others, I can make a default file and inherit other files from it, thus changing only what is needed. Something like:\[code\]<gameObject id="badassEnemy" import="commonEnemy"> ... <data> <life>200</life> <!-- I'm increasing the life --> </data> <tags> <tag>KILLABLE</tag> <!-- And is not more collidable. Totally weird XML syntax, but just to make a point --> remove <tag>COLLIDABLE</tag> </tags> ...</gameObject>\[/code\]But as far as I know, XML don't support by default inheritance, nor it is very friendly of merging nodes.What I need is some format which allows me to:
  • Inherit from one object
  • Add a simple type and array type
  • Modify a simple type and array type
  • Delete a simple type and array type
The array should be accesed by index or something like that.I looked on the diff format, but I can't use that, because if I ever change the default type, all the children will be broken.I know that a custom binary file would be the way to go to save up disk space, but the object must be editable with a simple notepad application.I also looked on JSON and YAML, neither of them seems to have inheritance in mind.Is there some data format which allows me to do what I want? Or I need to write my own data format and parser?
 
Back
Top