Skip to main content

Crate amble_engine

Crate amble_engine 

Source
Expand description

§Amble game engine.

A full-featured text adventure game engine with scripting support.

This crate contains the core data structures and logic that power the Amble command-line adventure game. It provides:

  • World modeling: Rooms, items, NPCs with complex interactions
  • Command parsing: Natural language command interpretation
  • Trigger system: Event-driven game logic and scripting
  • Save/load: Complete game state serialization
  • Goal tracking: Quest and objective management
  • Rich text output: Styled terminal output with multiple view modes

The engine is designed to be data-driven, loading world content from a compiled WorldDef (world.ron) rather than requiring code changes.

Note: The engine still reads some TOML for configuration (themes, scoring, and help commands), but gameplay content should be authored in the [amble_script] DSL and compiled to world.ron.

Re-exports§

pub use goal::Goal;
pub use ids::EntityId;
pub use ids::Id;
pub use ids::ItemId;
pub use ids::NpcId;
pub use ids::RoomId;
pub use item::Item;
pub use item::ItemHolder;
pub use loader::WorldSource;
pub use loader::discover_world_sources;
pub use loader::load_world;
pub use loader::load_world_from_path;
pub use loader::set_active_world_path;
pub use npc::Npc;
pub use player::Player;
pub use repl::run_repl;
pub use room::Room;
pub use scheduler::Scheduler;
pub use view::View;
pub use view::ViewItem;
pub use world::AmbleWorld;
pub use world::Location;
pub use world::WorldObject;

Modules§

command
Player command parsing and representation.
data_paths
dev_command
Developer-mode command parsing.
entity_search
Entity Search Module
goal
Goal definitions and progress evaluation.
health
Health Module
helpers
Helpers Module
idgen
Deterministic ID helpers for world objects.
ids
Core ID types used across the engine.
item
Item types and related helpers.
loader
Loader utilities for building an AmbleWorld from serialized data.
markup
Lightweight inline markup for terminal output.
npc
Non-player character definitions and behavior helpers.
player
Player state representation and flag management.
repl
REPL and command handling utilities.
room
Room definitions and spatial utilities.
save_files
Save-game discovery and serialization helpers.
scheduler
Event Scheduler
slug
spinners
module: spinners
style
Styling helpers for terminal output.
theme
Theme system for customizable color schemes in the game.
trigger
Trigger orchestration and dispatch.
view
View module. This contains the view to the game world / messages. Rather than printing to the console from each handler, we’ll aggregate needed information and messages to be organized and displayed at the end of the turn.
world
Data structures representing the game world.

Constants§

AMBLE_VERSION
DEV_MODE