Skip to content

Improve oil outpost generation#47

Open
Chronial wants to merge 1 commit intodemipixel:masterfrom
Chronial:oil_pr
Open

Improve oil outpost generation#47
Chronial wants to merge 1 commit intodemipixel:masterfrom
Chronial:oil_pr

Conversation

@Chronial
Copy link
Contributor

@Chronial Chronial commented Dec 5, 2018

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.

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
@demipixel
Copy link
Owner

Awesome work! Will test out soon and merge.


let neighbors = [];
if (meta == 'start') {
for (let dir of [0, 1, 2, 3]) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it may be worth adding an option to allow the user to use the original rotation of the pumpjack (I believe just pumpjack.direction/2 since some people may rather spend a bit more iron placing pipes over having to dig up every single pumpjack. Otherwise looks awesome :) Sorry for getting to this so late!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this tool only really useful if you have construction robots and then you can just use a deconstruction planner?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants