Construction Drones deprecated

by Klonan

Adds ground based personal construction robots.

Content
3 years ago
0.17 - 1.0
390
Logistic network

i Make (priority_)checks_per_tick configurable?

4 years ago

Like many other players(?), we're using your mod with Warptorio2. It's been an absolute lifesaver, but unfortunately the drones become randomly unresponsive as the game goes on. I've been reading the code, have a theory that it's due to the number of entities and ghosts placed, though I'm not exactly sure of that.

It would be good to add some configuration options. The ones in the title would be a great start, since CPU use is low in general -- our factory isn't large, we just need to construct/deconstruct it a lot. A flag to make it log entity/ghost/etc. counts to the server console (say, once per 5 seconds) would also be great; I don't know, but I have a theory that maybe other surfaces (from previous warps) get left behind and are affecting the logic.

The surfaces should be deleted, but maybe the ghosts aren't? Either way it would be good to check.

4 years ago

While I'm adding to your wishlist:

  • It's great that there's a button to toggle the drones, but they don't react immediately. I'd prefer if they aborted their current actions and returned, as I often click it because they're running into a biter ambush.
  • In the same vein, it would be nice to have a shortcut key for that.
  • And a button to toggle repair. Just repair.

  • Finally, I don't know if this is fixable, but they often decide to repair walls from the outside. Given an option, that seems to happen... maybe half the time? Maybe it would be possible to increase the pathfinding cost for tiles which have biter corpses on them?

4 years ago

It doesn't seem like the pathfinding can be improved with the current API, so I filed a request with the developers instead: https://forums.factorio.com/viewtopic.php?f=28&t=85282. ...well, it would be possible to do pathfinding 'manually' in the script, but that might have unfortunate performance implications.

Don't know why I'm mentioning that to you, really, except to keep you up to date...

4 years ago

I filed a request with the developers ...
Don't know why I'm mentioning that to you, really, ...

if you really didn't know, Klonan is one of the devs, who publishes some of the best mods to do tasks that would be either overpowered in the vanilla game, or too confusing, or not yet stable enough, or not well balanced enough, or that wouldn't get a majority vote of other developers, or to test some new ideas, or to find edge cases that need to be fixed in vanilla (see some recent FFFs about pathfinding), or some of many other reasons, or just for the fun of just programming something without the need to do it in a specific way because he has to ... :-)

anyway, double thanks for the great vanilla game, and for lots of great mods !

4 years ago

I did know, of course. At any rate, it seems that the structure of the pathfinder makes a request like that unfeasible.

Rampant deals with it somehow. Could probably copy that mechanism.

4 years ago

I changed the system

4 years ago
(updated 4 years ago)

New Post

4 years ago

I made a patched version of 0.5.6 for our own personal use, which does nothing except make those parameters configurable.

The performance cost is noticeable; setting them to 8/4, it goes from 0.4ms to 1.5ms per tick. At the same time, it completely fixes the unresponsiveness. That's fine for our case, but it obviously can't be the default. OTOH, I note that the cost only jumps that way when there are unachievable commands set -- deconstructing unreachable fish, for example, or cliffs.

It seems you already differentiate between new commands and old ones, iterating through the older ones at a slower pace, but I'm not sure of that. Still, I think one possible fix would be to make the system more dynamic -- keep track of how old a ghost/decon/whatever command is, put them in exponentially increasing buckets and only iterate over e.g. the 32-64 tick bucket once every 32-64 ticks.

In principle. You'd need to spread the load out per-tick to avoid super-heavy ticks, the way you're already doing.

4 years ago

The new system works differently and much more efficiently. It searches for jobs nearby to players, but only players that actively have robots that can do work.

4 years ago
(updated 4 years ago)

Unfortunately we found that it stopped the bots working at all, so...

I'm not sure how to debug that. Is there any chance that having multiple surfaces would confuse it? Might it be trying to assign jobs to a player who's 'closer' but on a different plane of existence, for example?

That was on 0.6.0. I see 0.6.2 is out, so I'll give it a try at tomorrow's session. I could provide a savegame if it's useful, or if you have time you could join and see the behavior for yourself.

The code seems fairly readable; I've certainly seen far worse. I might just have a go at writing some debug hooks myself.

4 years ago

If it doesn't work, then send me a save game and I can fix it

4 years ago

It works, actually, but thanks for the offer! Also, thanks! ^^

Responsiveness could still be better. I figure I'll try the same patch as on 0.5.6, and see if it helps.

New response