goto-bus-stop / recanalyst

Analyzes Age of Empires 2 recorded game files.
https://goto-bus-stop.github.io/recanalyst/doc/v4.2.0
GNU General Public License v3.0
75 stars 11 forks source link
age-of-empires mgx mgz php rts savegame

RecAnalyst

Packagist License Build Status Gitter chat

RecAnalyst is a PHP package for analyzing Age of Empires II recorded games.

It supports recorded game files from:

And reads data such as:

License - Credits - Contributing - Requirements - Installation - Configuration - Usage Examples - API Documentation - Limitations

$rec = new \RecAnalyst\RecordedGame('recorded_game.mgx2');
$rec->mapImage()->save('minimap.png');
foreach ($rec->players() as $player) {
    printf("%s (%s)", $player->name, $player->civName());
}

License

GPL-3. See COPYING.

Credits

Originally forked from Biegleux's work:
v2.1.0 © 2007-2010 biegleux <biegleux@gmail.com>
Original project homepage
Original project documentation

See also references.md.

Contributing

RecAnalyst is looking for contributors. Please see the Issues List for bugs or missing features and help implement them by opening a PR!

RecAnalyst is an OPEN Open Source Project:

Individuals making significant and valuable contributions are given commit-access to the project to contribute as they see fit. This project is more like an open wiki than a standard guarded open source project.

See the Contributing Guide for more.

Requirements

RecAnalyst works with PHP 5.6+ and PHP 7. The Imagick or GD extensions need to be installed to generate map images.

Installation

With Composer:

composer require recanalyst/recanalyst

Configuration

RecAnalyst ships with translations and image files for researches and civilizations.

If you're using RecAnalyst with Laravel, scroll down to learn about Laravel integration.

RecAnalyst contains a basic Translator class for standalone use. By default, RecAnalyst uses the English language files from Age of Empires II: HD Edition.

RecAnalyst contains icons for civilizations, units and researches in the resources/images folder. If you're using RecAnalyst standalone, and want to use the icons, you can copy that folder into your own project. You can then refer to the different categories of icons in the following ways:

Category URL
Civilizations '/path/to/resources/images/civs/'.$colorId.'/'.$civId.'.png'
Researches '/path/to/resources/images/researches/'.$researchId.'.png'

Laravel

Add the RecAnalyst service provider to your config/app.php:

'providers' => [
    RecAnalyst\Laravel\ServiceProvider::class,
],

RecAnalyst will automatically pick up the appropriate translations for your Laravel app configuration.

To copy the civilization and research icons to your public folder:

php artisan vendor:publish --tag=public

You can then refer to the different categories of icons in the following ways:

Category URL
Civilizations public_path('vendor/recanalyst/civs/'.$colorId.'/'.$civId.'.png')
Researches public_path('vendor/recanalyst/researches/'.$researchId.'.png')

API Documentation

To get started, the Usage Examples might be helpful.

Full API documentation is available at https://goto-bus-stop.github.io/recanalyst/doc/v4.2.0.

Limitations

These are some things to take into account when writing your own applications with RecAnalyst: