Page 1 of 1

Let's overhaul smart belt!

Posted: Sun Aug 10, 2025 6:53 pm
by GlassBricks
TL;DR
Let's overhaul smart belt — fixing bugs, adding features, and making it handle all possible scenarios! I’m volunteering to implement this.
What
I’ve drafted a complete redesign of smart belt, aiming for intuitive, consistent, and useful behavior, and handling all possible cases.
Yes, seriously.

Full details here: https://github.com/GlassBricks/new-smart-belt-proposal (includes text spec and blueprint showcase).
The blueprint doubles as a large set of unit tests; the spec explains the design in depth.
Any feedback is greatly appreciated!
I'm especially looking for feedback on intentional behavioral changes[\i] from current smart belt.

I’m seeking feedback from the community and devs on the proposal. I also plan to prototype the implementation, so people can test and give input (as either a mod or web-ui).

Why

Current smart belt behavior is riddled with bugs and many unhandled cases. A lot of people in the Factorio speedrunning discord are constantly complaining about it. Additionally, more features are being added, like the recent belt "un-dragging".
At this point, if we want to fix everything and add more features, it's likely more efficient to redesign it from the ground up rather than individual bug smashing.

This redesign aims to mathematically cover every case. While drafting it, I found that a few small tweaks allows to the spec to support new features, like belt weaving.

Plus, I do love a fun programming challenge, and I'm volunteering to take it on.

Some previews of a few things covered by the spec:
08-10-2025, 14-10-37.png
08-10-2025, 14-10-37.png (452.35 KiB) Viewed 835 times
08-10-2025, 14-11-27.png
08-10-2025, 14-11-27.png (714.58 KiB) Viewed 835 times
08-10-2025, 14-14-28.png
08-10-2025, 14-14-28.png (477.67 KiB) Viewed 835 times
08-10-2025, 14-12-46.png
08-10-2025, 14-12-46.png (436.48 KiB) Viewed 835 times

Re: Let's overhaul smart belt!

Posted: Sun Aug 10, 2025 7:04 pm
by eugenekay
You are aware that Factorio is not an open-source project, right? There is simply nowhere to submit a Pull Request if you’re not an Employee of Wube Software.

I cannot tell if this is a joke. Good Luck!

Re: Let's overhaul smart belt!

Posted: Sun Aug 10, 2025 7:08 pm
by pantabo1
eugenekay wrote: Sun Aug 10, 2025 7:04 pm You are aware that Factorio is not an open-source project, right? There is simply nowhere to submit a Pull Request if you’re not an Employee of Wube Software.

I cannot tell if this is a joke. Good Luck!
Glassbricks is a known speedrunner and modder for factorio. There has already been interactions with devs with the speedrunner community in general as well as with specific person. There has been a suggestion by a dev that he / other could attempt to tackle it and see what comes of it. It was hinted that he might be able to gain code access. just fyi

Re: Let's overhaul smart belt!

Posted: Sun Aug 10, 2025 7:19 pm
by eugenekay
Never heard of ‘em. :-) That is the problem with tribal knowledge - only some people know it. If you have Code access, then why ask the people in the Forums who do not?

It sounds like an interesting idea - but so far it is Just an Idea. I don’t quite understand what is wrong with Smart Belt Building to begin with, why it needs to be Overhauled, or why this requires a formal Mathematical Spec - it’s a Game, not a Physics Simulator. Maybe I am the one playing the game wrong, by just placing belts where I want them to go. How often do belts need to be rebraided and relaid? Maybe if there was an actual Mod to try, or some demonstrations?

Re: Let's overhaul smart belt!

Posted: Sun Aug 10, 2025 7:30 pm
by GlassBricks
More on why do this:

Searching "smart belt bug", especially recent posts, will get you a glimpse into one motivation.

While playing around found a ton of questionable behaviors in the current implementation.
It's the "I can't tell if this is intended or not" part that gets me; hence trying to formalize things.

Current smart belt:
- Easily breaks the line you are dragging in many scenarios, without warning
- often interrupts existing belt lines
- Still has bugs
- Doesn't support:
- Many belt patterns
- Belt weaving
- Splitters in many scenarios

Plus, a bunch of people in the Speedrunning community joked that "GlassBricks is the only guy who can save smart belt now". Well... I guess I'm taking that joke seriously now.

Re: Let's overhaul smart belt!

Posted: Sun Aug 10, 2025 10:03 pm
by pantabo1
eugenekay wrote: Sun Aug 10, 2025 7:19 pm Never heard of ‘em. :-) That is the problem with tribal knowledge - only some people know it. If you have Code access, then why ask the people in the Forums who do not?

It sounds like an interesting idea - but so far it is Just an Idea. I don’t quite understand what is wrong with Smart Belt Building to begin with, why it needs to be Overhauled, or why this requires a formal Mathematical Spec - it’s a Game, not a Physics Simulator. Maybe I am the one playing the game wrong, by just placing belts where I want them to go. How often do belts need to be rebraided and relaid? Maybe if there was an actual Mod to try, or some demonstrations?
It is really hard to convey just how weird smart belt is right now if you have never encountered the issues yourself unexpectedly and repeatedly. I recommend looking at the bug forum and nlt just at the open ones, but also at the assigned or pending ones, as well as the fixed issues. If you search for „smart belt“ a sufficient amount should come up. If you think that the issues only arise with weird setups, you are not wrong. That doesnt mean, however, that they are uncommon or that they are fine and should persist.

Re: Let's overhaul smart belt!

Posted: Sun Aug 10, 2025 10:56 pm
by Brathahn
GlassBricks wrote: Sun Aug 10, 2025 6:53 pm This redesign aims to mathematically cover every case.
i think this will go in the thounsands of possibilities. make sure you have an automaterd test for each of them aswell :D


good luck!

Re: Let's overhaul smart belt!

Posted: Mon Aug 11, 2025 1:33 am
by Jap2.0
A couple thoughts from glancing over it:

- You keep talking about "mathematically cover[ing] all possible scenarios"—have you done any sort of fuzzing or enumeration or are you at the "this covers everything we can think of so far" stage right now?
- I'm a bit confused by your definition of accessibility. Right now reading 2.2.1 seems like if a belt is connected in any way to a curved belt anywhere, it is inaccessible. Is that correct?
- 5.4: "Running out of real belts cancels the drag." Does cancel mean no further belts are placed or the entire fast-dragging motion is undone? (I assume the former.)

(This is not intended as criticism, just curious where this is at and making sure everything's clear. What you're attempting is no small feat.)

Re: Let's overhaul smart belt!

Posted: Mon Aug 11, 2025 8:20 am
by pantabo1
Jap2.0 wrote: Mon Aug 11, 2025 1:33 am A couple thoughts from glancing over it:

- You keep talking about "mathematically cover[ing] all possible scenarios"—have you done any sort of fuzzing or enumeration or are you at the "this covers everything we can think of so far" stage right now?
- I'm a bit confused by your definition of accessibility. Right now reading 2.2.1 seems like if a belt is connected in any way to a curved belt anywhere, it is inaccessible. Is that correct?
- 5.4: "Running out of real belts cancels the drag." Does cancel mean no further belts are placed or the entire fast-dragging motion is undone? (I assume the former.)

(This is not intended as criticism, just curious where this is at and making sure everything's clear. What you're attempting is no small feat.)

Mathematically covering all cases: if there is any ambiguity in the result means throwing an error. Meaning: if there is not a clear result that is establish it will throw and error / alert the player and not screw the belt up or be easily reversible.

The accessibility is still not exactly clear, even for gv himself (dont take my word for this).

Running out of belt cancels the drag: if you run out of e.g. underground while the game attempts to use tthe ug to continue, it will cancel the action and revert up to the spot where you had belts. This is to prevent partially smartbelts that are completely screwed up.

Re: Let's overhaul smart belt!

Posted: Tue Aug 12, 2025 6:54 am
by mmmPI
GlassBricks wrote: Sun Aug 10, 2025 6:53 pm I’m seeking feedback from the community and devs on the proposal. I also plan to prototype the implementation, so people can test and give input (as either a mod or web-ui).
Would be happy to test anything in game !

