Robots Build Closest First (FULL REWRITE)


Personal construction robots now prioritize building and deconstructing entities closest to the player. This change makes a player twice as fast at building and deconstructing with the exact same equipment setup. This mod is a complete rework of similar existing mods and offers a massive performance increase. A shortcut is available to toggle the mod, and the maximum construction area can be limited in the settings. Should work with other mods adding new personal roboports.

Utilities
4 days ago
2.0 - 2.1
2.91K
Armor Logistic network

g Uninstall removes all personal roboports

6 days ago

Uninstalled the mod, my personal roboports vanished. That's a nasty surprise.

5 days ago

oh yes that can happen Let me fix that!
i hope you didnt safe your game without the mod yet!
wait until i fix this to remove the mod!

can i ask why you uninstalled it?

5 days ago

It was a testing session, so don't worry about the save.

I uninstalled because the drone work target selection behaves strangely as I walk around. I like the idea of this mod, but it didn't feel right in practice.

5 days ago

Yeah, the original mod searched the surroundings every nth tick and scaled the radius to exactly what's needed, but that was extremely slow.

My version is a complete overhaul.
It works completely differently by only working with data already exposed by the game, like: how many drones does the player have available,
how many jobs are there to do,
how many drones are already flying, how many are charging, and so on.
And I just use the differences with some delays and dampening to grow and shrink the radius of the roboports to match the demand.
And that can sometimes OVER or UNDER shoot.
That's the drawback, but on the other hand, the mod is basically FREE in terms of performance.
You can use this with 50 players at the same time, no problem.

Also, it's very hard to tweak the values for every occasion, so yes, the mod is probably NOT at its best yet.

For example, if a player walks by a FULL chest selected for deconstruction, the drone supply vs. job demand SPIKES into the thousands, and the algorithm thinks you moved into an area with thousands of buildings to build and scales the construction radius back.
And then one sec later, no jobs at all because the chest moves out of reach, and then it's just oscillating back and forth.
But for normal building with some bots with a small max range to hundreds of bots with HUGE ranges, this mod should work fine.
I'm using it myself in a current run to check if it works in most situations.
As I said, it's hard to cover every case in an implementation that is so limited, but I try to make it work! If it is behaving weirdly in some situations, you could just turn off the shortcut temporarily to get around that!

Almost done with the uninstallation problem, btw!

4 days ago

I have updated the mod to allow uninstallation. just check the settings "per map" section while ingame.

also i have been working on an overhaul for some time and it is also out now!
pls try the mod again maybe you like it better!

4 days ago

Alright, I'll give it a try

4 days ago

The mod Robots Build Closest First (2.0.1) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event Robots_Build_Closest_First::on_tick (ID 0)
Unknown equipment name: personal-roboport-equipment-reduced-19
stack traceback:
[C]: in function 'put'
Robots_Build_Closest_First/control.lua:57: in function 'set_eq_radius'
Robots_Build_Closest_First/control.lua:75: in function 'set_grid_radius'
Robots_Build_Closest_First/control.lua:219: in function 'updatePlayer'
Robots_Build_Closest_First/control.lua:310: in function <Robots_Build_Closest_First/control.lua:288>

Several seconds into a new test game (with personal roboport equipped). No jobs existed yet.

4 days ago

I didnt get that 😭😭

4 days ago

Should be fixed in 3h

2 days ago

i tried but couldnt find the error

meaning i couldnt replicate it... i dont now what went wrong on your end.
maybe delete the mod and reinstall it again

New response