Ludeon Forums

RimWorld => General Discussion => Topic started by: Leroy76 on July 31, 2016, 12:31:58 PM

Title: Frustrating AI/behaviour and micro management
Post by: Leroy76 on July 31, 2016, 12:31:58 PM
As of now the game has several issues related to the AI and needs of the colonists. This often leads to the impression that you are actually leading people who somehow have escaped from a madhouse, with everybody having serious psychological problems. There also other problems but I will focus on AI and behaviour because this creates a lot of unncessary micromanagement and even hopeless situations.

AI problems

Ineffcient work and walking

Two hours before sleep a colonist walks all over the map, hits a rock 1 time and walks back. If there is stuff arround from previous work and which should be transported to the base, he will just leave it there. This last point is most annoying: If a miner has done his work, instead of taking the ressources back to base, he just leaves them there until next time or somebody else carries them away. If a colonist can carry items and nearby are items he could transport with little to no diversion, he should do it. Also there should be taken into account the required time of walking to destination, if it also clear that no a decent amount of work can be done or the destination can not be reached in the remaining time until sleep, it should not be performed, unless the work time has just started.

Breaking tasks

When performing a task, especially when explicitly orderd to do it by the player, the colonists should perform it for a reasonable amount of time. Currently, if the colonists is orderd to let's say clean up the blood in the hospital room, he should finish that and not go sleeping after he cleaned one tile or getting a breakdown because dinner is delayed. If he is tasked to build conduit, he should at least finish a decent amount of it and not again just one tile. The same applies to mining and seeding, bascially everything that involves a number of tiles or limited area. And in case of fire, they should continue until the fire is gone or the colonists are dead or had to leave because of compelete exhaustion. Where complete exhaustion does not mean lunch have been missed or he will come to bed 2 hours later than usual, it should be a reasonable threshold.  Also as this is an emergency, all other needs are canceled out during that time. To survive the fire his the highest and only priority, so it doesn't matter if the surroundings are ugly, the clothing is bad or they hate their fellow who is also tasked to put out the fire.

One approach of this problem  could be that a minium amount of work units must always be performed befor task can be interupted and this in a certain range from where the task has been started. If the colonists is orderd by player manually, the minium work units value should be higher. In case of fire, there should be no limit.


Behaviour problems

The colonists apparently have no will to survive, their needs have higher priority than survival. The is a fire right on the next room? - I don't care, because I am hungry, so I need to eat first and than I'll go play this horseshoe game!
Not that anybody would even wake up if there is a fire. Even if you wake one up and order him to extinguish the fire, he may only extinguish one tile and than go back sleep while the fire grows and grows, as mentioned in the "breaking task"-problem.

Refusal of basic work: If you end up starting with colonists who refuse "simple work" - you are proablly screwed. I mean imagine that, they've just crashlanded maybe in a very hostile environment and the people just stand there because they refuse to carry stuff to the next shelter. That's just ridiculous. Yes, you can prevent that by hand-picking colonists but the point is, it's still impossible that even one would reject to help by carrying stuff.

Unordered priorities of needs:

usually there should be a priority that will cause somebody to act accordingly. A raw order could be like that:

- response to immidiate threats (attacks, fire, earthquakes etc.)
- water
- food
- shelter
- luxury needs (own room, fresh beer, a TV whatever)

Currently, if somebody missed the lunch because waiting some hours too long on battle field, he may just drop his weapon and run into the enemy and gets killed by them or friendly fire - and all because there was no time for lunch, it was too cold, too dark, his clothings are bad, he had to sleep in the same room as everybody else or the sandbags arround were just too ugly! Not gonna happen, never! It's ridiculous and very frustrating. What would be more understandable is if somebody flees from the enemy because an opponent just throw a grenade right next to them or close friends were ripped to pieces. Fear can be a strong emotion, the cancels out everything else. But not "this room is too ugly"! So in conclusion, other than said fear nothing else should have an impact on colonists in battle mode and/or during an attack or right before that. Actually not in any emergency case. Well if they were standing arround for days without food and sleep, they would have physical break down logically.

On the other hand while beeing such a sissy in so many regards, the colonists have no problems to for example feast on a fresh human corpse. How many people that you ever knew or heard of would do that?   

