[MOD 0.16] Automatic Belt (and pipe) Planner v0.12.0
Posted: Thu Jun 02, 2016 12:09 pm
by prg
Automate yet another aspect of constructing your factory!
Finding a way for a new transport belt through the maze of your factory has never been easier. Simply place a pair of transport belt start and end markers on the ground. This automatic belt planner will create transport belt ghosts between them for your construction robots to fill in. The path finding process runs in the background while you're free to take care of other more interesting things.
Now also supports placing pipes.
basic usage
Place the belt planner to create a start marker. Adjust settings to taste. If you want to find a path for pipes, now is the time to select this in the settings.
Place the belt planner again to set the end position. Wait.
Review found path, select belt type and click create ghosts. For pipes, there are no types to select.
Optional continuous build mode: if "place new start marker on end position" is enabled, continue this process by selecting the next end position.
Settings GUI explanation
Path finder behavior can be modified by clicking the settings button shown in the GUI when a start marker is placed.
Always place underground sections if possible; place underground sections if necessary; avoid underground sections if possible.
If an underground section is placed, should it be as long or as short as possible?
Prefer straight lines, or just do whatever?
Don't place belts in front of existing belt endings to avoid spilling. Does not apply to pipes. Placing pipes next to existing pipes is always avoided.
Don't place path over resources.
Are underground entrance/exit on the start and end position acceptable? Yes, on both; not on start; not on end; on neither.
Reduce the steps/tick setting if path finding kills your UPS. Increase it if you want path finding to finish faster and think your system can handle it. This setting is also available while the path finder is running.
Debug mode
To see how the path finder is doing the path finding, you can enable a debug mode which lets you watch the open and closed sets grow, if that is your thing.
As this is not intended for end user consumption, there's no button in the GUI to enable this and you need to uncomment a couple of blocks labeled DEBUG_MARKER in the code manually. The markers won't be automatically removed anymore, so make sure to have a backup before attempting this.
Possibly invalid/non-optimal paths could be found if you remodel your factory too heavily while the path finder is running. Modified tiles won't be re-evaluated.
Newly placed underground sections might interfere with already existing underground sections. This didn't use to happen too often with belts, but pipes tend to be placed in "always underground" mode with the maximum underground length of pipes being twice that of belts, so this might become more noticeable. Coming up with a proper check for that seems really annoying, so I'll first see how much of a problem this turns out to be.
Maximum length for underground belts hardcoded to five tiles for now.
The beltplanner item can now be opened directly to show the settings GUI, no need to plop down the entity first anymore.
The settings GUI now behaves more like a normal entity GUI. It can be closed with the default controls and won't be shown together with other similar GUIs anymore.
Steps/tick input is now verified on the fly as you type.
The beltplanner item doesn't automatically get removed from the cursor stack anymore when opening the settings GUI since this wasn't working well in some cases. You can just hit the "clear cursor" button yourself if it's distracting to have an item around in the cursor stack while fiddling with the settings.
Entity is now indestructible.
Removed some frequently evaluated assertions for code that seems to have been working fine for a long while now.
Commented out debug marker code to avoid runtime checks. If you want to watch the path finder do its thing now you need to uncomment a couple of blocks labeled DEBUG_MARKER instead of setting place_debug_marker = true in control.lua.
Fixed that start markers would disappear when the tile they were on got modified.
Fixed belt ending avoidance to also take ghosts into account.
Updated entity and item graphics. I have no idea what this resulting thing is supposed to be, but it fits a bit better with the overall Factorio style instead of simply being a yellow square.
Added button to re-use last end position if a path finding attempt has been aborted or undone. Useful if you don't like the path finding result, just want to adjust some settings, then find a path between the same positions again.
The last path piece that gets removed in continuous build mode to place the start marker now gets replaced when the start marker is removed instead of continuing path finding.
Dialed down the self-intersection test a little to not ruin performance as much by only checking a constant number of the last few path elements instead of the whole path. It's possible to construct examples that result in invalid paths, but you really need to go out of your way to do this so it shouldn't be of practical importance.
Added option to avoid placing belts in front of existing belt endings to avoid spilling.
Added option to avoid placing belts over resources.
Fixed some issues with the GUI in case no path had been found.
Since there is an attachment limit of 10/post, older versions are kept around in a separate old version archive thread.
Re: [MOD 0.12.30] Automatic Belt Planner v0.6.0
Posted: Mon Jun 06, 2016 9:45 pm
by prg
New version. So, uhm, bump.
image dump
config-gui-070.jpg (54.44 KiB) Viewed 19065 times
Re: [MOD 0.12.30] Automatic Belt (and pipe) Planner v0.7.0
Posted: Wed Jun 08, 2016 2:19 am
by Ralord89
Pipes too? thank fuck for this, awesome work. Been testing with both belts and pipes with all functions, and I can say the only issue I've come across is underground belts/pipes crossing over, but you seem to know that already.
What I can suggest is mod support for Dytech and Bob's Mods pips and belts, and something to detect a Underground tunnel/pipe's maximum length as some mods increase the maximum distance they can go.
Re: [MOD 0.12.30] Automatic Belt (and pipe) Planner v0.7.0
Posted: Wed Jun 08, 2016 4:12 am
by DUMBHA
Ah yeah pipe support. Thanks for the awesome mod
Re: [MOD 0.12.30] Automatic Belt (and pipe) Planner v0.7.0
Posted: Wed Jun 08, 2016 7:15 am
by British_Petroleum
wow nice work. I think this could be one of those mods that eventually becomes part of the core game, like roadworks & personal roboport.
Re: [MOD 0.12.30] Automatic Belt (and pipe) Planner v0.7.0
Posted: Wed Jun 08, 2016 1:27 pm
by prg
Ralord89 wrote:Pipes too? thank fuck for this, awesome work. Been testing with both belts and pipes with all functions, and I can say the only issue I've come across is underground belts/pipes crossing over, but you seem to know that already.
What I can suggest is mod support for Dytech and Bob's Mods pips and belts, and something to detect a Underground tunnel/pipe's maximum length as some mods increase the maximum distance they can go.
That's already planned, support for accessing modded underground belt lengths will come in 0.13. The problem with interfering underground sections will probably be a lot worse with modded belts, so I might need to do something about it after all. I just can't think of a sane way of doing this without totally destroying performance when underground sections can be like 30 or 50 tiles long. Sigh.
British_Petroleum wrote:wow nice work. I think this could be one of those mods that eventually becomes part of the core game, like roadworks & personal roboport.
Yeah, that would be nice. Path finding would probably be orders of magnitude faster when implemented in C++.
Re: [MOD 0.13] Automatic Belt (and pipe) Planner v0.9.0
Posted: Tue Jul 05, 2016 5:31 pm
by prg
Just added an option to reverse the belt direction which can be selected after a path has been found before clicking the "create ghosts" button to make the belt run from end towards start. Useful if you're already standing near the intended end position of the belt and don't want to walk across your whole factory twice.
Will look into adding modded belt support soonish... I hope.
Re: [MOD 0.14] Automatic Belt (and pipe) Planner v0.10.0
Posted: Sun Aug 28, 2016 10:54 pm
by prg
Minor update to support Factorio 0.14.
Re: [MOD 0.14] Automatic Belt (and pipe) Planner v0.10.0
Posted: Wed May 03, 2017 10:40 am
by Jürgen Erhard
How's the 0.15 update coming along?
Re: [MOD 0.14] Automatic Belt (and pipe) Planner v0.10.0
Posted: Thu May 04, 2017 9:08 pm
by prg
I'm a bit short on time at the moment. Looks like a few minor things need to get done besides changing "factorio_version" to "0.15". Should manage to get a release out tomorrow I think.
Re: [MOD 0.14] Automatic Belt (and pipe) Planner v0.10.0
Posted: Fri May 05, 2017 4:22 pm
by Jürgen Erhard
Thanks in advance!
Also please note the strict icon_size change in 0.15.7.
Re: [MOD 0.14] Automatic Belt (and pipe) Planner v0.10.0
Posted: Fri May 05, 2017 10:08 pm
by prg
There. A bit rushed, but should be usable again. Current release doesn't know about the increased underground belt length of the recent update yet (that really had to be released today, just when I thought I was done with porting the mod?), making this configurable will take a little more work.
Re: [MOD 0.14] Automatic Belt (and pipe) Planner v0.10.0
Posted: Sat May 06, 2017 9:19 am
by AndrewIRL
Sounds like an excellent mod, wish I had been using it on 0.14 - looking forward to this:
prg wrote:Current release doesn't know about the increased underground belt length of the recent update yet
Re: [MOD 0.15] Automatic Belt (and pipe) Planner v0.11.0
Posted: Tue Jul 25, 2017 7:45 am
by wvlad
Why can't I place a ghost of the planner entity? You know, you can place ghosts from map to anywhere.
Re: [MOD 0.15] Automatic Belt (and pipe) Planner v0.11.0
Posted: Wed Jul 26, 2017 7:49 pm
by prg
wvlad wrote:Why can't I place a ghost of the planner entity? You know, you can place ghosts from map to anywhere.
That was the straight forward way to implement things (per-player path finder settings, matching up start and end marker) but I might have a look at how to make that work in the future.
...after I implement the other things I have on the TODO list that I haven't been getting around to since forever.
Re: [MOD 0.15] Automatic Belt (and pipe) Planner v0.11.0
Posted: Sun Oct 01, 2017 3:24 pm
by pulsar9
If you are still making changes, I would like to see an option to put the planner back into the player's hand when the 'create ghosts' button is pressed. Would make building multiple rows of belts so much better.
Re: [MOD 0.15] Automatic Belt (and pipe) Planner v0.11.0
Posted: Wed Oct 04, 2017 8:19 pm
by prg
pulsar9 wrote:If you are still making changes, I would like to see an option to put the planner back into the player's hand when the 'create ghosts' button is pressed. Would make building multiple rows of belts so much better.
So an addition to the continuous build mode that lets you select a new start position everytime instead of reusing the old one?
Continuous build mode: off, separate paths, single path.
Makes sense, I'll look into it the next time I mess with the mod.
Re: [MOD 0.15] Automatic Belt (and pipe) Planner v0.11.0
Posted: Tue Oct 17, 2017 12:08 pm
by konfu
First of all, nice work! I had a very similar mod idea and found this when looking for existing solutions.
Some remarks:
* Ideally, this would behave just like the rail planner, e.g. yellow arrows apearing as you hover your cursor on a belt, then shift click to enter ghost building mode with the path automatically updating as you move your cursor... Oh what a wonderful dream...
* The option to prefer the longest underground belts doesn't seem to account for the increased underground distance of red and blue belts.
* It would be nice, if one could alter the settings after the start end endpoint are set. That way you wouldn't have to set the same points multiple times when tweaking the settings.
* Can you add the ability to plan multiple belt lines? I find it tedious to build dozens of belt lines into and out of balancers even when using Picker Extended's Belt Brush utility. It would be perfect if this mod could solve this.
Re: [MOD 0.15] Automatic Belt (and pipe) Planner v0.11.0
Posted: Tue Oct 24, 2017 8:49 pm
by prg
konfu wrote:First of all, nice work! I had a very similar mod idea and found this when looking for existing solutions.
Thanks! Hope it's useful for you.
konfu wrote:Some remarks:
* Ideally, this would behave just like the rail planner, e.g. yellow arrows apearing as you hover your cursor on a belt, then shift click to enter ghost building mode with the path automatically updating as you move your cursor... Oh what a wonderful dream...
Yeah, that would be great. But the cursor position isn't part of the shared game state so it can't be accessed by mods. Also this Lua implementation would likely be a bit too slow for non-trivial paths.
konfu wrote:* The option to prefer the longest underground belts doesn't seem to account for the increased underground distance of red and blue belts.
Known. I've been wanting to add support for different kinds of belts including modded ones since forever but creating a proper GUI and such for this requires effort and I've been pretty busy for the last year or so with getting my life sorted.
konfu wrote:* It would be nice, if one could alter the settings after the start end endpoint are set. That way you wouldn't have to set the same points multiple times when tweaking the settings.
If the path that has been found isn't to your liking, click Undo > Settings > change stuff around > Re-use end at $position.
konfu wrote:* Can you add the ability to plan multiple belt lines? I find it tedious to build dozens of belt lines into and out of balancers even when using Picker Extended's Belt Brush utility. It would be perfect if this mod could solve this.
Hm, might look into adding the ability to place multiple start and end markers at the same time. Not sure how well that would work though.
Things should start to settle down a bit for me in the near future, so I hope I'll be able to get back to working on this soonish.
Re: [MOD 0.15] Automatic Belt (and pipe) Planner v0.11.0
Posted: Thu Jan 11, 2018 10:30 pm
by maschine
Please update the Mod for 0.16, i cant't live without it