Re: Personal robots prioritizing nearest first
Posted: Tue Mar 19, 2019 2:23 pm
[Koub] Merged into the said massive thread.
www.factorio.com
https://forums.factorio.com/
That's not the same as prioritising things - it ties up the robots until the other task is done, the robot has to actually sit there and wait.Sad_Brother wrote: Mon Mar 18, 2019 6:30 pm But for now one robot can wait for space cleared from trees by other robots before building.
They could, but what would be the point? Having the robots wait around would just mean the overall building happens slower as there's fewer active robots. Just placing things without waiting will finish sooner. It also could deadlock and prevent the build from ever completing if you don't have enough robots: you might end up with all the robots holding something and waiting for power to be hooked up, with no robots free to actually build the power poles. To solve your problem you actually would need prioritisation, not just having the robots wait.Why one robot cannot wait for space powered before placing power consumer?
Why one robot cannot wait for power pole can be connected to other poles before placing new?
The performance impact of this has been discussed extensively in the thread this is now merged into already.Why construction requests cannot be sorted by some priority?
Not entirely accurate. A robot will not be dispatched to place down a structure until one has been assigned to at least clear out anything blocking it. Occasionally, you'll still run into a situation where robot A gets assigned to clear a tree, robot B gets assigned to place a strucuture, but then robot A gets delayed or was further away so robot B reaches their destination and has to wait. This is typically a small wait. The system does in fact already have enough intelligence already to not dispatch robots to do tasks that are reasonably expected to be undoable for the forseeable future.torne wrote: Tue Mar 19, 2019 3:15 pmThat's not the same as prioritising things - it ties up the robots until the other task is done, the robot has to actually sit there and wait.Sad_Brother wrote: Mon Mar 18, 2019 6:30 pm But for now one robot can wait for space cleared from trees by other robots before building.
Base on the information above, the system could possibly be reasonably extended such that a robot will not be dispatched to place down a powered building if A: there's an order to place down the electric pole, and B: nothing has been dispatched to place down the power. By also extending this so that a power pole will not be dispatched that would connect to a powered power pole, unless that powered pole has already been dispatched or already exists. The system works... I just can't speak for if it's UPS friendly enough to be considered.torne wrote: Tue Mar 19, 2019 3:15 pmThey could, but what would be the point? Having the robots wait around would just mean the overall building happens slower as there's fewer active robots. Just placing things without waiting will finish sooner. It also could deadlock and prevent the build from ever completing if you don't have enough robots: you might end up with all the robots holding something and waiting for power to be hooked up, with no robots free to actually build the power poles. To solve your problem you actually would need prioritisation, not just having the robots wait.Why one robot cannot wait for space powered before placing power consumer?
Why one robot cannot wait for power pole can be connected to other poles before placing new?
Yes, I'm aware of that, but it's still not the same as prioritising things, and in some cases is still slower than simply not dispatching the robot at all until the deconstruction is done. Simply dispatching all possible deconstruction tasks before any construction tasks would be prioritisation, and would reduce wait times (but be more expensive to calculate).Darinth wrote: Tue Mar 19, 2019 3:44 pmNot entirely accurate. A robot will not be dispatched to place down a structure until one has been assigned to at least clear out anything blocking it. Occasionally, you'll still run into a situation where robot A gets assigned to clear a tree, robot B gets assigned to place a strucuture, but then robot A gets delayed or was further away so robot B reaches their destination and has to wait. This is typically a small wait. The system does in fact already have enough intelligence already to not dispatch robots to do tasks that are reasonably expected to be undoable for the forseeable future.torne wrote: Tue Mar 19, 2019 3:15 pm That's not the same as prioritising things - it ties up the robots until the other task is done, the robot has to actually sit there and wait.
This will slow down building overall as I said, and in many more cases than the current logic for overlapping deconstructions. Right now the building speed for an unobstructed blueprint is roughly linear in the number of robots available; by considering dependencies between entities in that way it can be linear in the number of entities in the worst case (e.g. just a line of power poles), and will have fairly significantly reduced parallelism in almost all cases. It's really not clear what the advantage of doing this would actually be. Again, to actually build in the desired order without creating artificial waiting times would require actually prioritising different entities.Base on the information above, the system could possibly be reasonably extended such that a robot will not be dispatched to place down a powered building if A: there's an order to place down the electric pole, and B: nothing has been dispatched to place down the power. By also extending this so that a power pole will not be dispatched that would connect to a powered power pole, unless that powered pole has already been dispatched or already exists. The system works... I just can't speak for if it's UPS friendly enough to be considered.
I think ghost can be disabled until condition met.torne wrote: Tue Mar 19, 2019 5:54 pmYes, I'm aware of that, but it's still not the same as prioritising things, and in some cases is still slower than simply not dispatching the robot at all until the deconstruction is done. Simply dispatching all possible deconstruction tasks before any construction tasks would be prioritisation, and would reduce wait times (but be more expensive to calculate).Darinth wrote: Tue Mar 19, 2019 3:44 pmNot entirely accurate. A robot will not be dispatched to place down a structure until one has been assigned to at least clear out anything blocking it. Occasionally, you'll still run into a situation where robot A gets assigned to clear a tree, robot B gets assigned to place a strucuture, but then robot A gets delayed or was further away so robot B reaches their destination and has to wait. This is typically a small wait. The system does in fact already have enough intelligence already to not dispatch robots to do tasks that are reasonably expected to be undoable for the forseeable future.torne wrote: Tue Mar 19, 2019 3:15 pm That's not the same as prioritising things - it ties up the robots until the other task is done, the robot has to actually sit there and wait.
Delaying inserters until the target is placed isn't necessary - built inserters which are pointing at a ghost automatically disable themselves instead of placing the item on the ground underneath the ghost, so it doesn't matter what order things get built in for correctness.Sad_Brother wrote: Tue Mar 19, 2019 9:37 pm I think ghost can be disabled until condition met.
I think condition can be checked even if it is more complex than obstruction.
I think such conditions should not be on all blueprints. It may be "blueprint option".
Yes, I understand it can demand more ticks. But it may be worth it.
There are other conditions possible. Like delay inserters until target ghost placed.
Conditions may be helpful in some situations where you need additional control. I just attempt to find easier way.
So what you are saying is: Place the damn power first!Sad_Brother wrote: Wed Mar 20, 2019 3:00 pm I did not know about inserters behaviour. It is good.
The most important case, where power network needed as soon as possible is aggressive laser turret blueprint. It is obvious.
The less important case is solar blueprint, where power connection is more important than panels and batteries.
The minor case is the blueprint, expanding power network with roboport in the middle. Unlike others here power network is the main part actually.
Not exactly that, but still... No. Your point of view is different.mrvn wrote: Wed Mar 20, 2019 6:27 pmSo what you are saying is: Place the damn power first!
I think this might be fixed by a mod that splits blueprints internally into 2 parts: Power and non-power. When you place a blueprint t it would first place the power sub print and wait for all power poles to get a bot (or to be build, there is no event for bot assigned, right?). The the full blueprint would be placed to build the rest.
Yeah, if you are turret creeping with lasers and robots it's somewhat helpful, but it only really makes a difference if the blueprint you're using is pretty big (multiple poles, a bunch of turrets); if you're just placing 1-3 poles surrounded by turrets then your roboport likely has enough robots to dispatch everything all at once which will mean the turrets are only unpowered for a moment at worst. The devs generally don't seem to want to encourage turret creeping and have been trying to make alternatives more viable instead, though.Sad_Brother wrote: Wed Mar 20, 2019 3:00 pm The most important case, where power network needed as soon as possible is aggressive laser turret blueprint. It is obvious.
It seems like that is only going to matter if you are extending your power when you are already significantly over-utilising it and there's a risk your roboport network might lose power before the job is done. If you're just expanding your solar under normal conditions, then yes, placing the electrical network first would be better, but it doesn't really matter; the whole thing is going to be built soon regardless, "missing out" on that solar production for a minute or two while you wait for the bots to come place the other parts doesn't really hurt you.The less important case is solar blueprint, where power connection is more important than panels and batteries.
Not sure exactly what you mean by this so can't really commentThe minor case is the blueprint, expanding power network with roboport in the middle. Unlike others here power network is the main part actually.
I agree all my "cases" not extremely needed that feature.
But that would truly slow down construction, Especially with power poles being a long distance away. Each level of power poles would add the full delay to fetch and build them before the next stuff is build. Only useful for automating turret creep and not sufficient even there. You want the next power pole only when the laser turrets are placed to protect it.Sad_Brother wrote: Thu Mar 21, 2019 3:19 pmNot exactly that, but still... No. Your point of view is different.mrvn wrote: Wed Mar 20, 2019 6:27 pmSo what you are saying is: Place the damn power first!
I think this might be fixed by a mod that splits blueprints internally into 2 parts: Power and non-power. When you place a blueprint t it would first place the power sub print and wait for all power poles to get a bot (or to be build, there is no event for bot assigned, right?). The the full blueprint would be placed to build the rest.
I do not know mod possibilities. Probably some features absent. Let's try to build algorithm:Aggressive laser turrets with your algorithm will first try to place poles leaving them unguarded.
- Player place the blueprint with "power priority" option. Entities, would be disabled, shown by (yellow?) colour.
- Power poles and power consumer/producer, unable to connect to already existent powered network, placed as "disabled ghost".
- All other ghost placed as usual.
- Each time, power pole placed, surrounding "disabled ghosts" checked and enabled if they can get power.
My algorithm would enable turrets as soon as power ready, so poles and robots would be guarded.
Also your algorithm suspend blueprint constructing while no poles available, but my algorithm suspend only those parts, which would not work anyway.
You may be right. But may be not. Only testing can show truth. I do not want it for all blueprints anyway.mrvn wrote: Thu Mar 21, 2019 4:17 pmBut that would truly slow down construction, Especially with power poles being a long distance away. Each level of power poles would add the full delay to fetch and build them before the next stuff is build. Only useful for automating turret creep and not sufficient even there. You want the next power pole only when the laser turrets are placed to protect it.
I think for that recursive blueprints would be better. You place a blueprint containing the power pole and a blueprint for the turrets. When the poles are done the turret blueprint is placed, which can include a blueprint for the next power poles again. You could easily make this 10 or 20 levels deep to creep your turrets automatically.
With the topic bumped I wanted to address this.JohnyDL wrote: Sun Oct 15, 2017 10:29 am Suicide Junkie: so instead of one list you propose several lists and you do several times as much work, I'm not saying this is unfeasible but it's still more work and more bugs to track and there are conflicts, is the way you'd sort your build order the same as mine, I mean if I'm deconstructing the first thing I'd want rid of is power, I'm deconstructing it don't do more things stop them stop them all stop them now :p
So more work, not saying this is as bad as ordering by distance but it's still work.
If you're checking all ghosts it's far from none trivial. But it's fairly trivial if you're only doing 20 checks rather than 1. But it isn't free.
Check if ghost is within range of personal roboports, easy as that. Um No. For the nth time
there is no shortcuts to finding out if a ghost is in range of a personal roboport you have to do a surface scan of every tile in the roboports range this takes a lot of computational power and time, and you have to do it every tick