Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: actions-rs/toolchain@v1
with:
profile: minimal
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: actions-rs/toolchain@v1
with:
profile: minimal
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rustfmt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: actions-rs/toolchain@v1
with:
profile: minimal
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
name: Test Suite
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: actions-rs/toolchain@v1
with:
profile: minimal
Expand Down
30 changes: 6 additions & 24 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# cargo-features = ["codegen-backend"]
[package]
name = "factory"
version = "0.2.0"
version = "0.2.1"
edition = "2024"
rust-version = "1.85"
build = "build.rs"
Expand All @@ -17,7 +17,7 @@ simple_logger = {version = "5.0.0", optional = true }
rayon = "1.10.0"
serde = { version = "1.0.217", features = ["derive"], default-features = false }
directories = "6.0.0"
ron = "0.8.1"
ron = "0.10.1"
take_mut = "0.2.2"
static_assertions = "1.1.0"
itertools = "0.14.0"
Expand Down
50 changes: 12 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,18 @@
# What is this?
This project is an academic recreation of the factory game [Factorio](https://www.factorio.com/) taking additional ideas from [Dyson Sphere Program](https://store.steampowered.com/app/1366540/Dyson_Sphere_Program/).
This project is an academic recreation of the factory game [Factorio](https://www.factorio.com/).

I created it as an exercise to see how far I could optimize the basic concepts and algorithms of the genre in terms of performance, while allowing myself minor changes to the games' rules.
I created it as an exercise to see how far I could optimize the basic mechanics and algorithms of the genre in terms of performance.
Another goal that emerged along the way, was learning about the way modern CPUs actually work.

# Roadmap
Currently I adding beacons and thinking about how to efficiently add logistics bots. Then I want to build a comprehensive suit of benchmark test to show if/by how much I was able to improve performance.

# Why did you start?
I was playing the above games and started being unable to expand due to performance issues. So in my hubris I declared: "How hard can it be?".
I was playing Factorio and started being unable to expand due to performance issues. So in my hubris I declared: "How hard can it be?".

# Current State
Most logic for power grids, belts, splitters, assemblers, labs, inserters, mining drills, solar panels and accumulators is working. This allowed me to recreate a Factorio base, giving me a point for performance comparison.
I was able to run a base comprised of 40 copies of [this](https://factoriobox.1au.us/map/view/2824bc1566bd95b5825baf3bd2eb8fa32de8397526464f5a0327bcb82d64ebf8/#1/nauvis/15/2942/1158/0/447) Factorio Megabase by Smurphy (which Factorio runs at ~40 UPS) at 60 UPS on my machine.

# Running it
It should run on Linux, Windows and MacOS. Assuming you have [rust and cargo](https://rust-lang.org), just `cargo run --release`. On NixOS the included `shell.nix` contains all you need.

## TODOS
- ~~Place Power Production~~
- ~~Blueprints so I can actually do perf tests~~
- ~~Permanently running replay system, so I can easily recreate crashes~~
- ~~Test harness for replays, to ensure they do not crash~~
- ~~Automatic insertion limit~~
- ~~Assembler Module Support~~
- ~~World listener support (i.e. update whenever something changes in the world, for power, beacons and inserters)~~
- Lazy Terrain Generation
- ~~Assembler Module Frontend~~
- ~~Assembler Power Consumption Modifier Support~~
- ~~Beacons~~
- ~~FIX Beacon Flicker due to lowering power consumption when beacons are unpowered~~
- ~~Storage Storage Inserters~~
- ~~Science Consumption in Labs~~
- ~~Inserter connections to labs~~
- ~~Debug inserters~~
- ~~Production Graphs~~
- ~~Liquids~~
- ~~Map View~~
- ~~Technology~~
- Mining Drills
- ~~Underground belts~~
- Fix Underground Pipe connection breaking/overlap
- Place Steam Turbines
- ~~Splitters~~
- Allow Belts of different types to connect to one another
- Decide if I want beacons to match factorio behaviour or keep the hard switch on/off
- ~~Ore Generation~~
- Add tile requirements for buildings/recipes (for offshore pump)
- Bots
- MAYBE: A canonical version of the simulation that can be used for diff testing (and as some weird documentation of the mechanics I suppose)
# Attributions
All graphics used with the `graphics` feature are from the Factorio Mod [Krastorio 2 Assets](https://codeberg.org/raiguard/Krastorio2Assets).
Loading
Loading