Better fast belt bending using waypoints

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

Tooster
Long Handed Inserter
Long Handed Inserter
Posts: 89
Joined: Wed Mar 24, 2021 6:42 pm
Contact:

Better fast belt bending using waypoints

Post by Tooster »

I created a demo of this new "waypoint mode". All the info can be found there: https://t3st3ro.github.io/stuff/factorio-waypoints.html
Quick controls descriptions for the demo: use CTRL+LMB first time to enter "waypoint placing mode", next use LMB to place a single strip of belts (yellow squares) between last checkpoint. Press R to rotate the "guide" i.e change the direction of the strip. Usual factorio shortcuts apply like RMB, LMB, Q, R, CTRL+Z (I also added redo with CTRL+SHIFT+Z). Remember to release the CTRL if you want to built the belts, otherwise only new waypoint will be added without belts being placed.
TL;DR
Current fast belt bending gets frustrating when drawing long lines with bends. Here is a proposition to add "waypoints" snapped to X or Y of the previous waypoint to help in creating long lines and bends of belts.
Current problems
There are 2:
  • fast belt bending is subject to mistakes when doing turns (overshooting, undershooting before turn)
  • each operation is a separate undo entry making it harder to fix mistakes
Allow me to demonstrate it to you using a video:

Suggestion
Instead of the current dragging and immediate placing of belts in the "fast belt drawing mode" I propose to add waypoints for belt: [CTRL]+[LMB] to place a waypoint. Adding first waypoint starts a "waypoint mode". Each consecutive waypoint would be snapped to a guide centered at the previous point (to draw straight segment from previous waypoint). When a waypoint is placed using [LMB], draw belts from the last waypoint in one action (undo would revert a whole segment). When it's added with [CTRL]+[LBM], place only a waypoint instead.
  1. [Ctrl]+[LMB] to add first waypoint. No belt is drawn. Add first waypoint and enter waypoint mode. Now there is a snap guide that aligns cursor with the waypoint. The waypoint is added to undo stack
  2. Place [Ctrl]+[LMB] to add another waypoint or [LMB] to add another waypoint and placing belts. The waypoint position is snapped to the guide. This action is added to undo stack as well
  3. Repeat above step or exit with [Q]. Exiting is also an undo action, so when you press [CTRL]+[Z] the last waypoint path is stored and you enter waypoint mode again.
Additionally:
  • Detect a "snap guide"* with initial mouse movement from waypoint, for example when I place a waypoint and move mouse up, the belts are placed facing up. I added it in the demo as a "smart" mode. Bringing mouse close to the waypoint again lets you change the detected guide. The detected guide can be also changed using [R].
  • Place ghosts with [Shift].
  • [CTRL]+[ALT]+[LMB] would place/ghost all unbuilt belts on the waypoint path.
The waypoint mode can be added separately without removing the current fast bend mode if you want, they are not exclusive. I just think the waypoint mode is better, especially for planning

*Guides (snap axis) can be determined in several ways. I've playtested them, and found the "smart" mode to be the most robust:
  • VANILLA: by using belts initial direction as primary axis and using [F]/flip/[R] to swap axes
  • CLOSEST: by snapping to closest axis (by min. distance to projection onto axis)
  • SMART (IMHOthe best one): by initial movement (like in SketchUp), so for example initial upward mouse movement would select the vertical axis. Bring mouse to waypoint and move mouse again the the desired direction to change the guide. This pairs well with swapping axes with [R]..
