Post by jsager on Jun 24, 2008 15:08:28 GMT
Just for a little clarification, let's take numbered section 1 from Flight From The Dark.
Here it is represented in the AON XML format:
<section class="numbered" id="sect1">
<meta><title>1</title></meta>
<data>
<p>You must make haste for you sense it is not safe to linger by the smoking remains of the ruined monastery. The black-winged beasts could return at any moment. You must set out for the Sommlending capital of Holmgard and tell the King the terrible news of the massacre: that the whole <ch.eacute/>lite of Kai warriors, save yourself, have been slaughtered. Without the Kai Lords to lead her armies, Sommerlund will be at the mercy of their ancient enemy, the Darklords.</p>
<p>Fighting back tears, you bid farewell to your dead kinsmen. Silently, you promise that their deaths will be avenged. You turn away from the ruins and carefully descend the steep track.</p>
<p>At the foot of the hill, the path splits into two directions, both leading into a large wood.</p>
<choice idref="sect141">If you wish to use your Kai Discipline of Sixth Sense, <link-text>turn to 141</link-text>.</choice>
<choice idref="sect85">If you wish to take the right path into the wood, <link-text>turn to 85</link-text>.</choice>
<choice idref="sect275">If you wish to follow the left track, <link-text>turn to 275</link-text>.</choice>
</data>
</section>
As you can see, the XML is really designed as an amalgam of presentation related data (<p> tags and <link-text> tags) and one bit of gameplay data.
I think the XML itself needs some improvement to allow programmers to fully interpret the section properly without having to write any custom logic just to figure out what's going on. Here's how I would redesign it:
<section id="sect1">
<title>1</title>
<text>
<p>You must make haste for you sense it is not safe to linger by the smoking remains of the ruined monastery. The black-winged beasts could return at any moment. You must set out for the Sommlending capital of Holmgard and tell the King the terrible news of the massacre: that the whole <ch.eacute/>lite of Kai warriors, save yourself, have been slaughtered. Without the Kai Lords to lead her armies, Sommerlund will be at the mercy of their ancient enemy, the Darklords.</p>
<p>Fighting back tears, you bid farewell to your dead kinsmen. Silently, you promise that their deaths will be avenged. You turn away from the ruins and carefully descend the steep track.</p>
<p>At the foot of the hill, the path splits into two directions, both leading into a large wood.</p>
</text>
<choice target="sect141">
<text>If you wish to use your Kai Discipline of Sixth Sense, <link-text>turn to 141</link-text>.<text/>
<dependency type="discipline" target="sixthsense"/>
<choice target="sect85">
<text>If you wish to take the right path into the wood, <link-text>turn to 85</link-text>.</text>
</choice>
<choice target="sect275">
<text>If you wish to follow the left track, <link-text>turn to 275</link-text>.</text>
</choice>
</section>
Now in this version of the XML, the fact that there is a dependency attached to the choice allows programmers who are trying to interpret this numbered section to get both all of the textual markup and all of the gameplay functionality built in.
Here it is represented in the AON XML format:
<section class="numbered" id="sect1">
<meta><title>1</title></meta>
<data>
<p>You must make haste for you sense it is not safe to linger by the smoking remains of the ruined monastery. The black-winged beasts could return at any moment. You must set out for the Sommlending capital of Holmgard and tell the King the terrible news of the massacre: that the whole <ch.eacute/>lite of Kai warriors, save yourself, have been slaughtered. Without the Kai Lords to lead her armies, Sommerlund will be at the mercy of their ancient enemy, the Darklords.</p>
<p>Fighting back tears, you bid farewell to your dead kinsmen. Silently, you promise that their deaths will be avenged. You turn away from the ruins and carefully descend the steep track.</p>
<p>At the foot of the hill, the path splits into two directions, both leading into a large wood.</p>
<choice idref="sect141">If you wish to use your Kai Discipline of Sixth Sense, <link-text>turn to 141</link-text>.</choice>
<choice idref="sect85">If you wish to take the right path into the wood, <link-text>turn to 85</link-text>.</choice>
<choice idref="sect275">If you wish to follow the left track, <link-text>turn to 275</link-text>.</choice>
</data>
</section>
As you can see, the XML is really designed as an amalgam of presentation related data (<p> tags and <link-text> tags) and one bit of gameplay data.
I think the XML itself needs some improvement to allow programmers to fully interpret the section properly without having to write any custom logic just to figure out what's going on. Here's how I would redesign it:
<section id="sect1">
<title>1</title>
<text>
<p>You must make haste for you sense it is not safe to linger by the smoking remains of the ruined monastery. The black-winged beasts could return at any moment. You must set out for the Sommlending capital of Holmgard and tell the King the terrible news of the massacre: that the whole <ch.eacute/>lite of Kai warriors, save yourself, have been slaughtered. Without the Kai Lords to lead her armies, Sommerlund will be at the mercy of their ancient enemy, the Darklords.</p>
<p>Fighting back tears, you bid farewell to your dead kinsmen. Silently, you promise that their deaths will be avenged. You turn away from the ruins and carefully descend the steep track.</p>
<p>At the foot of the hill, the path splits into two directions, both leading into a large wood.</p>
</text>
<choice target="sect141">
<text>If you wish to use your Kai Discipline of Sixth Sense, <link-text>turn to 141</link-text>.<text/>
<dependency type="discipline" target="sixthsense"/>
<choice target="sect85">
<text>If you wish to take the right path into the wood, <link-text>turn to 85</link-text>.</text>
</choice>
<choice target="sect275">
<text>If you wish to follow the left track, <link-text>turn to 275</link-text>.</text>
</choice>
</section>
Now in this version of the XML, the fact that there is a dependency attached to the choice allows programmers who are trying to interpret this numbered section to get both all of the textual markup and all of the gameplay functionality built in.