Go to the first, previous, next, last section, table of contents.

## GDL Design Decisions

The most fundamental decision is that GDL is declarative rather than procedural. This may have advantages in making game definitions readable or limiting the consequences of buggy GDL, but the key advantage is that a generic AI can cope with a declarative language. For example, suppose that a hypothetical game design language had a procedure that got run to figure out the results of combat. It is very powerful and simple: run this procedure, and you know whether the attacker or defender wins. But the problem is that pretty much all you can do with it is run it. The AI can't reason about what kinds of units are best as attackers, which are best as defenders, or the like.

Having decided on a declarative language, there is still the syntax. GDL uses an s-expression syntax (which comes from Lisp). The main popular alternative to s-expressions these days seems to be XML. For example:

    (table mp-to-leave-terrain
      (ground water 99)
      (armor (swamp forest mountains) 99)
      )

might become

    <table name="mp-to-leave-terrain">
      <entry>
        <ref>ground</ref>
        <ref>water</ref>
        <value>99</value>
      </entry>
      <entry>
        <ref>armor</ref>
        <list><ref>swamp</ref><ref>forest</ref><ref>mountains</ref></list>
        <value>99</value>
      </entry>
    </table>

Given the conciseness of the s-expression syntax, it seems unwise to simply dismiss it as an anachronism. The real question is what would be the benefits of an XML syntax - for example would it enable data exchange, and if so with what (XML editors? Game design tools?).

Also see section Rationale and Future Directions.

Go to the first, previous, next, last section, table of contents.