On this page:
1.1 State of Random Map Scripting
1.2 Closing The Gaps
1.3 Development Philosophy
8.18.0.13

1 Motivation🔗ℹ

1.1 State of Random Map Scripting🔗ℹ

Current iteration of the Age of Empires 2 Random Map Scripting Language is quite limited in terms of features that the developers may come to expect from other general purpose languages.

You may want to refer to this document for full overview of the current state.

Some of the most bothersome features it lacks:

No support for user defined functions, little or no support for modules, lack of looping structures, limited conditional logic, limited math support, etc.

Over the years, the map makers have shown remarkable passion and determination in working around these limitations (and more) through:

  • Various very specific generator scripts, such as Cliff Generator Script for Google Sheets (Thread, Link), Excel sheel based code generators (YouTube) or more generic preprocessor scripts in GNU Octave. (GitHub)

    These are painful workarounds for lack of expressiveness in the scripting language.

  • Website aggregating commonly used non-trivial behavior snippets. (Link)

    Workarounds for lack of mechanism for efficient code sharing.

  • Syntax highlighting support for various editors or even custom editors themselves. (List)

    Cost of creating custom scripting language.

It is truly remarkable that such an old game has captivated so many resolute people.

1.2 Closing The Gaps🔗ℹ

The aoe2-rms package remedies these pains, albeit at the cost of a transpilation step, by allowing one to use full power of Racket for the map definition, which it then transpiles into the original scripting language.

Because the DSL is embedded into Racket, it will allow map makers to expoit all the work that has been put into the host language so far, including support for packaging, as well as various editor integration, which may perhaps not be as good as ones of more mainstream languages, they are certainly big improvement.

The flexbility of the Lisp-like language has also allowed the aoe2-rms to be very synthetically close to its target language, hopefully making the transition easy, by making all existing resources still somewhat accurate and the existing knowledge people hold transferable.

1.3 Development Philosophy🔗ℹ

Tenets of the aoe2-rms.

  • Enable more experienced map makers to build more complex maps.

  • When possible and easy, keep the syntax similar enough to the target language.

  • Do not try to prevent arbitrary target language quirks from occuring. (Parser Pitfalls)

  • Enable code re-use.

  • Make RMS syntax extensions possible, for example see %unless