| Crates.io | resequence |
| lib.rs | resequence |
| version | 0.1.0 |
| created_at | 2026-01-17 00:33:13.06917+00 |
| updated_at | 2026-01-17 00:33:13.06917+00 |
| description | Time-travel simulation engine based on Achron's Resequence engine patterns |
| homepage | https://github.com/emberian/resequence-rs |
| repository | https://github.com/emberian/resequence-rs |
| max_upload_size | |
| id | 2049586 |
| size | 82,186 |
A time-travel simulation engine based on patterns reverse-engineered from Achron's Resequence engine (2011). This crate preserves the intellectual heritage of Achron's innovative time manipulation mechanics for future game development and research.
use resequence::{Engine, EntityState};
#[derive(Clone, Default, Debug)]
struct Unit {
hp: i32,
x: f32,
y: f32,
}
impl EntityState for Unit {}
fn main() {
let mut engine = Engine::<Unit>::new();
// Spawn a unit
let unit = engine.spawn(Unit { hp: 100, x: 0.0, y: 0.0 });
// Advance time
for _ in 0..10 {
engine.tick();
}
// Time travel! Create a duplicate at t=5
engine.chronoport(unit, 5).unwrap();
// Now there are two linked copies of the unit
let duplicates = engine.get_same_name_entities(unit);
assert_eq!(duplicates.len(), 2);
}
Entities transition through lifecycle states matching the original engine:
Unborn: Empty slot or not yet scheduledPrebirth: Scheduled to appear (e.g., destination of chronoport)Born: Normal active stateChronoporting: Mid-time-travelDead: DestroyedChronoport operations can be constrained to a time window:
// Allow chronoport up to 100 ticks in the past, 50 ticks in the future
engine.set_time_window(Some(100), Some(50));
Beyond games, these patterns are useful for:
Run the examples with:
cargo run --example basic
cargo run --example paradox
cargo run --example timewave_sync
cargo run --example time_window
MIT