0
\$\begingroup\$

While developing an engine for text-adventures I'm still unsure how to expose the API it provides to the developers/writers. My two concepts for now are:

  1. Running a small JS engine which executes JS script files (in comparison to a full DSL) where devs/writers can access a well-defined subset of functions and classes.
  2. Parsing XML files which define levels, objects, entities, ... so that no real programming knowledge is necessary if the devs/writers stick to the conventions concerning the structure of these files.

Which of these approaches (or even other ones I haven't thought about yet) is more likely to be recommended?

\$\endgroup\$

2 Answers 2

1
\$\begingroup\$

I would recommend XML, XML with XSLT support or YAML.

1) XML is good because of two main reasons: it's human readable format, which anyone can understand and use with minimal training and knowledge, and it's very easy to parse, support and extend, you probably already know that.

2) YAML just like XML is again human readable format, but also offers concise code, I guess they are alike in this matter.

http://www.yaml.org/

3) XML+XSLT is an ideal for me, because XSLT is actually touring complete language, so people can not only define leves and structures, but also implement some logic, for example randomly generating village with loops. But this option will require additional work on a client, and might create some head-ache if you haven't worked with XSLT before.

http://c2.com/cgi/wiki?XsltLanguage

\$\endgroup\$
2
  • \$\begingroup\$ Could you possibly elaborate on or provide some further resources fpr XML+XSLT? I am coding in C# so I have enough tools though I can not imagine how to combine these and use XSLT. \$\endgroup\$ Commented Jul 13, 2012 at 7:03
  • \$\begingroup\$ @ChristianIvicevic there is number of tutorials on XSL, here is one that seems quite interesting since it explains both transformations and merges (of multiple XML) files with XSL: docs.oracle.com/cd/B19306_01/appdev.102/b14252/adx_j_xslt.htm \$\endgroup\$ Commented Jul 13, 2012 at 14:30
0
\$\begingroup\$

I would go for parsing XML or YAML files with a clear and easily accessible documentation. This way the people who work with them never have to touch real code they might completely screw up.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .