Page 1 of 2

Disable construction near enemies/fire

Posted: Mon Aug 24, 2020 7:38 pm
by mudcrabempire
As the title says, I would like an option to disable robot-based construction/repair for entities that have enemies/fire nearby.

Construction robots have 100 hp and no reasonable resistances or dodging protocols. Sure, 85% fire resistance, but spending several seconds construction in a fully fueled pool with damage upgrades will still burn those 100 hp very fast (and attract further robots to repair each other, flying into the fire, getting damaged, attracting further robots, ...). They are just not meant for warzones. And in some setups they will simply fly out and die in droves until they're all gone. It's sad, useless, pointless and a waste.

All I want is for them to wait until the enemies are dead and the flames have died down and then they are free to do what they are best at: building and repairing.

Re: Disable construction near enemies/fire

Posted: Mon Aug 24, 2020 8:10 pm
by sparr
Detect attacks by measuring ammo/power consumption by your defenses. Disable roboport coverage in areas under attack.

Re: Disable construction near enemies/fire

Posted: Wed Aug 26, 2020 7:14 am
by Qon
sparr wrote: Mon Aug 24, 2020 8:10 pmDisable roboport coverage in areas under attack.
Roboports can't have their energy buffer read so you can't turn them off quickly with power switches. You could extract robots, but that means you have to do it for the entire connected segment of the wall. It's not easy. Or do you have a way to do it?

Re: Disable construction near enemies/fire

Posted: Thu Aug 27, 2020 4:06 am
by ssilk
Many possibilities:
- research robot speed
- avoid building roboports so near to the border
- provide repair packs only when not under attack (ok, not satisfying)

Re: Disable construction near enemies/fire

Posted: Thu Aug 27, 2020 6:38 am
by Koub
ssilk wrote: Thu Aug 27, 2020 4:06 am Many possibilities:
- research robot speed
Unless you're able to achieve robots that are fast enough that they can come in, repair, and leave between two damage ticks, this won't be enough. And I'm pretty sure it's impossible.
ssilk wrote: Thu Aug 27, 2020 4:06 am - avoid building roboports so near to the border
The faster the robots, the further the roboport would need to be, up to the point where, for your robots to be safe, you'd need the defensive wall to be outside of the roboport area coverage.

