Personal roboport parameter update

mknejp
Fast Inserter
Fast Inserter
Posts: 154
Joined: Wed Apr 27, 2016 8:29 pm
Contact:

Personal roboport parameter update

Post by mknejp »

When using the LuaEquipmentGrid take() and put() methods with personal roboports the parameters of the mobile logistic network don't update. For example, if you take() a roboport with a radius of 15 out and put() one with a radius of 10 to replace it the range stays the same. Robots still work at the previous range, the green zone is rendered at the same size, and the equipment grid GUI still shows the previous values. If you replace a roboport with one that has a lower robot_limit the GUI in the equipment grid does update, but the robots are still happily swarming around at the previous limit.

I first considered filing this as a bug but I think that would be a mistake. In my particular use case I want to replace the normal roboport with one that has a lower range. I do that by take()-ing the old one out and put()-ing the replacement in at the same position. If current behavior were to change so that each of the two calls would re-evaluate the network's parameters it would run the risk of orphaning launched robots which would be very annoying.

So instead how about having a update_parameters() function that recalculates the equipment grid properties and adjusts the network, but only when requested. Ideally it would make robots outside the new construction range abort their task and find a new one withing the new range, or dock if none can be found. I'm not entirely sure whether this should be part of the entity, grid, network or logistic cell though.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14913
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Personal roboport parameter update

Post by Rseding91 »

mknejp wrote:When using the LuaEquipmentGrid take() and put() methods with personal roboports the parameters of the mobile logistic network don't update. For example, if you take() a roboport with a radius of 15 out and put() one with a radius of 10 to replace it the range stays the same. Robots still work at the previous range, the green zone is rendered at the same size, and the equipment grid GUI still shows the previous values. If you replace a roboport with one that has a lower robot_limit the GUI in the equipment grid does update, but the robots are still happily swarming around at the previous limit.
What?... all of what you're saying is wrong.

take() and put() does update the parameters. It does update the radius. It does update the robot count limit and the green zone is rendered correctly immediately. The GUI also updates to show the current values.
If you want to get ahold of me I'm almost always on Discord.
mknejp
Fast Inserter
Fast Inserter
Posts: 154
Joined: Wed Apr 27, 2016 8:29 pm
Contact:

Re: Personal roboport parameter update

Post by mknejp »

Ok, I may have written this without doing some extensive testing, but this screenshot proves not all of what I've said was wrong:
roboport-1.png
roboport-1.png (1.21 MiB) Viewed 1819 times
The radius is shown as 0x0 in the grid and yet there are robots flying around doing their job. It doesn't matter if robots are already out or not when I do the switch.

I did a bit of testing and it turns out if I change only the radius then it doesn't update. This one here uses a replacement with a 10x10 radius. The tile grid clearly shows the radius is still 30x30
roboport-2.png
roboport-2.png (853.68 KiB) Viewed 1819 times
The replacement has to change *both* the robot_limit and construction_radius for the update to take place. This is in 0.14.5. So I guess we can disregard the update_parameters() request and just handle this as a bug?
Rseding91
Factorio Staff
Factorio Staff
Posts: 14913
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Personal roboport parameter update

Post by Rseding91 »

Ah yes it's only looking if the robot count or charging count changed. I'll fix it for the next version of 0.14.
If you want to get ahold of me I'm almost always on Discord.
mknejp
Fast Inserter
Fast Inserter
Posts: 154
Joined: Wed Apr 27, 2016 8:29 pm
Contact:

Re: Personal roboport parameter update

Post by mknejp »

Thanks and sorry for not doing my fair share of testing before posting.
Post Reply

Return to “Implemented mod requests”