My suggestion: get rid of this "low expectations"-hack and throw in needs dependending on the wealth and size of the colony. If there are 20 other people, well yes, I then might refuse to do cleaning or carry things. If we have many rooms, I want my own. If we have enough food to survive and it's currently safe, well then some entertainment stuff would be nice.
Title: Re: Frustrating AI/behaviour and micro management
Post by: StormySunrise on July 31, 2016, 12:44:12 PM
Using the manual order features in the work tab allows you to prioritize the firefighting , another easy way to get them to work what you want is quickly enlisting and unenlisting the colonist so it prioritizes the nearest task. Some mods also may help you with your "refusal to work" HaulT is one such mod. However, whenever a disaster happens it usually takes a while for people to adjust to their situation so they stick to what they are used to (individual rooms etc etc) but as I stated before some mods can help you out, I believe there is a mod that makes colonists prefer sharing bedrooms but im currently drawing a blank.
Title: Re: Frustrating AI/behaviour and micro management
Post by: Leroy76 on July 31, 2016, 02:07:06 PM
Quote from: StormySunrise on July 31, 2016, 12:44:12 PM
Using the manual order features in the work tab allows you to prioritize the firefighting , another easy way to get them to work what you want is quickly enlisting and unenlisting the colonist so it prioritizes the nearest task.
That is not the problem, the problem is that they put their needs over a critical task like fire fighting. Sleeping, eating etc. are not tasks that can be given a priority.

QuoteSome mods also may help you with your "refusal to work" HaulT is one such mod.
I already can work arround it without mods by checking this when starting a new game and new colonists. It's a flaw in the game, the people refuse to carry things right from start of the colonly. It should simply not be possible. But it would be fully accepable if that trait becomes active once a basic camp is established and there are more colonists who actually can do simple work.

QuoteHowever, whenever a disaster happens it usually takes a while for people to adjust to their situation so they stick to what they are used to (individual rooms etc etc) but as I stated before some mods can help you out, I believe there is a mod that makes colonists prefer sharing bedrooms but im currently drawing a blank.
That's also not what was meant.  If they don't want to share bedrooms, fine - but not as long as there is only one cave that have managed to find in the first days, it doesn't make any sense. It's also not a big issue if in some cases would have to order them to extinguish a fire, the anoying point is again that they put their needs over everything else and just stop working after doing one tile. So I've have to create a new zone, lock the doors or uncheck any other job to force them to complete the task. But even then if they want to sleep, they just fall down on ground and sleep right next to the fire. And before I can even do something that get more negative things added: "disturbed in sleep", "slept on ground" and what not. In combination with hunger due to delayed meal, tight rooms, too hot/cold and the omnipresent "ugly enviroment" you may get instantly a breakdown. And the fire is still burning. This also makes no sense. It's a mixup of needs of different priorities, tasks and behaviours.
Title: Re: Frustrating AI/behaviour and micro management
Post by: Britnoth on July 31, 2016, 03:50:02 PM
QuoteThat is not the problem, the problem is that they put their needs over a critical task like fire fighting. Sleeping, eating etc. are not tasks that can be given a priority.

Firefighting and emergency doctoring is considered 'emergency' work, and is done before any needs such as eating and sleeping (unless the pawn is actually starving).

I can only assume you have removed them from their allowed work.

QuoteIt's a flaw in the game, the people refuse to carry things right from start of the colonly.

Given that by default most pawns can haul and only some refuse to, I would think it is an intended part of the game. Learn to make best use of your colonists, rather than complain if they are not all 10+ skill in every discipline.

One recent game, out of 13 colonists only 4 could clean or haul, and one took a freak shot to the brain making him useful only for cleaning. It was not a serious problem, just a hindrance. Overcoming which is what this game is about.  :P
Title: Re: Frustrating AI/behaviour and micro management
Post by: Havan_IronOak on July 31, 2016, 04:23:42 PM
The quirk that distant pawns have of walking past piles of stuff that they just as easily have hauled back with them when the decide that they are tired has bothered me as well since my first play-through (around a8)

I do wish that it could be fixed but I'm guessing that there's a programmatic problem that Tynan can't easily solve that causes the AI to behave that way. Perhaps some day...
Title: Re: Frustrating AI/behaviour and micro management
Post by: Fusha on July 31, 2016, 07:28:55 PM
The AI could definitely do with some improving. I had a person decide that he wants to go "cloudwatching" adjacent to a raging inferno.
Title: Re: Frustrating AI/behaviour and micro management
Post by: Leroy76 on August 01, 2016, 09:39:01 AM
Quote from: Fusha on July 31, 2016, 07:28:55 PM
The AI could definitely do with some improving. I had a person decide that he wants to go "cloudwatching" adjacent to a raging inferno.
So apparently emergency work does indeed not have the highest priority. I will recheck this when I get my next fire.
Either way, it's just another outcome of needs having no priority, like not getting killed by an enemy can be less important than having no ugly sandbags arround.
Title: Re: Frustrating AI/behaviour and micro management
Post by: cultist on August 01, 2016, 10:02:49 AM
Are you using manual priorities or not? This is very important, because manual priorities give you the power to change the priority of critical tasks like sleep and firefighting. If you set i.e. cooking to a higher manual priority than firefighting and sleep, the pawn will cook himself to exhaustion while the kitchen burns down around him. This is intended, and the reason that manual priorities are not the default.

