Expand description
The base mod for Rustorio. Contains all the main content of the game. Your saves should depend on this crate.
For more information, including help on getting started, see the repo
Modules§
- buildings
- Buildings take inputs to produce outputs over time.
- gamemodes
- A game mode defines the starting resources and victory conditions for a game.
- guide
- A guide that provides hints to the player during the tutorial.
- recipes
- A recipe is a way of turning resources into other resources.
Some recipes can be performed by hand, but most can be automated using buildings like the
Assembleror theFurnace. To figure out where the recipe can be performed, look at the trait impls. For example, theCopperWireRecipeimplements theAssemblerRecipeandHandRecipetraits, meaning it can be performed by hand and in anAssembler. - research
- Technologies can be unlocked by consuming science packs. They usually unlock new recipes or further technologies.
- resources
- Resources are the fundamental units of value in Rustorio.
Resources are held in either
ResourceorBundleobjects.Bundleobjects are used to hold a fixed amount of a resource, whileResourceobjects can hold any amount. - territory
- Territories are where you can get ore.
To begin with you can mine by hand using the
hand_minefunction, but later you can addMiners to the territory to automate mining.
Structs§
- Bundle
- Contains a fixed (compile-time known) amount of a resource.
A
Bundlecan be used to build structures or as input for recipes. - Insufficient
Resource Error - Error returned when there are insufficient resources in a
Resourceto fulfill a request. - Research
Point - A resource type representing one research point for a specific
Technology. Use them in theresearchmethod of the correspondingTechnologyto unlock the technology. - Resource
- Holds an arbitrary amount of a resource.
A
Resourceobject can be split into smaller parts, combined orBundles can be extracted from them. - Tick
- The tick is used to keep track of time in the game.
You can advance the game using the
advancemethod or similar. Many functions and building methods require aTickto be passed in, which allows them to update their state. If a function takes a&mut Tick, then the function will take time. If a function merely takes a&Tick, it will never advance the game time, but instead just roll forward it’s internal state to match the current tick.
Traits§
- Game
Mode - A game mode defines the starting resources and victory conditions for a game.
- Hand
Recipe - A recipe that can be hand-crafted by the player.
- Recipe
- Basic recipe trait. A building’s specific recipe trait can then be defined like
- Resource
Type - A type that represents a specific kind of resource in the game. Implementors of this trait represent different resource types, such as iron, copper, or science packs. Only useful as a type parameter; has no associated methods.
- Technology
- A technology can be unlocked out by calling the
researchmethod with the required science packs. This will consume the science packs and the technology itself, and return whatever the technology unlocks, mostly recipes and other technologies.
Functions§
- play
- Runs your play. If it is run multiple times, it will panic. This is to prevent using multiple threads to cheat.