Let's overhaul smart belt!

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

GlassBricks
Long Handed Inserter
Long Handed Inserter
Posts: 57
Joined: Fri Jun 11, 2021 5:20 pm
Contact:

Let's overhaul smart belt!

Post 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 770 times
08-10-2025, 14-11-27.png
08-10-2025, 14-11-27.png (714.58 KiB) Viewed 770 times
08-10-2025, 14-14-28.png
08-10-2025, 14-14-28.png (477.67 KiB) Viewed 770 times
08-10-2025, 14-12-46.png
08-10-2025, 14-12-46.png (436.48 KiB) Viewed 770 times
Last edited by GlassBricks on Sun Aug 10, 2025 7:35 pm, edited 2 times in total.
eugenekay
Filter Inserter
Filter Inserter
Posts: 619
Joined: Tue May 15, 2018 2:14 am
Contact:

Re: Let's overhaul smart belt!

Post 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!
pantabo1
Long Handed Inserter
Long Handed Inserter
Posts: 58
Joined: Thu Jan 05, 2023 3:49 pm
Contact:

Re: Let's overhaul smart belt!

Post 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
eugenekay
Filter Inserter
Filter Inserter
Posts: 619
Joined: Tue May 15, 2018 2:14 am
Contact:

Re: Let's overhaul smart belt!

Post 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?
GlassBricks
Long Handed Inserter
Long Handed Inserter
Posts: 57
Joined: Fri Jun 11, 2021 5:20 pm
Contact:

Re: Let's overhaul smart belt!

Post 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.
Last edited by GlassBricks on Sun Aug 10, 2025 10:40 pm, edited 1 time in total.
pantabo1
Long Handed Inserter
Long Handed Inserter
Posts: 58
Joined: Thu Jan 05, 2023 3:49 pm
Contact:

Re: Let's overhaul smart belt!

Post 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.
User avatar
Brathahn
Fast Inserter
Fast Inserter
Posts: 147
Joined: Sat Aug 02, 2014 1:50 pm
Contact:

Re: Let's overhaul smart belt!

Post 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!
Jap2.0
Smart Inserter
Smart Inserter
Posts: 2538
Joined: Tue Jun 20, 2017 12:02 am
Contact:

Re: Let's overhaul smart belt!

Post 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.)
There are 10 types of people: those who get this joke and those who don't.
pantabo1
Long Handed Inserter
Long Handed Inserter
Posts: 58
Joined: Thu Jan 05, 2023 3:49 pm
Contact:

Re: Let's overhaul smart belt!

Post 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.
mmmPI
Smart Inserter
Smart Inserter
Posts: 4616
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: Let's overhaul smart belt!

Post 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.
Check out my latest mod ! It's noisy !
rvb30
Burner Inserter
Burner Inserter
Posts: 15
Joined: Mon Feb 19, 2024 9:24 pm
Contact:

Re: Let's overhaul smart belt!

Post 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
Jap2.0
Smart Inserter
Smart Inserter
Posts: 2538
Joined: Tue Jun 20, 2017 12:02 am
Contact:

Re: Let's overhaul smart belt!

Post 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.
There are 10 types of people: those who get this joke and those who don't.
GlassBricks
Long Handed Inserter
Long Handed Inserter
Posts: 57
Joined: Fri Jun 11, 2021 5:20 pm
Contact:

Re: Let's overhaul smart belt!

Post 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.
mmmPI
Smart Inserter
Smart Inserter
Posts: 4616
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: Let's overhaul smart belt!

Post 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 :)
Check out my latest mod ! It's noisy !
eugenekay
Filter Inserter
Filter Inserter
Posts: 619
Joined: Tue May 15, 2018 2:14 am
Contact:

Re: Let's overhaul smart belt!

Post 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:
Post Reply

Return to “Ideas and Suggestions”