In general, I would not advise using manual priorities unless you understand exactly how they work, and even then only if necessary. The most efficient colony is one where each pawn only has one or two main jobs at most and enough free time to avoid joy depravation.

There is one more thing worth mentioning: Pawns do not constantly re-check their path bcause it's very resource intensive. When they travel long distances, their orders can sometimes get "outdated", meaning they may walk into danger that wasn't there when the order was originally given. This means that during crises like a fire or an attack (where the situation can change quickly), you should keep a close eye on all your pawns and pause often to check that they're not doing something stupid.
Title: Re: Frustrating AI/behaviour and micro management
Post by: Kagemusha12 on August 01, 2016, 10:17:48 AM
Quote from: Leroy76 on July 31, 2016, 12:31:58 PM
...

Refusal of basic work: If you end up starting with colonists who refuse "simple work" - you are proablly screwed. I mean imagine that, they've just crashlanded maybe in a very hostile environment and the people just stand there because they refuse to carry stuff to the next shelter. That's just ridiculous. Yes, you can prevent that by hand-picking colonists but the point is, it's still impossible that even one would reject to help by carrying stuff.
...

This is true.
Maybe someone who has a taboo on a task should still be able to be manually ordered by the player to do it.
(however, with a warning about the taboo)
But he would do the task very slow and/or inefficient and would get a mood debuff for it (like -10 for performing a task that he strongly dislikes)
Title: Re: Frustrating AI/behaviour and micro management
Post by: Listen1 on August 01, 2016, 10:22:43 AM
If you put a clear scheadule on the pawns programing, leave their Emergencies at 1, main task at 2, and their secundary task as 3, you may achive a control of your pawns. One of the biggest errors is leaving "anything" on all schedule, they will do some stupid things this way. Before "Sleep" I always put 2 anything and a Joy, after waking up also 2 anything. The rest is work.

But I also think that the Schedule system would need a little rework. I would love to schedule my pawns to clean their rooms before going to sleep. Why? Because at night one of my workers will clean the whole base before going to the other job. Sometimes this leads to disturbed sleep.

Title: Re: Frustrating AI/behaviour and micro management
Post by: Havan_IronOak on August 01, 2016, 11:09:26 AM
Quote from: Flying Rockbass on August 01, 2016, 10:22:43 AM
...I also think that the Schedule system would need a little rework. I would love to schedule my pawns to clean their rooms before going to sleep. Why? Because at night one of my workers will clean the whole base before going to the other job. Sometimes this leads to disturbed sleep.

Reminds me of a mod request that I made when work schedules were first added... a "Do Not Disturb" sign for bedroom doors. Or maybe just a necktie/sock like we used in college.   :D.
Title: Re: Frustrating AI/behaviour and micro management
Post by: eronaile on August 01, 2016, 01:01:57 PM
There's definitely a lot of rather stupid stuff going on when you keep an eye on your colonists for a while. I think one of the biggest (although possibly intended) flaws is that priority beats everything. If mining is set to 1, everything 'right' of it will be completely and totally ignored by the pawn until all mining tasks are done. It would be **MUCH** better to have a percentual system where 1-tasks are done most of the time, 2-tasks some of the time, 3 rarely and 4 almost never. This would ensure that you do not have to modify manual priorities so often (which I personally find is needed far more often than is comfortable) and that all tasks are done, albeit with different timings.

However to get back to the topic: absolutely agree that manual ordering should make the pawn work a sensible amount of time or 'steps' on the assigned task and not quit after 1 damn tile or whatever.
Hauling is a BIG problem, especially because if you set a pawn to high prio hauling, he'll never do anything else in all likelihood (with the millions of tons of stuff that needs to be hauled all the time). Once again the only thing that helps is to set all pawns to prio 1 hauling for a time, then switch back to 2-3. Annoying and unnecessary with a good AI.
BTW why do couples not automatically use double beds?

Also, I propose to let manual orders overwrite restricted areas. Heat wave especially needs this or else you have to enable and disable larger areas for every damn task that is outside your cooled room.

Hope AI gets buffed a fair bit in the future!
Title: Re: Frustrating AI/behaviour and micro management
Post by: Fusha on August 01, 2016, 01:39:09 PM
Quote from: Leroy76 on August 01, 2016, 09:39:01 AM
So apparently emergency work does indeed not have the highest priority. I will recheck this when I get my next fire.
Either way, it's just another outcome of needs having no priority, like not getting killed by an enemy can be less important than having no ugly sandbags arround.
The fire was outside the home area, so the priorities didn't matter. It was still an extremely silly thing to do.
Title: Re: Frustrating AI/behaviour and micro management
Post by: Britnoth on August 01, 2016, 01:41:40 PM
Quote from: eronaile on August 01, 2016, 01:01:57 PM
I think one of the biggest (although possibly intended) flaws is that priority beats everything.

