Angolmois Rust Edition

Angolmois Rust Edition is a direct, one-to-one translation of the original Angolmois music video game to the Rust programming language. The project serves as a comprehensive example of translating moderately-sized C code to Rust, while also exploring the additional library support required for such translations.

Overview

Angolmois is a minimalistic music video game similar to BM98, supporting the BMS format for gameplay. The game combines string parsing, path manipulation, two-dimensional graphics, and complex gameplay within a compact codebase. The Rust translation retains these features while offering improved readability and maintainability through extensive commenting and refactoring.

Key Features

  • Direct Translation: The Rust edition is a faithful recreation of the original Angolmois 2.0.0 alpha 2 version, with some improvements and differences noted below.
  • Comprehensive Example: This project is a valuable resource for developers interested in translating C code to Rust, demonstrating practical application of Rust in game development.
  • Extensive Comments: Unlike the original C code, the Rust version includes detailed comments, aiding in understanding both the game mechanics and the translation process.

Differences from the Original

While the Rust edition aims to be identical to the original Angolmois, there are several key differences:

  • UTF-8 Handling: The Rust version handles files with invalid UTF-8 sequences differently.
  • Performance Enhancements: Directory entries are cached to mitigate performance penalties associated with different directory listing semantics.
  • Measure Handling: The Rust version can handle more than 2,000 measures in the display, a limitation in the original C version.
  • Path Separator: The Rust edition does not support non-native path separators in #PATH_WAV.
  • Movie Rewinding: The C version's "rewind" feature by repeatedly setting the same alphanumeric key to the BGA layer is not supported in the Rust edition.

Screenshots

Angolmois Screenshot 1Angolmois Screenshot 2

Game data credits: "sunken azure world", music by maki, courtesy of Daida Three Brothers. All rights reserved.

Licensing

Angolmois Rust Edition is distributed under the GNU GPL version 2+, consistent with the original project. Portions of the code intended as patches to Rust are licensed under the Apache License 2.0 and MIT License.

Compilation

To compile Angolmois Rust Edition, clone the repository and run the following commands (Windows users need MinGW shell):

cargo build --release
target/release/angolmois --help

You will need the latest Rust master and Cargo installed. Nightly versions of both are recommended for best compatibility.

Project Structure

The project maintains the single-file structure of the original C version to keep the translation straightforward and the structure obvious. For those preferring a more modular approach, consider the Sonorous fork, which has evolved into a full-featured game with a more extensive codebase.

Further Information

For more details, especially on usage, refer to the README file of the original Angolmois. Learn more about the BMS format and the structure of Angolmois through the provided documentation.

Explore Angolmois Rust Edition to see a practical application of Rust in game development and a detailed example of C to Rust code translation.

Similar Projects

Rustfinity.com

Links

  1. Home
  2. Learn Rust
  3. Get Started
  4. Practice Rust
  5. Challenges
  6. Tutorials
  7. Blog
  8. Open source
  9. Learn Gleam

Socials

  1. GitHub
  2. X

Legal

  1. Privacy Policy
  2. Terms of Service