Skip to content

Age of Empires 2 random map script parser and evaluator for Node.js and the browser

License

Notifications You must be signed in to change notification settings

genie-js/genie-rms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

genie-rms

Age of Empires 2 Random Map Script parser for Node and the browser.

This library aims to be as compatible with AoE2 as possible. This means that its implementation imitates all the quirks of the AoE2 parser, too. It does not use an AST and does not have separate lexing and parsing steps. If you need a parser for a subset of all valid RMS code, but that returns an AST that you can manipulate, try the mangudai library.

Status - Install - Usage - Credits - License: GPL-3.0

Status

Parsing is roughly complete.

Terrain generation more or less works, as does object generation. Both are probably inaccurate compared to AoC, though. Object generation does not support civilization bonuses.

Land positioning and generation is buggy. While lands are placed, sometimes they are placed outside the map, crashing the generator. Lands of enemy players may be placed directly next to each other instead of on near-opposite sides of the map. Team-based placement is not yet implemented.

Cliff generation more or less half-works. Cliff generation does two things: change the terrain and place cliff objects. The terrain update part is implemented, but cliff objects are not. It does not correctly avoid player lands, so cliffs may be placed near or underneath town centers and the like.

Elevation generation has some implementation but whether it works is unclear.

Connections between player lands are not implemented.

UserPatch and HD Edition commands are not implemented. The goal is to first finish 1.0c semi-compatibility. Ideally, compatibility modes for UP and HD could be introduced later. As such, Zip-RMS from UserPatch 1.5 are also not implemented, although there is a utility class for reading files from them without requiring a full zip library in src/ZipRMS.js.

Install

npm install genie-rms

Usage

const { Parser, CRandom } = require('genie-rms')
const fs = require('fs')
const source = fs.readFileSync('./my-script.rms', 'utf-8')

const seed = 32767
const parser = new Parser({
  // Omit for a random seed
  random: new CRandom(seed)
})

parser.write(source)

const result = parser.end()
console.log(result)

Credits

Most of this is made possible by the reverse engineering work by Yvan-Burrie, JustTesting123 and others in genie-reverse.

License

GPL-3.0

About

Age of Empires 2 random map script parser and evaluator for Node.js and the browser

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published