Priority is a simple do this -> do this -> then do this for a good reason. Anything more nuanced is a lot more complex to learn for a new player.

"Why isnt anyone firefighting when I have priority firefighting at 1 and everything else at 2?"

"Why is someone firefighting on the other side of the map when I have cooking on 1 and firefighting at 2?"

etc etc.

I made a mod that tried to combine work priority with distance, and even knowing how it worked still resulted in the occasional unintended behaviour. Anyone new to the game using it would likely have had no clue why work was prioritised as it was without being given an indepth explanation - which the game isnt probably going to get in the form of a full tutorial scenario until it comes out of early access alpha.
Title: Re: Frustrating AI/behaviour and micro management
Post by: Sukha on August 02, 2016, 02:31:11 PM
At some point this game needs to stop the content updates and focus 1 update on AI.
Title: Re: Frustrating AI/behaviour and micro management
Post by: milon on August 02, 2016, 02:43:17 PM
I understand that most of you are coming from a "common sense" perspective, and I can appreciate that.

But have any of you ever coded AI?  Personally, the closest I've come is A* pathfinding, and my implementation was fairly CPU-heavy for one agent to trace one path.

RimWorld has dozens of AI agents (colonists, visitors, traders, raiders, animals, mechs...) all pathfinding simultaneously as well as doing other AI-intensive operations - job searches, locating materials, fulfilling needs, etc, etc.  RimWorld's AI is already quite impressive and streamlined.  I haven't seen the code, of course, but I doubt there's much more room for improvement (unless you want the minimum system requirements to be cutting edge PC's from 2020).
Title: Re: Frustrating AI/behaviour and micro management
Post by: Naeem on August 02, 2016, 04:23:30 PM
I understand were you coming from Milon or Milion sorry I didnt see your name properly. But sometimes the survivors just act so damn stupid. It makes me mad in some sense. But I know more coding will mean more work and more lag. But cant they be some way of fixing this [NON EXPENSIVELY?]
Title: Re: Frustrating AI/behaviour and micro management
Post by: eronaile on August 02, 2016, 04:55:04 PM
milon, while I have not personally coded AI, I assume comparison with other similar simulations will reveal quickly enough that yes, there is still quite a bit of improvement possible without straining hardware too much.
What was talked about above can be implemented by heuristic approaches that won't be perfect in a mathematical sense but pretty much indistinguishable from any player's POV.
We are not talking about whole new action/reaction patterns here. It's mostly about smoothing the edges. Hauling is a good example, it just needs some additional checks (check area nearby / check time requirements). Other stuff like direct orders should just get some area effect so that if there are identical tasks (like fires, plants to be removed, floor to be smoothed) in the tiles next to the targeted one, pawn continues with those.
The only thing requiring actual changes in movement decision by AI would be to improve pawns so they 'see' nearby hauling or other tasks more intelligently and do not go far far away before finishing identical tasks nearby. And since distance measuring is already in place it should be very simple to make them chose nearest first.

Title: Re: Frustrating AI/behaviour and micro management
Post by: Havan_IronOak on August 02, 2016, 05:48:12 PM
Quote from: milon on August 02, 2016, 02:43:17 PM
I understand that most of you are coming from a "common sense" perspective, and I can appreciate that.

But have any of you ever coded AI?  Personally, the closest I've come is A* pathfinding, and my implementation was fairly CPU-heavy for one agent to trace one path.

Tynan actually did a you tube video where he explained some of the difficulties. (though I can't find it now)

If it is still there and you watch it you may understand more about why some of the "silly behaviors" are happening.

I know that there WAS a mod updated for A13 that allowed you to crack open the priorities a bit by making things even more granular. (i.e. you could make Constructing a higher priority than deconstructing within the constructing tasks)

Personally I'd like to see folks understand more about using the ranges built into the production tables. Don't complain when your cook goes  halfway across the map to grab 5 muffalo meat (out of a stack of 75) because cooking is a #1 priority. Reduce the RANGE on the Range to a lower number. Then, if your cook has a #1 priority for cooking and a second #1 for Hauling with no higher priority intervening tasks your cook may well haul the full stack of 75 back to the freezer as you'd want them to. Course if there's other stuff that needs hauling that's closer...
Title: Re: Frustrating AI/behaviour and micro management
Post by: Juan el Demgrafo on August 02, 2016, 11:04:42 PM
Quote from: Havan_IronOak on August 02, 2016, 05:48:12 PM
(though I can't find it now)
Good video, I really liked it.
https://youtu.be/RMBQn_sg7DA (https://youtu.be/RMBQn_sg7DA)
Title: Re: Frustrating AI/behaviour and micro management
Post by: Kagemusha12 on August 03, 2016, 03:30:12 AM
Quote from: milon on August 02, 2016, 02:43:17 PM
I understand that most of you are coming from a "common sense" perspective, and I can appreciate that.

But have any of you ever coded AI?  Personally, the closest I've come is A* pathfinding, and my implementation was fairly CPU-heavy for one agent to trace one path.

RimWorld has dozens of AI agents (colonists, visitors, traders, raiders, animals, mechs...) all pathfinding simultaneously as well as doing other AI-intensive operations - job searches, locating materials, fulfilling needs, etc, etc.  RimWorld's AI is already quite impressive and streamlined.  I haven't seen the code, of course, but I doubt there's much more room for improvement (unless you want the minimum system requirements to be cutting edge PC's from 2020).

Hypothetically, if Tynan were able to code it in a way that relies heavily on matrix manipulations, CUDA would provide a way to speed things up by a great degree (by letting the graphics card solve the calculations).
Unfortunately this would only positively affect users of Nvidia cards as ATi/AMD cards don't support it
Title: Re: Frustrating AI/behaviour and micro management
Post by: Leroy76 on August 04, 2016, 07:03:05 PM
I just want to clear up some things:

First:

- The video was interessting, I also implemented A* several times but wouldn't dare to call that "AI". ;) And I think pathfinding works pretty good in the game.
- The range settings for producation tables are a good hint, hauling of only a few materials needed for the current task instead of a full stack is indeed another annoying thing.

Second:

I was not complaining about the priority system itself, it's actually pretty good. The problem with it is only that needs do not fit in this very well. Yes, I do use manual priorities, so usually switches and fire are priority 1 of everybody. The small issue here is, that priority 1 is green, so it would be nice to use that exclusively to mark the main task of a person instead to reserve it for emergencies. There should either be another priority level "critical" that can be used for fire or simply the option to be firefighter or not, there's no point to set priorities here. Even if there would be an action that has a higher priority like rescuing somebody this action would also be in the same "category" - emergencies. 

Back to the actual problem, the needs: If the life of the colonist is endangered, be it due to fire, an attack etc., everything else should stay back. As indicated, it makes no sense if you might die and get a nervous breakdown and actually do die only because there was no dinner or the current room is too ugly. It also can't be that one is ordered to extinguish a fire, does one tile and falls asleep on ground while the room is still burning.

As for the hauling, I see it like eronaile said, there should only be minor extensions to add at least some basic optimizations, like bringing back the stuff the colonists just mined when he wants to go home anyway. There is already a region/cell system in place as the video explains, maybe it can be used for this, like when a cell is entered and it contains things to haul and the planned path includes another cell that can accept these goods, take it. The target-check could be even removed, as the storages are usually in the main base ("home" zone) and therefore automatically nearby the point where the colonists wants to go to sleep or eat.

I think I will refine my points in a compact form a post some as suggestions.

P.S. The schedule that was mentioned here seems not to have much effect, at least my colonists take that only as recommendation at best. ;)
Title: Re: Frustrating AI/behaviour and micro management
Post by: Juan el Demgrafo on August 04, 2016, 09:23:22 PM
With the personal needs, perhaps set that as an outright priority as well, or/and also make a trait for putting needs like food or sleep always above priority one jobs?
Title: Re: Frustrating AI/behaviour and micro management
Post by: BigG on September 23, 2016, 05:32:48 AM
I think if there was an area wide priority command it would address one issue. Such as drawing a box around some rocks and right clicking 'prioritise haul these' or selecting some blueprint boxes and 'prioritise build these'.

Also the 'refuses to do manual work' could be changed to 'hates manual work' and a mood debuff when made to.
Title: Re: Frustrating AI/behaviour and micro management
Post by: Zhentar on September 23, 2016, 05:06:30 PM
Quote from: eronaile on August 02, 2016, 04:55:04 PM
milon, while I have not personally coded AI, I assume comparison with other similar simulations will reveal quickly enough that yes, there is still quite a bit of improvement possible without straining hardware too much.
What was talked about above can be implemented by heuristic approaches that won't be perfect in a mathematical sense but pretty much indistinguishable from any player's POV.

"Implement an efficient heuristic that is nearly indistinguishable from the ideal behavior" is generally programmer for "Spend an enormous amount of development time creating an extremely complex system that is difficult to understand and debug and creates a large ongoing maintenance burden".

That said, Tynan has said recently he would look into opportunistic hauling and maybe implement it. It wouldn't solve a lot of the annoyance but it would help with the particularly common miner heading back to base ignoring the products of their mining.


As for breakdowns in the heat of battle, what I think would be cool is if during the stressful incidents, pawns' mental break threshold was increased (that is, made less likely to break)... and then once it ends, the threshold swings in the other direction, making breaks even more likely in the already stressful post-battle environment. It would make the mental breaks a lot more realistic, without making the game easier or less prone to tales of disaster.
Title: Re: Frustrating AI/behaviour and micro management
Post by: iamthepenthief on September 25, 2016, 09:52:05 AM
Yea i get alot of resources being left away from storage. Steel, wood etc chopped down or mined and then just left for days to sit away from camp not counting as available resources.

I think that either hauling should be mandatory for all or it can be tasked in the time restrict table as a specific task outside of "Work"

Like "Gather" so that no matter what for atleast afew hours they will haul in the gear left around the map.

Or allow you to order haul on steel or wood or plasteel etc not just  chunks.
Title: Re: Frustrating AI/behaviour and micro management
Post by: Serenity on September 25, 2016, 09:55:45 AM
It would also help if you could prioritize individual items to be hauled. There is an A14 mod that does that, but it's not always reliable either in my experience.
Title: Re: Frustrating AI/behaviour and micro management
Post by: delheit on September 25, 2016, 12:12:50 PM
I agree with most of what the OP said but I have been trying to find a way to put it into better words. A lot of this games difficulty seems to come from frustrating micro management and not always actual challenge.

One example I think illustrates it very well is ordering someone to mine and having the colonist walk up and hit the block only once then walk away to eat. Or having an animal choose to rescue a colonist from the other side of the map preventing the colonist right next to the first from doing so.
Title: Re: Frustrating AI/behaviour and micro management
Post by: Havan_IronOak on December 01, 2016, 01:46:51 PM
One improvement in the AI that I'd like to see is to allow an optional "Haul After" parameter for tasks like harvesting, cutting & mining. Ideally the test would be performed if the pawn is choosing a new task that is NOT one of these.  e.g. Pawn finishes mining a compacted steel square. Checks his schedule and see's he's scheduled to sleep. Rather than leaving what he's mined, he hauls that back and THEN sleeps.
Title: Re: Frustrating AI/behaviour and micro management
Post by: Doc Savage NDMF on December 02, 2016, 02:43:08 AM
Most of the AI issues can be summed up in two words: Situational Awareness.

As in they don't have much...

A game is only as good as it's basic parts, it's foundation.

The AI in this game are not that bright. They do some incredibly daft things, they are not a good foundational element and game play suffers as a result. To hear the excuses as to why the AI can't do something so simple as "Hmm, maybe I should haul that rock back to the camp instead of making Sandy come all the way out here to haul it tomorrow" doesn't hold water when compared to the complexity of other game mechanics.

To watch a pawn hunt by walking past it's prey as far away from camp as possible and then place it's back to a wall ensuring there's no escape when the animal decides the hunter looks pretty dang tasty just hurts. Watching your pawns flee INTO the threat to get shot/mauled/hurt is just mind numbing.

And then there's the whole prison yard mentality and the beating up a woman because she wouldn't put out. In the future we're all ex-cons and savages..? How did we ever cooperate enough to build the ship to get into space..? The pawns in the game would have started a turf war and burned the thing to ground long before it ever got off it...

The OP nails one thing that's indisputable: The AI are beyond selfish. They lack basic Situational Awareness. There are times when you just have to set aside your petty wants and desires and focus on surviving. Deciding your bedroom is more important than your life..? Silliness.

RimWorld is supposed to be about stories. Too many of my tales end in woe. Not the sad, wailing kind where you had to bite the bullet and make heart rending decisions... More so the "hey, why didn't you stop instead of running headlong into a stupid, totally not glorious death" kind. Too many of my colony tales involve stupid, stupid, stupid OMG I can't believe I just witnessed a level of stupidity never before imagined behaviors. That's not good story telling; that doesn't make for compelling tales of glorious defense, the things we had to do and making it out alive.

The AI has to be fixed. As it is, the AI requires the player to suspend their belief in reality and simple logic. No matter how great the rest of the game is, Stupid AI Tricks will undermine, frustrate and ultimately tarnish the game experience. I understand it will never be perfect, but the painfully obvious really should be addressed.
_
Title: Re: Frustrating AI/behaviour and micro management
Post by: Limdood on December 02, 2016, 10:07:36 AM
so many of these suggestions would cause more problems than they'd "fix"

check for pathing/firefighting/medical more often?  way slower speeds