Here is a video demonstrating how the new waypoint system would work (recorded from my demo https://t3st3ro.github.io/stuff/factorio-waypoints.html)

First, I show how current fast belt bending works. Next I demonstrate the waypoint system. Finally I show how "smart" belt direction works.


Below is an original concept before playtesting:
https://i.imgur.com/PXv49jL.png
Last edited by Tooster on Fri May 24, 2024 11:25 am, edited 1 time in total.
Look mom, I made a mod ^^ Barrel Stages
Tooster
Long Handed Inserter
Long Handed Inserter
Posts: 89
Joined: Wed Mar 24, 2021 6:42 pm
Contact:

Re: Better fast belt bending using waypoints

Post by Tooster »

The same mechanic could be used to draw pipes.

Btw if someone want's to use the code, it is MIT licensed so go ahead.
Look mom, I made a mod ^^ Barrel Stages
DaleStan
Filter Inserter
Filter Inserter
Posts: 371
Joined: Mon Jul 09, 2018 2:40 am
Contact:

Re: Better fast belt bending using waypoints

Post by DaleStan »

The comment that it could be used for pipes reminds me of P.U.M.P. I wonder if it would be possible to make a BELTS mod too.

(Obviously, the most important part of such a mod is properly backronyming BELTS :) )
BicycleEater
Fast Inserter
Fast Inserter
Posts: 153
Joined: Sun Jul 26, 2020 4:05 pm
Contact:

Re: Better fast belt bending using waypoints

Post by BicycleEater »

This does look good, and is a clear improvement, although I'd love to see the kind of orthogonal tracing stuff you see on PCB layout software, where setting a corner sets the position of the previous corner, and locks that axis, then waiting for you to place the next corner before deciding this one. That is if you were going vertically at the begining:
x is cursor position and the mouse is being moved to produce cursor position:

Code: Select all

|
|
|
|
+-----x

Code: Select all

|
|
|
|
|
|
+----------x

Code: Select all

|
|
+--x
Then you click (or rotate maybe?), and:

Code: Select all

|
|
+---+
    |
    x

Code: Select all

|
|
+--------+
         x

Code: Select all

|
|
+-+
  |
  |
  |
  x
This would make placing pure waypoints much more powerful, as it would let you line up corners multiple in advance, and if ctrl-z just removed the previous one, this could be quite nice...
Tooster
Long Handed Inserter
Long Handed Inserter
Posts: 89
Joined: Wed Mar 24, 2021 6:42 pm
Contact:

Re: Better fast belt bending using waypoints

Post by Tooster »

BicycleEater wrote: Tue Jan 17, 2023 12:44 am This does look good, and is a clear improvement, although I'd love to see the kind of orthogonal tracing stuff you see on PCB layout software, where setting a corner sets the position of the previous corner, and locks that axis, then waiting for you to place the next corner before deciding this one. [...]
I think I understand what you mean, and If that's the case then I created the demo with exactly that in mind and it already works like that. This might not be visible on the first video, because Ubuntu decided to break the screencast tool while upgrading to 22.04, and now it doesn't want to record the cursor :). I made the demo show the "guide" from mouse to the snapped cursor (dotted line) to illustrate how it works right now. I also added automatic guide snapping when placing a waypoint, which makes drawing corners require fewer [R] clicks (or bringing mouse to origin, because SMART mode is awesome imo).



-------------------------------------------------

I also came up with the idea of enabling SMART mode in inverse while fast dragging belts, so that the cursor follows a guide if it's it's close to it (in the blue box radius) and changes the direction when it is outside of it. I've updated the demo accordingly:



What I discovered only after adding it, is that it immensely helps with drawing non-orthogonal, continuous belt paths. Useful for example when you have to run and place belts from destination A to B but go diagonally (to enable use SMART mode and enable "invert smart snap when fast belt drawing":

Look mom, I made a mod ^^ Barrel Stages
BicycleEater
Fast Inserter
Fast Inserter
Posts: 153
Joined: Sun Jul 26, 2020 4:05 pm
Contact:

Re: Better fast belt bending using waypoints

Post by BicycleEater »

Oh, yeah, just tried that and you're completely right - I'm an idiot apparently.
I think it was that those tools tend to draw things in more concretely, but honestly your system works perfectly well.
BicycleEater
Fast Inserter
Fast Inserter
Posts: 153
Joined: Sun Jul 26, 2020 4:05 pm
Contact:

Re: Better fast belt bending using waypoints

Post by BicycleEater »

One thing about that is that it seems to vary the distance between snaps with the speed of the mouse, although I'm sure thats just an implementation detail...
Post Reply

Return to “Ideas and Suggestions”