Open pointcache opened 8 years ago
Idea: Have a mechanism allowing to read text files in game directory and load data from them as entities on demand.
Benefits:
Proposal:
public Entity Template.LoadByName(string name) // LoadById(string id)
< chicken
name = "Chicken"
[Position]
[Creature]
max_hp = 90000
attack_dmg = 1
attack = "meelee"
range = 1
speed = 1
run_speed = 3
[Animal]
type = "Chicken"
[ColorComponent]
color = #ffffff
[WorldView]
prefab = "animals/chicken";
[Loot]
loot_table{
"chicken", 1, 10
"feather", 3, 6
}
>
< chicken_brown
parent = chicken
[ColorComponent]
color = #ffffff
>
< feather
name = "Feather"
[Position]
[Item]
mass = 0.01
>
an example of a template document, several in one, parenting, custom serialization
Task:
Example: The way how Dwarf Fortress stores game data/definitions is perfect example: