TCM - TCBot Macro Format Library
A Rust library for parsing and serializing TCM (TCBot Macro) format files used by the tcbot.pro Geometry Dash bot.
Features
- ๐ฎ Full TCM Format Support - Parse and serialize both v1 and v2 TCM formats
- ๐ High Performance - Efficient binary format handling with minimal allocations
- ๐งช Thoroughly Tested - Extensive test suite ensuring reliability
Installation
Add this to your Cargo.toml:
[]
= "0.1"
Quick Start
Auto-Detection (Recommended)
The easiest way to work with TCM files is to use auto-detection, which automatically determines the format version:
use ;
use File;
use BufReader;
// Open and parse any TCM file automatically
let file = open?;
let mut reader = new;
let replay = from_reader?;
// Work with the replay directly without matching on enum variants!
println!;
println!;
// V2-specific features are available through trait methods
if let Some = replay.meta.rng_seed
Type-Specific Reading
If you know the format version in advance, you can use the typed API:
use ;
use File;
// Open a TCM file
let mut file = open?;
// Create a replay template (the type determines the format version)
let replay = deserialize?;
println!;
println!;
Creating a TCM file
use ;
use File;
// Create metadata
let meta = new;
// Create some inputs
let inputs = vec!;
// Create replay
let replay = new;
// Serialize to file
let mut file = create?;
replay.serialize?;
TCM Format Versions
This library supports both TCM format versions:
Version 1 (MetaV1)
- Basic input recording
- Fixed TPS (ticks per second)
- Restart inputs
- Simple binary format
Version 2 (MetaV2)
- All v1 features
- Optional RNG seed override
- TPS changes during replay
- More efficient encoding
- Bugpoint markers
Input Types
The library supports various input types:
- Vanilla Inputs: Standard Geometry Dash inputs (jump, left, right)
- Restart Inputs: Level restarts with optional seed override
- TPS Inputs: Change replay speed during playback
- Bugpoint Inputs: Mark specific points for debugging
Documentation
For detailed API documentation, visit docs.rs/tcm.
Examples
Check out the examples/ directory for more comprehensive usage examples:
auto_detection.rs- Auto-detect format version and parse any TCM filebasic_usage.rs- Basic reading and writing operationsinput_types.rs- Working with different input typesformat_conversion.rs- Converting between v1 and v2 formats
Contributing
Contributions regarding this rust port are welcome. Format design choices are not a part of this repository.
License
This project is licensed under the MIT License - see the LICENSE file for details.