Top AI annoyances in alpha9

Started by b0rsuk, March 05, 2015, 10:28:54 AM

Previous topic - Next topic

b0rsuk

I'm a new Rimworld player, but I think I noticed some areas where AI could be improved. If there's an easy solution to my problems within the current system, let me know.

1. Colonists leave harvest on the field

It typically goes like this: when crops are ready to harvest, colonists arrive, harvest them, then get tired or bored, go home. They come the next day, finish harvest, then immediately start replanting. Another day passes, and finally they come and haul the harvested food to the stockpile.

I can micromanage them to work more efficiently - once colonist wants to rest or eat, I order him to prioritize hauling corn/potatoes to stockpile Which is close to bed and kitchen, so it barely adds an extra work for them. Then they don't have to come another time just to haul 75 food.

I don't know how can I set them to act in a similar way. Hauling has a lower priority than growing. I could designate dedicated haulers, but these have so much to do anyway, and it's hard to predict when they will prioritize harvest. I would probably have to stop all other work (hauling chunks, construction materials, corpses to graves) to make sure that they fill the fridge before food spoils a bit or wild boars have their way with it.

I could use manual priorities, and place hauling higher than growing, but then they will wait with plant work until every last unforbidden item on the map is taken care of. And then I must be extra careful with unforbidding anything.

Any ideas ? I'm going to try the manual priority thing, and be very careful about unforbidding loot / designating chunks to haul. All I want is colonists not going home with empty hands.

I think the tradeoff here is "have fridge filled earlier" vs "have new crops maturing earlier". I think it's more sensible is to care about the state of the fridge. When I know how much food I already have available,

2. colonists being short-sighted when taking materials for constructions

You tell them to build a wind turbine, some conduits and a battery. The first goes to your miners to take 75 steel for battery. Another does the same for turbine.  The third one just takes 6 steel for the conduit, and leaves 69 steel nearby. Steel he could easily carry without much extra work.

Here's an idea:
- if a colonist goes to take resources for a construction, and the resources are outside stockpile, don't take just a handful of them. Try to take 75. Leave the excess resources at construction site. It's more efficient and I often do this manually prioritizing. In the worst case there will be 69 extra steel where I wanted to build a power line. But that is likely to be closer to stockpiles and construction sites, so when another colonist wants to build something, or a hauler comes by, there's less work.

I think both would be good AI optimizations.

Boboid

Quote from: b0rsuk on March 05, 2015, 10:28:54 AM
1. Colonists leave harvest on the field

If Growing and Hauling are set to the same priority your colonists will do all the growing first as it is further to the left ( IE: higher priority ) on the list, THEN do the hauling.

Just don't go around un-forbidding everything on the map and you'll be fine. My suggestion is set Hauling(and growing!) to be quite a high priority and if you need to haul things that are some distance from your base, do it in chunks.
A prison yard is certainly a slightly more elegant solution to Cabin Fever than mine...

I just chop their legs off... legless prisoners don't suffer cabin fever

RemingtonRyder

Having a dedicated hauler or two, even temporarily, isn't a bad idea. It will clear that backlog of stuff laying on the ground.

Monkfish

For your first issue, set your food storage area(s) to a higher priority than the other areas. This isn't fool proof (I'll get to that in a sec) but is fairly reliable, especially in a large colony where you can have dedicated haulers. What I typically do is set my growers to also be haulers (same priority), so that once they've completed harvesting and sowing the plants, the produce (which stays fresh for a few days) gets hauled to the freezer.

My gripe with hauling priorities is largely that colonists seem to pick items going to the highest priority stockpile out of the ones that are closest (as the crow flies) to their current location. In most circumstances this would work, although it sometimes has the result of low priority items (such as chunks and apparel) being hauled before high priority items (such as food/corpses) simply because the lower priority items are much closer.

For your second issue/point, that is an annoying trait and you've come up with a good suggestion to fix that. An alternative (and this only really works if you have at least one dedicated hauler) is to set a metal/resource stockpile with a high priority so that your hauler fetches the metal rather than your construction bods.
<insert witty signature here>

b0rsuk

You have some interesting ideas for solving the first issue. But neither of your ideas fixes the problem of colonists walking home with empty hands. Mining, growing lose efficiency because of this.

Boboid

Growing/Hauling set to the same priority is your best bet. You can't stop colonists from going to bed with empty hands, that's just not possible.

All you can do is ensure that when they're done harvesting, they immediately haul the results. ( assuming no higher priorities )

Mining is pretty much in the same, in both cases the higher priority job (which in this case is Mining/Growing due to their inherent position on the priority list) has to be COMPLETED before they'll haul, if it's not done (And this typically happens when your colonists want to sleep) and something else comes up, then they're just going to leave that stuff on the floor.
A prison yard is certainly a slightly more elegant solution to Cabin Fever than mine...

I just chop their legs off... legless prisoners don't suffer cabin fever

Monkfish

There will always be inefficiencies when colonists can be sidetracked at any moment due to higher priorities. All part of the fun to make them manageable. The alternative would be to implement the action/hauling you see with cooking and that would be even worse, plus I imagine it would be impossibly complex to code "if you're going by this way, do x" into the stock management.