percentile based system where high priority tasks are just USUALLY done?  and people would be complaining about pawns not doing tasks they're assigned.

Haul stuff back to base automatically WHILE going about another task or returning to go to sleep? what if your stockpile is far from your sleeping spots?  It has nothing to do with situational awareness, just priorities.  THIS is their job, they're going to do THIS.  THAT never even comes up because its not what their job is.  If during their execution of THIS task, their work schedule changes, and the game checks job priorities, they will switch to THAT immediately.  If you don't like that, and think they should randomly NOT do their assigned tasks, or randomly prioritize other tasks first that they're not supposed to, can you even imagine the depth of annoyance and frustration of players when their pawns DON'T follow the instructions given?  You'll be flooded with "but Tynan, i instructed my pawns to sleep at X time and instead he went and grabbed something and hauled it halfway across the map to the stockpile on the other side of my base!  now he missed 2/3 of his sleep time!" 

Sure that might not be true for everyone.  But there is a reasonable explanation for why pawns drop what they're doing and go to sleep...that explanation is because you told them to (through their schedule).  How does the person who just lost half their pawn's sleep time fix the situation that he doesn't know WHY it happened because it was only coded in for "convenience?"
Title: Re: Frustrating AI/behaviour and micro management
Post by: Spdskatr on December 02, 2016, 06:49:01 PM
There are already tips/workarounds for everything u mentioned.

-Have you cut all the plants in your home area, walking through a tree is pretty slow imo so colonists will avoid it and take a curved path.
-Set the manual priority for mining to 1, or if it is already at 1, then lower some other priorities.
-Biggest rookie mistake: Don't make your base too big! Home area should be about 100-150 tiles per colonist. Setting up outpost shacks all around the map is also a bad idea.
-Don't set too many tasks up at the same time! Colonists can only do x amount of work per day before they have to rest.
-Colonists' work finding algorithm searches for work in an expanding radius, if a pawn far away from the job has reserved it, then simply draft them and assign another pawn.
-For breaking tasks, if the task is in a closed room eg. cleaning up a hospital, then just draft the colonist, lead them inside, and then forbid the doors until they become idle again. Just remember not to starve them to death.
-Fire: Draft/Undraft all colonists, make sure manual priority for firefighting is set to 1
-Behaviour problems: See above, if that does not work, see above that.
-refusal of dumb labor: well some people are just as spoilt as that, and their personality just can't change. Euthanize them
-waiting hours on a long battle: Remember to engage them in battle and not plain wait, this mechanic was intentional and prevents accidentally starving them to death while drafted.
-Eating humanlike corpses DOES give a mood debuff (http://rimworldwiki.com/wiki/Thoughts_list#Ate_raw_food) unless they are a cannibal trait. I didn't get what you mean.
-The low expectations thing is a life saver in many regards, because it depends on your WEALTH. You don't want people having extreme mental breaks on the first day because they are totally joy deprived or don't have an I pressive bedroom.

Still, imo, the mechanic is pretty bad and should be more user friendly.
1 should be red, 2 should be green, 3 should be white, 4 should be gray.
Title: Re: Frustrating AI/behaviour and micro management
Post by: Bozobub on December 03, 2016, 02:16:03 AM
Yeah, the only thing I scatter around the map is little 4-turret pillboxes (with a "+" of granite between them, to contain explosions), surrounded by sandbags and roofed =) .  It's hideously power hungry and silly expensive to build, and probably no more effective than a good killbox or other fun war crime, but overlapping fields of fire on literally every square meter of soil is mighty amusing for me; not so much raiders.

*RAID Alert*
*akka akka akka akka akka...*
"Run away!  Run aw-urk!"
Oo, look, more hats 8)!

Moar dakka, mah biznitches.
Title: Re: Frustrating AI/behaviour and micro management
Post by: Rokdog on December 04, 2016, 06:39:00 AM
My main criticism of the complaints the OP and others brought up about AI that I'm seeing is that these are all behaviors assumed to be "common sense", which is completely subjective. I see it from the opposite perspective I guess where I like the modular priorities and very literal AI. It allows me to have finer micro management and control over the colonists.

For example, many of you have mentioned hauling. If you specialize your population and practice division of labor, hauling becomes one of those jobs where you need multiple colonists dedicated to it to keep up. This would fall under logistics, which in the real world is a massive undertaking of resources and energy from corporations to armies. Getting stuff from point A to point B efficiently has been a major challenge for civilizations since they've existed.

However, if you start having colonists do automatic "mini-behaviors" that you think should be there, it would mess with the play style of players like me who rely on the AI having a "one-track mind". This also puts Tynan in the position of trying to figure out every single little thing players might think should be "automatic" or "common sense."

