factorio-generators icon indicating copy to clipboard operation
factorio-generators copied to clipboard

Improve oil outpost generation

Open Chronial opened this issue 7 years ago • 1 comments

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.

Chronial avatar Dec 05 '18 16:12 Chronial

Awesome work! Will test out soon and merge.

demipixel avatar Dec 05 '18 21:12 demipixel