I can't say I have issues with hauling management aside the odd derpy AI quirk (you know, going around a wall to get something 2 squares away instead of that thing 3 squares away in the same room, that sort of thing) and I suppose no one solution would work in all cases due to the dynamic nature of colonies/colonists, so I suppose there are only really golden rules to follow (which I take to be given, but I'll list them anyway in case they help) to help keep things running smoothly;

- Dedicate stockpiles to certain items. For example, your food should go into a chilled (below zero) storage, whereas chunks can be left outside.
- Keep dedicated stockpiles near to their source or areas of use to avoid excessive walking. Efficiency is key. Your cooks can produce meals much faster if the food storage is a few blocks walk away.
- Set priorities for your stockpiles based on their urgency (which is up to you and can be situation driven). For example, you may want food items to be hauled first due to them going off. Bear in mind that graves, if you use them, have a default priority of "important" so any stockpiles with "critical" priority will be hauled to first; not good if you happen to have dead bodies casually laying about the place.


And now, another gripe I have just be reminded of;

AI Targetting
Firing colonists, drafted or otherwise, fire at their targets regardless of what is in the way, which is usually another colonist wandering about in the firing line doing something else. As Rimworld is set in a parallel universe where everyone has the shooting ability of Stevie Wonder with Parkinson's and Epilepsy, said wandering colonist often absorbs more bullets than the intended target due to the stupendous bullet spray.

It gets a bit annoying after a while.

Not sure how to fix that without it resulting in ranged colonists not shooting at a fustercluck of colonists and raiders brawling it out, unless it ignores drafted colonists. As to how, my thought would be to use the line-of-sight check to see if a colonist is in the way and pause the aiming cooldown if the target is blocked. That should help prevent randoms out collecting bricks from collecting bullets as well.

In the meantime, I'll keep the doctor on standby.  :-X
<insert witty signature here>

lusername

#7
Quote from: Monkfish on March 05, 2015, 07:14:03 PMI imagine it would be impossibly complex to code "if you're going by this way, do x" into the stock management.
No it wouldn't. If this weren't an unfinished alpha subject to massive change, I would already be coding this even if I had to hack it directly into the assembly with ildasm/ilasm. It is not impossibly complex to code. All you have to do is check "I am going from here to there, is there a job I can perform that will take me from here to there which doesn't increase my path cost by more than some threshold?".

It is quite simple to code and I have already done such a thing for the Sims games.

Quote from: Monkfish on March 05, 2015, 07:14:03 PMNot sure how to fix that without it resulting in ranged colonists not shooting at a fustercluck of colonists and raiders brawling it out, unless it ignores drafted colonists.
This behavior seems correct to me. If you're a soldier in a trench and the enemies have assaulted your trench and are engaged in melee combat with a fellow soldier, you don't wildly fire into the fray unless you're reasonably sure you can hit your target without causing unacceptable levels of damage to your own. Since the chance of hitting your target and the chance of hitting an ally on a miss are all known quantities that the game can already determine, the only thing left here is to compare these chances to a threshold for acceptable levels of friendly fire.

DNK

Friendly fire definitely is high on the list.

Second is pawns ignoring something attacking them. They'll just keep hauling while a squirrel bites off their leg. There needs to be more of an automatic response defense.

Lochar

I noticed this type of behavior for cooking as well. Altho not sure of an easy way to fix as I don't program.

But in my scenario, its more of need 10 items for cooking so go looking for it, even if have to go a small distance and pick up 10 plants, even tho there a bunch laying around, makes cooking time consuming unless I intervene and order them first to haul plants first then they will pick up full batch and then go back to cooking.

Boboid

Lower the search radius on the cooking bill and give them a nearby stockpile with a higher priority than your storage/overflow stockpile.
A prison yard is certainly a slightly more elegant solution to Cabin Fever than mine...

I just chop their legs off... legless prisoners don't suffer cabin fever

tommytom

@#2
The problem is the constructors are prioritizing construction, not hauling. Even funnier is constructors that can't do "dumb labor" can actually haul construction materials as long as they are constructing it.

The fix would probably be setting haulers to haul materials and constructors doing the constructing, but it would be equally or more infuriating to have no haulers or them having other haul jobs as a priority as well as constructors doing other jobs waiting for that material to be hauled and then traversing the map to construct it instead of the person that hauled the materials constructing causing two trips to long-distance constructions.

Lochar

Quote from: Boboid on March 08, 2015, 01:29:23 PM
Lower the search radius on the cooking bill and give them a nearby stockpile with a higher priority than your storage/overflow stockpile.

So if I lower the radius to just the higher priority stockpile but its empty what then happens? they switch to hauling mode until that stockpile has product? will have to try that.

Boboid

#13
Yep that's how it ought to work assuming that the colonist doesn't have another higher priority, ideally that stockpile will never empty, food turnover is often very high so colonists naturally handle it very frequently meaning they'll often already be hauling it ergo they'll place it on the cooking stockpile.

Also any haulers will actively try to top up that stockpile. And as you said the cook will likely switch to hauling when he can't cook increasing the amount of manpower that could potentially switch your cook back on.

It will also massively increase the speed at which you cook meals, especially if you assign that bill to simply drop the meals on the floor rather than hauling them to a freezer. Anyone can haul, but only your cooks ought to cook.
A prison yard is certainly a slightly more elegant solution to Cabin Fever than mine...

I just chop their legs off... legless prisoners don't suffer cabin fever