Noxico


On dialogue and file formats

When I started on this game project, I put all the data in a bunch of XML files. Some of them were parsed into token trees before use, others were custom-parsed.

Eventually I felt like XML’s verbosity was unneeded, and I came up with a format that more closely matched the token tree data structure and was reasonably human-readable.

Recently I converted the second-to-last XML file to TML; the i18n word list and its related data, done mostly with a quickly whipped up converter and a little bit of aftercare. The only thing left in XML format is the game’s dialogue.

<scene id="GenericUnknownHottie" name="(starting node)">
	<filter target="bottom" type="relation" value="none" />
	<filter target="top" type="value_gteq" name="charisma" value="50" />
	<p>
		"Ah... Greetings, traveller," [b:he] says with a slightly flushed smile. "Can I... help you, maybe?"
	</p>
	<action name="introduce yourself" />
	<action name="invite to have sex" />
	<action name="no thank you goodbye" />
</scene>
 
<scene id="GenericIntroduceHottie" name="introduce yourself" list="Introduce yourself">
	<filter target="top" type="value_gteq" name="charisma" value="50" />
	<p>
		You tell [b:name] your name and flash [b:him] a twinkling smile.
	</p>
	<p>
		"It's a pleasure meeting you, [t:name]", [b:he] says a little flustered.
	</p>
	<script type="text/javascript">
		top.SetRelation(bottom, "acquaintance");
		bottom.SetRelation(top, "considers hot");
	</script>
	<action name="invite to have sex" />
	<action name="goodbye" />
</scene>
-- TML version
scene: GenericUnknownHottie
	start
	filters
		bottom: relation
			value: none
		top: has
			path: charisma
			value: >= 50
	$: ""Ah... Greetings, traveller," [b:he] says with a slightly flushed smile. "Can I... help you, maybe?""
	action: introduce yourself
	action: invite to have sex
	action: no thank you goodbye
 
scene: GenericIntroduceHottie
	name: introduce yourself
	list: Introduce yourself
	filters
		top: has
			path: charisma
			value: >= 50
	$: "You tell [b:name] your name and flash [b:him] a twinkling smile."
	$: ""It's a pleasure meeting you, [t:name]", [b:he] says a little flustered."
	script
		<[[
			top.SetRelation(bottom, "acquaintance", true);
			bottom.SetRelation(top, "considers hot");
		]]>
	action: invite to have sex
	action: goodbye

How exactly this data is used doesn’t matter here. No, what I’d like is opinions. So please tell me, does that example look readable? Do you maybe have another idea?

[ ]

Leave a Reply

Your email address will not be published. Required fields are marked *