Worldgen started as a world generator, but has evolved into a set of tools for Traveller. Built entirely in Rust using the Leptos reactive framework, it currently provides two primary tools for Traveller RPG players and referees.
Worldgen combines stellar mechanics, world generation, and trade economics into tools for the Traveller universe. The application generates realistic star systems following official Traveller rules while providing modern web-based interfaces for system development and the trade mini-game. The tools are hosted at [http://worldgen.callisot.com]
- Complete Star Systems: Generates primary stars with up to two companion stars
- Orbital Mechanics: Creates realistic orbital arrangements for worlds and gas giants
- World Generation: Full Universal World Profile (UWP) generation with trade classifications
- Satellite Systems: Recursive moon and satellite generation for complex systems
- Astronomical Data: Detailed physical characteristics and orbital information
- Market Generation: Dynamic trade goods based on world characteristics
- Route Planning: Calculate trade opportunities between worlds
- Ship Manifests: Passenger and freight management with profit/loss analysis
- Traveller Map Integration: Official universe data import and coordinate systems
- Real-time Updates: Reactive interface updates as parameters change
- Traveller Map API: Search and import canonical world data
- Export Capabilities: Share generated systems and trade data
- Responsive Design: Works across desktop and mobile devices
- Rust: Systems programming language for performance and safety
- Leptos: Reactive web framework with embedded HTML/CSS
- WebAssembly: Client-side execution for fast, responsive interfaces
- reactive_stores: Complex state management for nested data structures
- wasm_logger: Browser console logging with URL parameter control
You'll need the following tools installed:
- Rust and Cargo: Install from rustup.rs
- WebAssembly Target: Required for browser compilation
- Trunk: Build tool for Rust web applications
-
Install the WebAssembly compilation target:
rustup target add wasm32-unknown-unknown
-
Install Trunk build tool:
cargo install trunk
-
Clone and run the application:
git clone <repository-url> cd worldgen trunk serve --open
This will compile the application, start a development server, and open your browser to the running application.
By default the WASM frontend and the native backend both talk to
https://travellermap.com for sector/world lookups, search, and tile
rendering. If you're running your own TravellerMap-compatible service
(self-hosted instance, staging mirror, etc.), set TRAVELLERMAP_URL
at build time to override it:
# Local dev — the same export covers both binaries
export TRAVELLERMAP_URL=https://my.tmap.local
trunk serve # frontend
cargo run --features backend --bin server # backend (in another terminal)
# Verify what got baked into the binary
cargo run --example show_travellermap_url
# → travellermap_base_url() = "https://my.tmap.local"Important details:
- It's a build-time setting, not a runtime one. The URL gets
baked into both binaries via
option_env!so there's no per-request configuration to forget on either side. Change the value and rebuild. - Single source of truth. The same env var name is read by both the WASM bundle and the native server, so you can't have them point at different hosts by accident.
- Trailing slashes are stripped —
https://x.comandhttps://x.com/both work. - Unset = default. Omitting the variable falls back to
https://travellermap.com, so the public deploy needs no extra configuration.
For Docker / Cloud Run deployments, see the Docker
Deployment section — the build script forwards
the var as a --build-arg automatically.
- / - Main selector interface for choosing tools
- /world - Solar system generator interface
- /trade - Trade computer and route planning
- Selector: Main application entry point and tool selection
- System Generator: Complete star system creation interface
- Trade Computer: Market analysis and route planning tools
- World List: Tabular display of system objects and characteristics
- System View: Visual representation of generated star systems
- Traveller Map: Integration with official universe data
- Navigate to the system generator (/world)
- Enter a world name and UWP (e.g., "Regina A788899-A")
- View the generated star system with orbital details
- Export or share the system data
- Navigate to the trade computer (/trade)
- Select source and destination worlds
- Review available goods and passenger opportunities
- Build ship manifest and calculate profitability
Enable detailed logging through URL parameters:
# Debug system generation
http://localhost:8080/world?log=debug&module=worldgen::systems
# Trace trade calculations
http://localhost:8080/trade?log=trace&module=worldgen::trade
src/
├── components/ # UI components and interfaces
│ ├── selector.rs # Main application selector
│ ├── system_generator.rs # System generation interface
│ ├── trade_computer.rs # Trade calculation interface
│ ├── world_list.rs # Tabular system display
│ ├── system_view.rs # Visual system representation
│ └── traveller_map.rs # External API integration
├── systems/ # Core generation logic
│ ├── system.rs # Main system coordination
│ ├── world.rs # World generation and UWP handling
│ ├── gas_giant.rs # Gas giant characteristics
│ └── astro.rs # Astronomical calculations
├── trade/ # Trade and economic systems
│ ├── available_goods.rs # Market generation
│ └── ship_manifest.rs # Cargo and passenger management
├── logging.rs # URL-based logging configuration
└── lib.rs # Main library interface
trunk build --releaseTo bake in a custom TravellerMap host, set TRAVELLERMAP_URL before
the build (see Configuration).
docker build -t worldgen .
docker run -p 8080:80 worldgenTo deploy to the project's Cloud Run instance, use the helper script:
# Optional: override the TravellerMap host before pushing
export TRAVELLERMAP_URL=https://my.tmap.local
./scripts/push_image.shpush_image.sh forwards TRAVELLERMAP_URL to docker buildx as a
--build-arg so the value gets baked into both the WASM bundle and
the native server inside the image. It also prompts for GCS_BUCKET
(the planet-PNG cache for the /world endpoint) if it's not set.
Worldgen follows standard Rust development practices:
- Use
cargo fmtfor code formatting - Run
cargo clippyfor linting - Add tests for new functionality
- Update documentation for API changes
License is the MIT License, see LICENSE
- Traveller RPG: Classic science fiction role-playing game by Marc Miller. All rights owned by Mongoose Publishing.
- Traveller Map: Official universe mapping service and API
- Leptos Community: Reactive web framework development and support