factorio-generators
factorio-generators copied to clipboard
Improve oil outpost generation
Sorry, the PR got a bit bigger ^^. This does a lot of things:
Pipe Generation
- Teach the pipe laying algorithm to prefer straight lines
- Automatically rotate the pumpjacks
- Connect the pumpjacks to form a MST with the trainstation instead of connection them all to the trainstation directly
- Move pipe generation code into separate file
Power Poles
- Make sure all beacons and pumpjacks are covered by power poles
- Try to minimize the number of power poles by heuristically solving the set problem of covering all consumers with power poles
- Make sure that all power poles in the blueprint form a connected graph
General
- Add some timing log outputs to make the performance more observable
If you merge this, you might want to mention in the tutorial, that the pumpjacks and single piece of track need be removed before the blueprint can be placed. Note that this is already the case if modules are added to the pumpjacks.
The more advanced pipe algorithm has runtimes of around 0.5sec on my machine for bigger outposts. That can probably be improved, but I didn't get to profiling yet.
Awesome work! Will test out soon and merge.