[request] "bring that with you on the way over" (is this idea feasible?)

Started by stigma, July 06, 2017, 02:55:41 PM

Previous topic - Next topic

stigma

I'm just airing an idea here, but I think that what a lot of players get frustrated with in Rimworld has to do with hauling being done in stupid ways.

PROBLEM:
Just as an example, Bob is set to mine, so he goes out and mine 100 steel. Job done.
Now he has cooking to do, so he heads back to base... but he does't bother to carry any of the steel back with him even though the cooking bench is right next to the stockpile. Instead, Alice who has a high priority on hauling has to run all the way out to the mine to pick up the steel - essentially a whole roundtrip wasted because Bob didn't have any common sense.

SUGGESTION:
When any new job A (any type) starts:
If this pawn has hauling enabled (any priority):
check X tiles radius around current location - is there anything set to haul here?
if yes: check if the destination for job A with X tiles radius and see if any of those hauling items are supposed to go there. If yes, choose the item with the least walking distance and haul it first, and queue the original job A to be done immediately after.

- Ideally, make radius X configurable in UI - but a value in XML would be fine too.

- Consider excluding the check for the most obvious emergency-jobs where every second counts - like firefighting.

- Keep radius X fairly low to avoid annoying over-emphasis on the added hauling. Only do it when you don't really have to go much out of your way.

- A more advanced implementation would consider the path to job A and not just the destination tile for it, so that hauling with a drop-point along the way could also be done efficiently, but this no doubt requires considerably more logic.

My thinking is that this should result in more intelligent and efficient use of time and basically get more hauling done almost for free since pawns will carry stuff around while they are doing all their other stuff and running around like ants anyway...

Is this feasible you think? I've seen a lot of tweaks to hauling so far, but nothing that tries this aproach of considering it in the context of other work that is being done.

-Stigma

historic_os

I've been recently thinking of working on a mod doing just that, some "while you are at it" mod that will look for an hauling job around on the way to the next job. but dropped it for now in favor of another project.
possible? yep, you'll need to track the pawn job queue and inject hauling jobs before the next job.
my idea was adding hauling job if there is something haulable within a set range from the pawn and if there's a"best stockpile" for the item within a range from the destination or a distance at any point of the path.

would be really nice to have, hope someone will take this project

skullywag

This is deffo doable but i feel itll be a bit of a resource hog.
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

stigma

Quote from: skullywag on July 07, 2017, 03:22:07 AM
This is deffo doable but i feel itll be a bit of a resource hog.

What's the most expensive operation involved? The tile-searching?

-Stigma

Mehni

Britnoth's WorkFlex does something this, sorta. Definitely worth taking a look.

stigma

Quote from: Mehni on July 07, 2017, 02:50:32 PM
Britnoth's WorkFlex does something this, sorta. Definitely worth taking a look.

I have already looked at that, and used it to test, but ultimately decided that the implementation was too basic and prone to problems (it was his first mod so I'm not complaining or anything).
This request is sort of an attempt at a better implementation based on that idea actually.

Workflex is really simple to explain - before any normal priorities there is a duplicate layer of all the priorities list that runs first (but only at X tiles - 12 by default but adjustable). So essentially, any work no matter what type (as long as enabled at all) will be done first.

Although this results in efficient work in many cases (especially hauling) since pawns tend to run around long distances between work less - it also very easily results in critically important priorities being ignored, and that is just unacceptable to me since it means I can no longer "trust" my pawns to get the most important stuff done. I suspect that this only gets worse the later in the game you get and the list of potential jobs grows and correct prioritization becomes more essential.

Inherent problems exist in "unending" jobs. Anyone who starts to research will be unlikely to stop for example.

The only control mechanism workflex has is through scheduling. Any pawn currently on "work" time will ignore workflex priorities - so the only way to make sure your doc/warden doesn't get stuck cleaning or researching and forgets to do feeding and caring as an example is to force periods of "work" and then sort of just hope that this gets enough critically important priorities done - and in a timely fashion.

A workflex with better control mechanisms and the ability to choose the jobs evaluated for workflex priority would be pretty good and solve a lot of issues. This idea focues on hauling spesifically because I feel that is where 90% of the efficiency gains come from anyway - and it also tries to take the intelligence up another step.

Ultimately an improved workflex and this idea could probably work together in a complementary fashion because they come at the problem from different angles. Britnoth did mention that he may try to make an improved version sometime in the future, so I will be looking out for that :)

-Stigma