A C++ parser for reading, analyzing, and manipulating Rise of Nations scenario files (.scx). Its intended for extracting and working with scenario data including map information, player settings, units, buildings, triggers, and more. Still a work in progress!
- Parse Rise of Nations scenario (.scx) files
- Decompress and decrypt scenario data
- Extract detailed information about:
- Map terrain and tiles
- Player configurations
- Units and buildings
- Diplomatic relations
- Triggers and conditions
- Resources and goods
- Visibility settings
- Support for most major chunk types used in RoN scenarios (work in progress)
Before building the project, ensure you have the following installed:
- CMake 3.20 or higher
- C++17 compatible compiler
- MSVC (Visual Studio 2017 or later) on Windows
- GCC 7+ or Clang 5+ on Linux/macOS
- zlib library for compression support
conda install -c conda-forge cmake zlibvcpkg install zlib:x64-windowssudo apt-get install cmake build-essential zlib1g-devbrew install cmake zlibClone the repository:
git clone <repository-url>
cd RoN-Scenario-File-ParserConfigure CMake and generate the build files:
Windows (PowerShell):
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_CLI=ONLinux/macOS:
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_CLI=ON-DBUILD_CLI=ON- Build the command-line interface (default: ON)-DBUILD_TESTS=OFF- Build unit tests (default: OFF)-DCMAKE_BUILD_TYPE=Release- Build type (Debug, Release, RelWithDebInfo, MinSizeRel)
Once configured, compile the project:
cmake --build buildFor faster builds on multi-core systems:
Windows:
cmake --build build --parallelLinux/macOS:
cmake --build build -j$(nproc)To perform a clean build:
Windows:
Remove-Item -Recurse -Force build
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_CLI=ON
cmake --build buildLinux/macOS:
rm -rf build
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_CLI=ON
cmake --build buildAfter building, run the executable:
Windows:
.\build\scenario_parser.exeLinux/macOS:
./build/scenario_parserThe parser currently reads a input scenario file specified as a command-line argument and a optional output file: scenario_parser <input_file> [output_file]
The parser will display detailed information about the scenario including:
- Scenario metadata
- Map dimensions and terrain data
- Player information
- Unit and building placements
- Trigger configurations
- Resource settings
RoN-Scenario-File-Parser/
├── include/ # Header files
│ ├── base/ # Base classes and interfaces
│ ├── chunks/ # Chunk type definitions
│ └── common/ # Common utilities
├── chunk_parsers.cpp # Chunk parsing implementations
├── chunk_types.cpp # Chunk type definitions
├── compression.cpp # Data compression/decompression
├── encryption.cpp # Data encryption/decryption
├── scenario_parser.cpp # Main scenario parser logic
├── main.cpp # Entry point
├── CMakeLists.txt # CMake build configuration
└── README.md # This file
If CMake cannot find zlib:
- Using Conda: Make sure you're in an activated Conda environment with zlib installed
- Manual specification: Set the zlib path manually:
cmake -S . -B build -DZLIB_ROOT=/path/to/zlib
- Ensure you have a C++17 compatible compiler
- Try cleaning the build directory and reconfiguring
- Check that all dependencies are properly installed
Contributions are welcome! Please feel free to submit issues or pull requests.
Licensed under the MIT License
- Rise of Nations by Big Huge Games