The only idea I could come with in vanilla would be a laser turret based detection of the combat, with a power switch that would turn the roboport off during combat. (the way the "no drain laser turret based defense" I've seen somewhere).

I'd rather see the "every entity can be read and controlled with citcuits" suggestion be added, it would become trivial to control roboport coverage when attacks are detected on nearby structures.

Re: Disable construction near enemies/fire

Posted: Thu Aug 27, 2020 10:41 am
by Qon
Koub wrote: Thu Aug 27, 2020 6:38 am The only idea I could come with in vanilla would be a laser turret based detection of the combat, with a power switch that would turn the roboport off during combat. (the way the "no drain laser turret based defense" I've seen somewhere).
Yea that thread is amazing.

But roboport drain is 50kW with a 100MJ buffer. That's 2000 seconds or 33.33 minutes. And they need to recharge to about 40% to activate again after they have been drained completely to 0 to deactivate them. So even by using the vanilla enemy detector, you can't rely on drain to turn roboports off. They stay on until robots use them to charge. It's a cool idea but does work in practise :(

Koub wrote: Thu Aug 27, 2020 6:38 am I'd rather see the "every entity can be read and controlled with citcuits" suggestion be added, it would become trivial to control roboport coverage when attacks are detected on nearby structures.
That's a good suggestion though.

Re: Disable construction near enemies/fire

Posted: Thu Aug 27, 2020 12:47 pm
by Koub
Qon wrote: Thu Aug 27, 2020 10:41 am
Koub wrote: Thu Aug 27, 2020 6:38 am The only idea I could come with in vanilla would be a laser turret based detection of the combat, with a power switch that would turn the roboport off during combat. (the way the "no drain laser turret based defense" I've seen somewhere).
Yea that thread is amazing.

But roboport drain is 50kW with a 100MJ buffer. That's 2000 seconds or 33.33 minutes. And they need to recharge to about 40% to activate again after they have been drained completely to 0 to deactivate them. So even by using the vanilla enemy detector, you can't rely on drain to turn roboports off. They stay on until robots use them to charge. It's a cool idea but does work in practise :(
I hadn't thought of the roboport buffer, indeed.
Then I can imagine a contraption that :
- takes all repair packs out of the roboport in real time
- activates an inserter that inserts repari packs into the roboport after a x seconds timer only when activity is detected on the defense perimeter section and attacks stops.

Ah and ensure there are no repair packs elsewhere in the logistic network (so keep the logistic networks separated for each section).

That's awfully complicated, I'm aware of it, but it **could** work, couldn't it ?

Re: Disable construction near enemies/fire

Posted: Thu Aug 27, 2020 1:00 pm
by Qon
Koub wrote: Thu Aug 27, 2020 12:47 pm Ah and ensure there are no repair packs elsewhere in the logistic network (so keep the logistic networks separated for each section).

That's awfully complicated, I'm aware of it, but it **could** work, couldn't it ?
Yes should work without any big problems. Like as second wave arriving as soon as you send out repair packs. But those are acceptable losses and better than having your defenses not being replaced and repaired.

This could also be used for mine replacements too, since placing them in front of a native means they get destroyed before arming.

Re: Disable construction near enemies/fire

Posted: Thu Aug 27, 2020 3:52 pm
by netmand
I find it hilarious when you lay landmines in a construction zone with a cache of landmines nearby. The construction bots replant new mines as soon as they've blown up so a large wave of enemies causes construction bots to re-lay landmines after they've been overrun. It's not a healthy environment for the poor 'lil troopers.

Currently I deal with this sort of thing in two ways:
1) I place roboports far enough away to cause a dispatch to take long enough for the defenses to absorb the attack before the construction bots arrive on the scene.
2) When I can't do that i.e. frontier/front line outposts I add construction bots to the supply list so they get restocked like ammo, oil, steam, etc. As bots die they are replaced with new ones from supply.

I can see why you'd want to be able to disable construction near enemies, especially since you can do this with your personal roboport. But instead I think it might be best to program construction bots to have a sense of self-preservation; To have them avoid enemies instead of charging blindly into them just because they have something to replace or something to repair.

Re: Disable construction near enemies/fire

Posted: Fri Aug 28, 2020 6:14 pm
by mudcrabempire
netmand wrote: Thu Aug 27, 2020 3:52 pm I can see why you'd want to be able to disable construction near enemies, especially since you can do this with your personal roboport. But instead I think it might be best to program construction bots to have a sense of self-preservation; To have them avoid enemies instead of charging blindly into them just because they have something to replace or something to repair.
Yeah, all I care about is that the robots don't die in droves. How exactly you do the mechanics I leave to the ones who have to code it. I kinda figured disabling construction would be easier on the FPS than adding self-preservation routines to robots but what do I know.

Well, I know that build/repair jobs make requests to the robot network for someone to do them (think I read it in an FFF?), so I figured a small "if chunk.being_attacked: don't send request" might do the trick. And chunk.being_attacked could be related to the event when biters are near your defenses and start to charge? I'm pretty sure there's and event there? And then just put it on a timer or something.

In all due likelihood that will cause a ridiculous chain of bugs and misbehavior that will take ages to fix :P.

Re: Disable construction near enemies/fire

Posted: Sat Aug 29, 2020 6:55 am
by ssilk
mudcrabempire wrote: Fri Aug 28, 2020 6:14 pm Yeah, all I care about is that the robots don't die in droves.


Maybe use the repair turret mod?
https://mods.factorio.com/mod/Repair_Turret

I really like it, because it exactly does that.

Re: Disable construction near enemies/fire

Posted: Sat Aug 29, 2020 7:32 am
by Koub
ssilk wrote: Sat Aug 29, 2020 6:55 am
mudcrabempire wrote: Fri Aug 28, 2020 6:14 pm Yeah, all I care about is that the robots don't die in droves.


Maybe use the repair turret mod?
https://mods.factorio.com/mod/Repair_Turret

I really like it, because it exactly does that.
It doesn't seem to replace destroyed walls, used mines, and such, does it ? It seems to be a good mod, but still a workaround for something needed in the game, while impossible (like treating the symptoms instead of the root cause).

Re: Disable construction near enemies/fire

Posted: Sat Aug 29, 2020 8:00 am
by ssilk
It needs some research, but then it works like if you beam the needed items directly out of your chests to the ghost. I really like it, because it speeds up construction quite a lot.

Robot repairs / builds disable on attacks - Save (construction) robots from their doomed fate!

Posted: Sat Jan 06, 2024 9:20 pm
by MartenM
TL;DR
Stop robots from committing suicide. It's sad!

What?
There are multiple solutions to the problem. It mainly bowls down to being able to disable building and repairing in a given roboport area.

1:
Option one would just to have checkboxes in a roboport that can be set.
Repairs and buildings will be blocked if an area is actively being damaged/attacked.
- Could be configured in a roboport for its coverage, sometimes it needs to do the repairs in its surroundings and you wouldn't want this behaviour.
- Could be a toggle for repairs and rebuilds combined or separated.

2:
Another option could involve the circuit network:
- Allow detection of 'damage' / 'attacks' to be read from a roboport (only from the area it covers).
- Allow insertion of signals in the roboport that block repairs/building in the area it covers.

- Alternative for roboport detection: Use radars to detect enemies /biters / spitters!

This last option might just introduce a lot of boilerplate, but could maybe be extended for other uses too?

Why ?
When building a perimeter wall it's smart to set up roboports with repair packs. This helps the wall repair itself which is great.

Now obviously when the biters attack, the wall gets either damaged or broken. The construction robots are swift and rush to the scene, to then die while repairing...

Now this is not a huge issue, the robots are quickly replenished. However, it does cause a lot of 'entity has been destroyed' warnings.
Additionally, they are robots! Sure they or the roboports should be smarter?

There are ways to make this issue less prevalent, more defences, and roboports far away, but they all feel dull. They combat the symptom, not the underlying issue.

I tried searching to see if this could be achieved with mods, but the interfaces of roboports and repairs seem to lack the functionality to introduce this feature.




PS: I don't post here often, I read the guidelines and searched for topics, if I missed it be sure to let me know : )

Re: Robot repairs / builds disable on attacks - Save (construction) robots from their doomed fate!

Posted: Sat Jan 06, 2024 9:36 pm
by pleegwat
Somehow I feel the solution to this should involve the circuit network.

Re: Robot repairs / builds disable on attacks - Save (construction) robots from their doomed fate!

Posted: Sat Jan 06, 2024 9:37 pm
by MartenM
pleegwat wrote: Sat Jan 06, 2024 9:36 pm Somehow I feel the solution to this should involve the circuit network.
If it would be possible to detect 'an attack' in a given area of a roboport this could maybe be done using circuits properly. However this would mean you have to take out the repair packs from the roboport, which is a bit cumbersome too.

If it would be possible to feed roboports a certain control signal (block repairs, block building) that could maybe be a more interesting solution.
Currently roboports are read only.

Edit: Added a second suggestion that uses the circuit network.

Re: Robot repairs / builds disable on attacks - Save (construction) robots from their doomed fate!

Posted: Sat Jan 06, 2024 10:18 pm
by pleegwat
I'd expect detecting (of biters) to be on the radar, not on the roboport. Probably only in the inner/permanent scan range?

Re: Robot repairs / builds disable on attacks - Save (construction) robots from their doomed fate!

Posted: Sat Jan 06, 2024 10:25 pm
by MartenM
pleegwat wrote: Sat Jan 06, 2024 10:18 pm I'd expect detecting (of biters) to be on the radar, not on the roboport. Probably only in the inner/permanent scan range?
I hadn't thought of that. That would be an interesting solution as well!

Re: Robot repairs / builds disable on attacks - Save (construction) robots from their doomed fate!

Posted: Sun Jan 07, 2024 4:01 am
by Illiander42
MartenM wrote: Sat Jan 06, 2024 9:37 pm
pleegwat wrote: Sat Jan 06, 2024 9:36 pm Somehow I feel the solution to this should involve the circuit network.
If it would be possible to detect 'an attack' in a given area of a roboport this could maybe be done using circuits properly. However this would mean you have to take out the repair packs from the roboport, which is a bit cumbersome too.
It is possible (but very, very clumbersome) to detect when turrets fire currently.

Re: Robot repairs / builds disable on attacks - Save (construction) robots from their doomed fate!

Posted: Mon Jan 08, 2024 10:49 am
by MartenM
Illiander42 wrote: Sun Jan 07, 2024 4:01 am
MartenM wrote: Sat Jan 06, 2024 9:37 pm
pleegwat wrote: Sat Jan 06, 2024 9:36 pm Somehow I feel the solution to this should involve the circuit network.
If it would be possible to detect 'an attack' in a given area of a roboport this could maybe be done using circuits properly. However this would mean you have to take out the repair packs from the roboport, which is a bit cumbersome too.
It is possible (but very, very clumbersome) to detect when turrets fire currently.
A lot is possible, but most solutions feel tacky and more like hacks or are just not practical at all.
Not really at the quality level of an engineer who launches a rocket.