current feedback is : i'm happy speedrunners have interest in trying to help with this because i believe they are amongst the individuals that practice those hotkeys the most.
GlassBricks wrote: Sun Aug 10, 2025 6:53 pm I'm especially looking for feedback on intentional behavioral changes[\i] from current smart belt.
It's much harder for me to propose something consistent here than saying "i like this" or "i don't like this" when testing something, and i don't know if that counts as smart belt related, but it would qualify as overhaul to me if you could drag not just 1 but 2 or 3 belts in parallel after pressing ctrl + mouse wheel, a little similar to how you can place larger square of concrete, i know i can use blueprints and force build, i just feel that's where current smart belt is the most annoying for me not-speedrunner.

"Smart belt weaving" i believe is going to be incredibly difficult or impossible or arbitrary at some point because of how sometimes there are several "valid options" when dragging a belt over a set of others already weaved and it may be possible to deal with this with a setting for different behavior, currently i feel there's only a on/off setting and we get the whole "smart" thing, but if you are going to revisit the logic, it may be possible to consider making it more granular ? So as to allow potentially 2 different and conflicting logic to be proposed to the player who enable one or the other ?

Anyway that's not very precise proposition for specific cases.

Re: Let's overhaul smart belt!

Posted: Tue Aug 12, 2025 9:08 pm
by rvb30
mmmPI wrote: Tue Aug 12, 2025 6:54 am it would qualify as overhaul to me if you could drag not just 1 but 2 or 3 belts in parallel after pressing ctrl + mouse wheel, a little similar to how you can place larger square of concrete, i know i can use blueprints and force build, i just feel that's where current smart belt is the most annoying for me not-speedrunner.
This would be somewhat unrelated to this thread, but a god-tier feature we all need in our lives

Re: Let's overhaul smart belt!

Posted: Tue Aug 12, 2025 10:19 pm
by Jap2.0
rvb30 wrote: Tue Aug 12, 2025 9:08 pm
mmmPI wrote: Tue Aug 12, 2025 6:54 am it would qualify as overhaul to me if you could drag not just 1 but 2 or 3 belts in parallel after pressing ctrl + mouse wheel, a little similar to how you can place larger square of concrete, i know i can use blueprints and force build, i just feel that's where current smart belt is the most annoying for me not-speedrunner.
This would be somewhat unrelated to this thread, but a god-tier feature we all need in our lives
Ooh that sounds fun. The one thing I miss with smart belt building is "spraying" a few lanes of belts at a time.

Re: Let's overhaul smart belt!

Posted: Wed Aug 13, 2025 4:31 am
by GlassBricks
I've just updated the spec to have much more and cleaner explanations/motivations, with some images, to be readable by a wider audience!


That wider audience may include an LLM someday... Don't worry, there will be no vibe-coding here; my code quality standards are much higher that most LLMs have. but they are nice for "putting paint on the canvas", so to speak.

Re: Let's overhaul smart belt!

Posted: Wed Aug 13, 2025 7:16 am
by mmmPI
GlassBricks wrote: Wed Aug 13, 2025 4:31 am I've just updated the spec to have much more and cleaner explanations/motivations, with some images, to be readable by a wider audience!
It worked, it made it more clear at least to me that the messages shown on the picture near display pannels are errors that could be displayed to players when a smart belt is not laid out automatically due to a specific "error". It would be new, and i think it is interesting for solving edge cases, particularly if it's done so you don't loose time clicking away a pop up or anything that would additionnal sub-optimal moves as i expect from speedrunners :)

Re: Let's overhaul smart belt!

Posted: Wed Aug 13, 2025 1:28 pm
by eugenekay
GlassBricks wrote: Wed Aug 13, 2025 4:31 am Don't worry, there will be no vibe-coding here
new-smart-belt-proposal/blob/main/markdown_numberer.py (the only piece of "Code" in the repository at present):

Code: Select all

#!/usr/bin/env python3
# Partly vibe coded

import sys
import re
import argparse
I sort-of do not believe you. :lol: