Prioritize player requests along with other requests

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

Post Reply
factoriouzr
Filter Inserter
Filter Inserter
Posts: 660
Joined: Sat Jun 06, 2015 2:23 am
Contact:

Prioritize player requests along with other requests

Post by factoriouzr »

When all my logistics robots are kept busy, nothing in my trash slots seem to be removed and maybe nothing is brought to me either. It seems like there is some queue algorithm for the regular chest stuff, but it seems the player is left out of that rotation. I suggest the player is also prioritized along with the other logistics network stuff.

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12888
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Prioritize player requests along with other requests

Post by ssilk »

It is indeed a queue-problem that is hard to see/understand and I agree into that direction, that we need a game-mechanic, which enables the player to see this kind of problem, cause it could have different causes.

In general I would also say, that it is a bad idea to have one robo-network with too much orders: They enlarge the orders-queue in such a way.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

factoriouzr
Filter Inserter
Filter Inserter
Posts: 660
Joined: Sat Jun 06, 2015 2:23 am
Contact:

Re: Prioritize player requests along with other requests

Post by factoriouzr »

ssilk wrote:It is indeed a queue-problem that is hard to see/understand and I agree into that direction, that we need a game-mechanic, which enables the player to see this kind of problem, cause it could have different causes.

In general I would also say, that it is a bad idea to have one robo-network with too much orders: They enlarge the orders-queue in such a way.
I don't know what you are saying.

Consider the following:

1) The game already has this issue.
2) You can already see this issue by hovering your mouse over any chest, or any roboport and you will see your available logistics robots hovering around 0. You don't need to make this more obvious to the player by annoying them and not fulfilling their requests
3) you can use all your logistics robots regardless of the player and the game still works and robots still bring the goods to where they need to go in a queue order. I bet every logistics request is in a list in memory and as soon as a robot is done with a task, it checks the next item in the queue and assigns itself to that task. Then that request is removed if it will be completed or moved to the bottom of the queue if it needs more items so that it will wait it's turn again.
4) the player requests should be part of that queue process

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12888
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Prioritize player requests along with other requests

Post by ssilk »

Hm. I think now I understand, you want two queues - one like now, the second for players with a higher prio.

<shrug> Maybe it solves the problem. :) The problem is, that I cannot explain the problem I have in mind. :)
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

factoriouzr
Filter Inserter
Filter Inserter
Posts: 660
Joined: Sat Jun 06, 2015 2:23 am
Contact:

Re: Prioritize player requests along with other requests

Post by factoriouzr »

ssilk wrote:Hm. I think now I understand, you want two queues - one like now, the second for players with a higher prio.

<shrug> Maybe it solves the problem. :) The problem is, that I cannot explain the problem I have in mind. :)
Actually I was going to suggest that, as prioritizing the player would be great, but I didn't mention that because it might be ok if the player is included in the queue. I'm fine with just one queue as long as the player is given equal weighting as all the other requests.

In the end I think giving the player more priority would be great but i'm fine as long as the robots still bring and take things from the player when they are all busy. Perhaps it works like this already, but I ran into this lots of times and several times I waited for like 1 minute or more (checking back) to see if anything was taken out of my trash slots, but it seems like it wasn't. Perhaps I just didn't wait long enough or I had more items to trash and didn't notice so the amount just kept getting filled up automatically.

fregate84
Fast Inserter
Fast Inserter
Posts: 233
Joined: Sun Jun 22, 2014 10:56 am
Contact:

Re: Prioritize player requests along with other requests

Post by fregate84 »

Agree. Add a option to Prioritize things can be good thing. And we can add a 3rd element on the list : construction robot.

Because actually, when a item are missing, construction robot are not Prioritize. So sometime you should wait 10 min to build a blue inserter, because logistic robot move faster all inserter to a chest to do purlple inserter.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13171
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Prioritize player requests along with other requests

Post by Rseding91 »

The player acts like any normal requester chest in the logistics network - there's no special logic involved - it's literally the same code that fulfills normal requester chests that fulfills the player requester chests.

Making it work otherwise would waste CPU time sorting and checking needlessly. The real answer is: build more robots and increase production so they can fulfill the requests of everything.
If you want to get ahold of me I'm almost always on Discord.

factoriouzr
Filter Inserter
Filter Inserter
Posts: 660
Joined: Sat Jun 06, 2015 2:23 am
Contact:

Re: Prioritize player requests along with other requests

Post by factoriouzr »

Rseding91 wrote:The player acts like any normal requester chest in the logistics network - there's no special logic involved - it's literally the same code that fulfills normal requester chests that fulfills the player requester chests.

Making it work otherwise would waste CPU time sorting and checking needlessly. The real answer is: build more robots and increase production so they can fulfill the requests of everything.
So you are saying that the player requests and player trash slots are prioritized in order with every other logistics and construction requests, so that there is no starvation?

If that's the case then that's probably good enough. In my testing this didn't seem to happen, but maybe the other requests were so overwhelming that they never got around to the player.

How are these things queued up? Let's say a requester chest wants 10 iron plate and is empty right now, and logistics robots deliver 1 good at a time. Do 10 things get added to the request queue or one thing for 10 items and as soon as 1 item is assigned to the robot, the request is moved to the bottom of the list and it's value is updated to 9? The reason I ask is that if 10 requests get inserted in this example for 1 chest, then this would easily bog down the network and take a long time to get to player requests. I suspect it's the second option I proposed with 1 request being added for 10 things that will move to the bottom of the list as soon as a robot is assigned to deliver even partial goods.

Although if what you say is happening and player gets equal priority, then that is likely good enough, it would still be nice to prioritize things in the following order:
construction robots:
1) repair
2) construction
3) deconstruction

logistics robots:
1) player requests
2) player trash
3) other logistics requests

Personally I think for logistics, equal weighting with the player is alright, not perfect, but good enough.

However for construction robots, I think the priority should be changed as I listed above. The reason is that if you issue a large deconstruction order for say lots of trees and rocks and you aren't being attacked, you don't care. You just let the robots queue up and eventually they will satisfy the order even though you have less robots then deconsturction orders. However if after you issued the order, and you might even be at the other end of your base, you get attacked, the robots won't prioritize repair and build above deconstruction. It would be nice if they did this. However the algorithm would have to prioritize deconstruction locally for where an item will be built before it issues the build order. But this would be based on location, not globally. Ie. I know why you prioritize deconstruction above building to avoid a deadlock where robots can't build because none are available to deconstruct the item in the way. However as I mentioned, I think it would be a good improvement if this happened per item. Ie when going to issue a build order, check if anything is in the way first, and if it is, then issue a deconstruct order first, else issue the build order.

fregate84
Fast Inserter
Fast Inserter
Posts: 233
Joined: Sun Jun 22, 2014 10:56 am
Contact:

Re: Prioritize player requests along with other requests

Post by fregate84 »

factoriouzr wrote: construction robots:
1) repair
2) construction
3) deconstruction
not agree. deconstruction MUST be before construction, because you will get stuck if you need to much robot. Need to deconstruction tree before construction on the place... offen, we deconstruction a big peace of factory to construction a other things on the same place.
For a chech for exemple, need to empty it. It can take lots a robots.

onebit
Long Handed Inserter
Long Handed Inserter
Posts: 97
Joined: Mon Feb 02, 2015 4:32 pm
Contact:

Re: Prioritize player requests along with other requests

Post by onebit »

I don't see how you would you get stuck?. There's a finite amount of things so it doesn't matter if construction/deconstruction happens first. It'll eventually all get done.

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12888
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Prioritize player requests along with other requests

Post by ssilk »

It's more clever to deconstruct first: A construction bot, that wants to place an item needs otherwise to wait, until the to-be-destructed entity is removed before he can place it. If this waiting time is too long he needs to return to a roboport to recharge.
I've found me in situations where I wanted to build solar-arrays into forrests and only 10% of the bots did reconstruction, while the rest of the bots wanted to construct which resulted in incredible long waiting queues at the roboports.

Similar problems are with
- roboports (no roboport, no robot-area)
- poles (no power, no powered roboport, no robot-area),
- inserters (placed too early bring items onto wrong side of complex belt constructions or tries to insert useless items into a ghost-assembly)
- circuits (placed in the wrong order will initialize wrong)
- and a lot more of such simple looking issues.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

