User talk:Technomage

New YAML Dialogue File Syntax
Based on the recent proposed changes to the in-memory dialogue data structures I feel that a reevaluation of the YAML dialogue file syntax is in order. In particular, I think that the syntax of the YAML files should more closely match the new in-memory data structures.

The Techdemo1 DialogueEngine actually worked the other way around: it based the in-memory data structures on the desired YAML syntax. The problem with this approach is that it integrated the YAML parsing code with the rest of the DialogueEngine, which would not only make it difficult to switch to a different scripting language in the future but it also means that maintainers of the DialogueEngine code would have to deal with and understand its YAML/PyYAML elements. See Proposal:Dialogue_Engine for further discussion on this topic.

The benefits of making the YAML syntax more closely represent the in-memory data structures are multifaceted. The new syntax would be much more explicit (see below), so contributors and modders who learn the YAML syntax would already have a good understanding of the DialogueEngine and how it functions which would help lessen the learning curve for newbies. It would also simplify the YAML dialogue file parsing code a bit, making it easier to maintain in the long run. (TODO expand on these points: )
 * Separates maintenance of DialogueEngine from maintenance of YAML parser/serializer
 * explicit is better than implicit

Example of new syntax (TODO):

The proposed syntax differs from the Techdemo1 syntax in that it clearly differentiates between actions (verb keywords) and attributes (nouns) (TODO expand on this).

Alternatively, the "text" keyword can be replaced with the more familiar "say" and "reply" keywords for dialogue sections and responses, respectively. Note, however, that "say" and "reply" would just be syntatic sugar for "text" since neither would be commands in the new DialogueEngine. The DialogueEngine no longer deals with displaying text to the player, but instead makes that text available and delegates to the gui subsystem.