There are a number of advantages to this:
- you could get rid of large parts of the wiki and instead build documentation automatically from the source code.
- the game could have a built-in documentation browser that use the same data as the game, making it always up-to-date.
- users could much more easily mod the game, since they could probably understand this stuff better than C++
You could either generate C++ code from the plain text format, or parse it at runtime. The latter would allow more flexibility and would be what I would suggest.
An example of what I mean:
data/items/apple_iron.txt:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
id: iron_apple
type: item
texture: apple_iron.png
name: _("Iron apple")
stackable: yes
eatable: yes
heart: 4
description: _("Iron apples heal 4 hearts when eaten and are much more
rare than regular apples. To eat one, place one or more on the ground
and right click it. You can obtain them by picking them off of apple
trees. Before apples are removed from the tree, they won't fall to the
ground and blocks can be built upon them.")
The _("") here are to allow for the possibility of translations once Irrlicht can use TrueType fonts.
data/crafting/apple_iron.txt:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
in_1: steel_ingot
in_3: steel_ingot
in_4: apple
in_5: steel_ingot
in_7: steel_ingot
out: iron_apple
data/cooking/cooked_rat.txt
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
out: cooked_rat
in: rat