I prefer his current solution: Keep control open-ended and give the players lots of tools to fine-tune behavior as they see fit. I just came back to Alpha 15 after an extended break, and never before has the game had so many ways to do this. We have:

- Manual labor priorities control WHAT colonists do for work
- Lockable doors and zones control WHERE colonists work
- Schedules control WHEN colonists work
- The player's strategy and agenda decides WHY the colonists work

The only thing left for us to control is HOW the colonists work, and this is not something that has a "one size fits all" solution, because not everyone wants their workers to work the same way. I happen to like my autistic, laser-sharp focused colonists. Their behavior is predictable, easily controlled and in a worst case scenario even DIRECTLY controllable.

Also, a tip for you guys: If you want your colonists to do something else or go eat or sleep but they won't stop their current task, quickly draft and un-draft them. This clears their current task and causes them to go back through their "What do I do now?" routine. They'll first check their bio needs (rest, food) and then start their usual search for tasks by priority & proximity.

Long-term, it might be Tynan's goal to give players the ability to 100% automate their colony, but having accomplished that in other village-sim games, it can quickly become boring as you now basically have a fancy digital ant farm, and you just sit there and watch it run itself. You have to initiate new construction, wait for an incident, etc., to be forced to actually take action.

Finally, as milon said, as someone else with programming experience (not AI, but large network environment scripts & utils), to me what Tynan has accomplished is really impressive. Not only has he gotten quite a large number of moving parts and numbers to all play along quite smoothly, they also scale well. There's a "sweet spot" when it comes to these kinds of things between quality and quantity. Want one colonist with 1000's of AI routines or nearly 100 colonists with dozens of routines (which we have!)? I'm happy with the latter, with likely more complexity to come as new systems are added.

Sincerely,

- A fan who likes the AI and level of control

EDIT: Read through some more of the recent replies. Lots of great points brought up by Spdskatr and Limdood. Glad I'm not the only one!
Title: Re: Frustrating AI/behaviour and micro management
Post by: RemingtonRyder on December 07, 2016, 03:06:27 PM
There are some good mods to relieve some of the stress caused by AI.

I made a mod called Please Clean The Mine which compares the priority of the mining and cleaning jobs and gives work to pawns according to where I thought they should spend their time.

A perfect AI which could run your colony for you isn't necessarily the best. If it could do that, why would you play the game? :P

That being said... Tynan is willing to make changes to the design in the face of evidence that it doesn't work as expected.
Title: Re: Frustrating AI/behaviour and micro management
Post by: Xav on December 07, 2016, 06:45:35 PM
It would be quite convenient to have the option to order a pawn to do all of one task in an already defined space.

(i.e. cleaning an entire room, doctor everyone in the room, haul everything that is set to be hauled out of the room, etc...)

Just a thought...
Title: Re: Frustrating AI/behaviour and micro management
Post by: Bozobub on December 07, 2016, 07:00:03 PM
Simply forbid the door once they are inside the room containing the task, and only restore it to normal once they are complete
Title: Re: Frustrating AI/behaviour and micro management
Post by: Xav on December 07, 2016, 08:28:39 PM
Quote from: Bozobub on December 07, 2016, 07:00:03 PM
Simply forbid the door once they are inside the room containing the task, and only restore it to normal once they are complete

You are correct; you've stated a work around, but I didn't request a work-around as I already knew about most of the work-around stated in this topic.

I want the pawn to be able to leave the area to eat/sleep/joy and then return to the ordered task until it is finished.  After the task is finished then the work priorities are applied.

Also, it would be 'nice' if manually ordering a pawn to do something would automatically un-assign any other pawns assigned to doing the task.  For instance, I want a pawn 1 with high construction to build a table, but pawn 2 has already been assigned the task.  Currently, the workaround I use is:  draft pawn 2, assign pawn 1 the build, and then un-draft pawn 2.  Why shouldn't ordering pawn 1 to build the table automatically un-assign the task from pawn 2 and have pawn 2 refer to their priority list for the next assignment?

These 'nice tweaks' I mention would be built on an already present foundation of features currently in A15.

I like the game with its flaws.

I'd like it more without them, of course :)

Good day!
Title: Re: Frustrating AI/behaviour and micro management
Post by: bclewis on December 07, 2016, 08:38:57 PM
Quote from: Xav on December 07, 2016, 06:45:35 PM
It would be quite convenient to have the option to order a pawn to do all of one task in an already defined space.

(i.e. cleaning an entire room, doctor everyone in the room, haul everything that is set to be hauled out of the room, etc...)

Just a thought...

...flick both these switches.

[edit: It wasn't until right after I posted this that I realized a partial workaround for my switch flicking annoyances might be to just assign everyone to 0 on flicking by default and micromanage the work priorities when I need switches flicked]