npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

genie-dat-utils

v0.5.0

Published

read and write age of empires .dat files

Downloads

12

Readme

genie-dat

read and write age of empires .dat files in nodejs. send issues if there are any requests this package aims to be the most portable .dat file opener for AoE games. currently fully supports AoE DE2 since 2023 Marc.

Install - Usage - Supported Formats - Limitations - API - License: LGPL-3

npm travis standard

Install

npm install genie-dat-utils

Usage

var genieDat = require('genie-dat-utils')
var buffer = require('fs').readFileSync('/path/to/empires2_x1_p1.dat')
genieDat.load(buffer, (err, dat) => {
  console.log(dat.civilizations.map(civ => civ.name))
})

Supported Formats

The data file format differs slightly between game versions. Versions supported by this library are:

  • aoc - All AoC-style formats, such as empires2_x1.dat of AoC 1.0 and empires2_x1_p1.dat of AoC 1.0c (the most common version). UserPatch and UserPatch based mods like WololoKingdoms and Portuguese Civ Mod also use this format. HD Edition versions before 5.0 also use this format.
  • african-kingdoms - The release of African Kingdoms changed the file format slightly; HD Edition versions 5.0 and up use this format. Note that this is used regardless of whether the African Kingdoms DLC is actually installed.

Limitations

Age of Kings, SWGB, and the AoE1 and AoE:DE files are not yet supported. The goal is to expand support for these formats in the future.

Still write/save functionality is not done, but can be easily implemented using the existing codes.

API

genieDat.load(buffer, opts={}, cb)

Decompress and load buffer, eg. a raw .dat file.

opts can be an object with properties:

cb is a Node-style callback receiving (err, dat). dat is a plain object representing the dat file contents. console.log() it to find out what's in it. There is a lot of junk, some of the more useful properties are:

  • playerColors - Player colours, mostly offsets into the main palette file
  • techs - Technology effects
  • terrains - Lists terrains
  • civilizations - Lists available civilizations
    • civilizations[i].objects - Lists unit statistics for each civ
  • researches - Lists available researches—this refers to the technology effects a lot

genieDat.loadRaw(buffer, opts={}, cb)

Load an already decompressed buffer. Use this if you manually did zlib.inflateRaw or got an uncompressed buffer through some other means. Otherwise it is identical to genieDat.load.

This project is forked from

The original genie-dat was forked by mrommel, who made a lot of improvements, I could also fork that repo, but it would be confusing. Also for visibility purposes and to finally group efforts in portability of genie dat files, I propose this new github repository.

Support

If newer version comes out from AoEDE2 we just copy the protocol from the official: genieutils

License

This project is based heavily on genieutils by apreiml and Tapsa, and on the openage conversion script.

LGPL-3