factoriouzr
Filter Inserter
Filter Inserter
Posts: 660
Joined: Sat Jun 06, 2015 2:23 am
Contact:

Re: Prioritize player requests along with other requests

Post by factoriouzr »

fregate84 wrote:
factoriouzr wrote: construction robots:
1) repair
2) construction
3) deconstruction
not agree. deconstruction MUST be before construction, because you will get stuck if you need to much robot. Need to deconstruction tree before construction on the place... offen, we deconstruction a big peace of factory to construction a other things on the same place.
For a chech for exemple, need to empty it. It can take lots a robots.
I already addressed this in my comment you are replying to if you just read it:

"However the algorithm would have to prioritize deconstruction locally for where an item will be built before it issues the build order. But this would be based on location, not globally. Ie. I know why you prioritize deconstruction above building to avoid a deadlock where robots can't build because none are available to deconstruct the item in the way. However as I mentioned, I think it would be a good improvement if this happened per item. Ie when going to issue a build order, check if anything is in the way first, and if it is, then issue a deconstruct order first, else issue the build order."

User avatar
GlassDeviant
Fast Inserter
Fast Inserter
Posts: 170
Joined: Wed Feb 11, 2015 1:51 am
Contact:

Re: Prioritize player requests along with other requests

Post by GlassDeviant »

What you are asking for, by prioritizing construction before deconstruction then altering the priority when construction of an entity requires local deconstruction to happen first, is adding unnecessary load to the process. By prioritizing deconstruction over construction, the KISS (Keep It Simple Stupid*) principle is applied by default, preventing unnecessary event handing logic from complicating the code and bloating the queue.

* This doesn't imply that anyone is stupid, read the wiki article on the KISS Principle for clarification.
- GD

Sorry if my posts are becoming difficult to read, my typing ability is rapidly deteriorating due to a nerve disorder. I try to clean them up before posting but don't always get every last typo.

mattj256
Fast Inserter
Fast Inserter
Posts: 203
Joined: Sun Mar 27, 2016 7:25 am
Contact:

Re: Prioritize player requests along with other requests

Post by mattj256 »

Rseding91 wrote:The player acts like any normal requester chest in the logistics network - there's no special logic involved - it's literally the same code that fulfills normal requester chests that fulfills the player requester chests.
I'm surprised to hear it works this way.
Rseding91 wrote:Making it work otherwise would waste CPU time sorting and checking needlessly.
It should be possible to prioritize requests using a deque or maybe a binary heap. I don't see how there would be a large performance penalty. Meanwhile, we're talking about an improvement to something that already works so I understand if this is too much time and effort for not enough benefit.

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12888
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Prioritize player requests along with other requests

Post by ssilk »

mattj256 wrote:I don't see how there would be a large performance penalty.
Lack of knowledge doesn't protect from informing yourself... :)
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

factoriouzr
Filter Inserter
Filter Inserter
Posts: 660
Joined: Sat Jun 06, 2015 2:23 am
Contact:

Re: Prioritize player requests along with other requests

Post by factoriouzr »

I ran into this issue in my current game 0.14.19 where I have over 600 logistics bots and they don't seem to take anything from the logistics trash slots even after waiting for a while. Perhaps they just don't get around to it, but somehow the queuing mechanism for logistics requests seems wonky. I have an active provider chest as well loaded up with stuff that was sitting there for minutes if not an hour or more and it didn't get emptied while the goods being produced got many many cycles of dropoffs and many repeated goods got produced. Perhaps the active provider was slowly emptying, but from empirical observation the whole fairness in logistics requests seems to be biased towards non-player and non-active provider chests when the robots are completely busy.

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12888
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Prioritize player requests along with other requests

Post by ssilk »

If you feel it is wrong then please make a bug-report. :)
But it makes no sense to make just not so good suggestions about not understood game-mechanics. Sorry.

BTW: Once I had a similar issue, cause I had thousands of trees marked for removing, but the bots could not reach them. The queue needs about 3 minutes (one entry per tick) to go through the list of entries before the "real work" was found.

viewtopic.php?f=23&t=5653
viewtopic.php?f=29&t=5655
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

Post Reply

Return to “Ideas and Suggestions”