eu4rs is an experimental open-source game engine reimplementation ("source port") for Europa Universalis IV.
- Performance: High-performance rendering using
wgpu(Vulkan/Metal/DX12). - Compatibility: Load and play using original game assets (data-driven design).
- Portability: Native support for Windows and Linux.
- Safety: Built in Rust for memory safety and concurrency.
This project is organized as a Cargo Workspace containing:
eu4viz: The main visualizer application for viewing and interacting with EU4 maps.eu4data: A library containing strong types and logic for EU4 game objects.eu4txt: A library (crate) providing a custom parser/tokenizer for the EU4 text format (Windows-1252 encoded). See docs/file_formats.md.
Ensure you have Rust installed.
git clone <repository-url>
cd eu4rs
cargo build --releasecargo run
- Zoom: Scroll Wheel (Up/Down)
- Pan: Middle Mouse Button (Hold & Drag)
- Inspect: Left Click on a province to view details
- Toggle Map Mode: Press
Tabto cycle through map modes (Province, Political, Trade Goods, Religion, Culture).
cargo run -- snapshot --output province_map.png --mode province
cargo run -- snapshot --output political_map.png --mode political
cargo run -- snapshot --output tradegoods_map.png --mode trade-goods
cargo run -- snapshot --output religion_map.png --mode religion
cargo run -- snapshot --output culture_map.png --mode culturecargo run -p eu4viz -- --pretty-print --eu4-path "path/to/specific/file.txt"- Custom Parser: Handles EU4's specific text format, including comments (
#), whitespace-separated tokens, andkey=valuestructures. - Encoding Support: Automatically handles
WINDOWS_1252encoding common in Paradox files. - Tolerant Parsing: Designed to handle quirks in game files (mostly).
- CI/CD: Automated GitHub Actions pipeline for building, testing, and linting (
fmt,clippy). - Statistics: The
Filescannerprovides quick statistics on your installation. - Interactive Map: A hardware-accelerated (Vulkan/wgpu) map viewer that renders the game's
provinces.bmpwith correct aspect ratio and windowing. - Political Map Mode: Visualizes country ownership with borders and filling based on game data.
- Headless Rendering: Ability to render the map to an image file without opening a window (
--snapshot), suitable for automated testing in CI. - Data Expansion: Parses and visualizes complex game data including Religion, Culture, and Trade Goods.
- Serde Support:
eu4txtimplementsserde::Deserializer, allowing direct mapping of game files to Rust structs (ineu4data).
- System Architecture: Overview of crate structure, rendering pipeline, and data flow.
- File Formats: Details on the EU4 text format, encoding, and syntax.
- Data Coverage: How we track Parse/Visualize/Simulate progress across game data.
- Supported Fields: Auto-generated matrix of every known EU4 data field.
Apache-2.0